mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
commit c2183d1e9b 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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
44510a7f9f
commit
4ca4e81680
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user