mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
fuse: initialize the flock flag in fuse_file on allocation
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 <[email protected]>
Fixes: 37fb3a30b4 ("fuse: fix flock")
Cc: <[email protected]> # v3.1+
Signed-off-by: Miklos Szeredi <[email protected]>
This commit is contained in:
parent
2ea659a9ef
commit
68227c03cb
1 changed files with 1 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue