lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  7 Jun 2017 12:26:49 +0200
From:   Mateusz Jurczyk <mjurczyk@...gle.com>
To:     Miklos Szeredi <miklos@...redi.hu>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fuse: Initialize the flock flag in the fuse_file structure upon allocation

Add initialization of the flock flag in the fuse_file structure after it
is allocated.

Before the patch, the flock flag could remain uninitialized for the
lifespan of the fuse_file allocation: it was not pre-set by kmalloc() or
later in the fuse_file_alloc() function. 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 <mjurczyk@...gle.com>
---
 fs/fuse/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 3ee4fdc3da9e..c9a86a748ceb 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -66,6 +66,8 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
 	ff->kh = ++fc->khctr;
 	spin_unlock(&fc->lock);
 
+	ff->flock = false;
+
 	return ff;
 }
 
-- 
2.13.1.508.gb3defc5cc-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ