Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2183d1e authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

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: default avatarHan-Wen Nienhuys <hanwenn@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
CC: stable@kernel.org
parent 478e0841
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);