Skip to content

Commit c2183d1

Browse files
author
Miklos Szeredi
committed
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 <hanwenn@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@kernel.org
1 parent 478e084 commit c2183d1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎fs/fuse/dev.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,10 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
13581358
if (outarg.namelen > FUSE_NAME_MAX)
13591359
goto err;
13601360

1361+
err = -EINVAL;
1362+
if (size != sizeof(outarg) + outarg.namelen + 1)
1363+
goto err;
1364+
13611365
name.name = buf;
13621366
name.len = outarg.namelen;
13631367
err = fuse_copy_one(cs, buf, outarg.namelen + 1);

0 commit comments

Comments
 (0)