Thread (194 messages) 194 messages, 10 authors, 2012-06-27

[ 173/175] nfsd: dont allow zero length strings in cache_parse()

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2012-03-30 21:34:09
Also in: lkml

3.3-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <redacted>

commit 6d8d17499810479eabd10731179c04b2ca22152f upstream.

There is no point in passing a zero length string here and quite a
few of that cache_parse() implementations will Oops if count is
zero.

Signed-off-by: Dan Carpenter <redacted>
Signed-off-by: J. Bruce Fields <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/cache.c |    2 ++
 1 file changed, 2 insertions(+)
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -828,6 +828,8 @@ static ssize_t cache_do_downcall(char *k
 {
 	ssize_t ret;
 
+	if (count == 0)
+		return -EINVAL;
 	if (copy_from_user(kaddr, buf, count))
 		return -EFAULT;
 	kaddr[count] = '\0';

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help