lkml.org 
[lkml]   [2014]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] dcache: fix locking bug in __dentry_path()
Date
If given buffer size is zero, we forget to rcu_read_unlock()
on error path.

Cc: linux-kernel@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
---
fs/dcache.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index cb4a106..24a01fc 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3127,8 +3127,11 @@ restart:
end = buf + buflen;
len = buflen;
prepend(&end, &len, "\0", 1);
- if (buflen < 1)
+ if (buflen < 1) {
+ if (!(seq & 1))
+ rcu_read_unlock();
goto Elong;
+ }
/* Get '/' right */
retval = end-1;
*retval = '/';
--
1.8.1.4


\
 
 \ /
  Last update: 2014-01-24 11:41    [W:0.054 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site