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

Commit 9bba1b1b authored by Mateusz Jurczyk's avatar Mateusz Jurczyk Committed by Greg Kroah-Hartman
Browse files

fuse: initialize the flock flag in fuse_file on allocation



commit 68227c03cba84a24faf8a7277d2b1a03c8959c2c upstream.

Before the patch, the flock flag could remain uninitialized for the
lifespan of the fuse_file allocation. Unless set to true in
fuse_file_flock(), it would remain in an indeterminate state until read in
an if statement in fuse_release_common(). This could consequently lead to
taking an unexpected branch in the code.

The bug was discovered by a runtime instrumentation designed to detect use
of uninitialized memory in the kernel.

Signed-off-by: default avatarMateusz Jurczyk <mjurczyk@google.com>
Fixes: 37fb3a30 ("fuse: fix flock")
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 805348a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
{
{
	struct fuse_file *ff;
	struct fuse_file *ff;


	ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL);
	ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL);
	if (unlikely(!ff))
	if (unlikely(!ff))
		return NULL;
		return NULL;