[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1390558886-4152-1-git-send-email-dvlasenk@redhat.com>
Date: Fri, 24 Jan 2014 11:21:26 +0100
From: Denys Vlasenko <dvlasenk@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH] dcache: fix locking bug in __dentry_path()
If given buffer size is zero, we forget to rcu_read_unlock()
on error path.
Cc: linux-kernel@...r.kernel.org
Cc: Al Viro <viro@...iv.linux.org.uk>
Signed-off-by: Denys Vlasenko <dvlasenk@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists