Patch "fuse: initialize the flock flag in fuse_file on allocation" has been added to the 3.18-stable tree
From: <gregkh@linuxfoundation.org>
Date: 2017-08-14 00:33:48
This is a note to let you know that I've just added the patch titled
fuse: initialize the flock flag in fuse_file on allocation
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
fuse-initialize-the-flock-flag-in-fuse_file-on-allocation.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.
From 68227c03cba84a24faf8a7277d2b1a03c8959c2c Mon Sep 17 00:00:00 2001
From: Mateusz Jurczyk <redacted>
Date: Wed, 7 Jun 2017 12:26:49 +0200
Subject: fuse: initialize the flock flag in fuse_file on allocation
From: Mateusz Jurczyk <redacted>
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: Mateusz Jurczyk <redacted>
Fixes: 37fb3a30b462 ("fuse: fix flock")
Signed-off-by: Miklos Szeredi <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/fuse/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c@@ -54,7 +54,7 @@ struct fuse_file *fuse_file_alloc(struct { struct fuse_file *ff; - ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); + ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); if (unlikely(!ff)) return NULL;
Patches currently in stable-queue which might be from mjurczyk@google.com are queue-3.18/fuse-initialize-the-flock-flag-in-fuse_file-on-allocation.patch