aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-08-24 10:20:17 +0200
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-17 11:21:36 -0400
commit0b55eccde1145e8e2b31fe855cdba3987676beb8 (patch)
treef2627f5a88a77a7f4eb8c7380394e3004a8076c1
parent1c0f1dabcdd6dd6d03e797e097b0bc061f419691 (diff)
downloadlinux-linaro-stable-0b55eccde1145e8e2b31fe855cdba3987676beb8.tar.gz
fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
commit c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae upstream. FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the message processing could overrun and result in a "kernel BUG at fs/fuse/dev.c:629!" Reported-by: Han-Wen Nienhuys <hanwenn@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--fs/fuse/dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index c235afc698a0..9897fe338818 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -901,6 +901,10 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
if (outarg.namelen > FUSE_NAME_MAX)
goto err;
+ err = -EINVAL;
+ if (size != sizeof(outarg) + outarg.namelen + 1)
+ goto err;
+
name.name = buf;
name.len = outarg.namelen;
err = fuse_copy_one(cs, buf, outarg.namelen + 1);