From: Miklos Szeredi Date: Wed, 24 Aug 2011 08:20:17 +0000 (+0200) Subject: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message X-Git-Tag: v2.6.33.19~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=54535f716d3f635179a8033a8dab6306ef5cb90e;p=karo-tx-linux.git 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 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 51d9e33d634f..5cbeb74854fd 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -899,6 +899,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);