From: Miklos Szeredi Date: Mon, 22 Aug 2011 11:20:19 +0000 (+0200) Subject: fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message X-Git-Tag: next-20110823~69^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=18e71d038a93a6c732572f8af419d3aa78fe8bd3;p=karo-tx-linux.git fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message 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 --- diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 640fc229df10..168a80f7f12b 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1358,6 +1358,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);