[lkml]   [2020]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] fs: fix KMSAN uninit-value bug by initializing nd in do_file_open_root
The KMSAN bug report for the bug indicates that there exists;
Local variable ----nd@do_file_open_root created at:
do_file_open_root+0xa4/0xb40 fs/namei.c:3385
do_file_open_root+0xa4/0xb40 fs/namei.c:3385

Initializing nd fixes this issue, and doesn't break anything else either

Signed-off-by: Anant Thazhemadam <>
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index e99e2a9da0f7..b27382586209 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3404,7 +3404,7 @@ struct file *do_filp_open(int dfd, struct filename *pathname,
struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
const char *name, const struct open_flags *op)
- struct nameidata nd;
+ struct nameidata nd = {};
struct file *file;
struct filename *filename;
int flags = op->lookup_flags | LOOKUP_ROOT;
 \ /
  Last update: 2020-09-16 07:28    [W:0.075 / U:1.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site