diff options
author | Namjae Jeon | 2023-12-31 16:12:38 +0900 |
---|---|---|
committer | Greg Kroah-Hartman | 2024-01-05 15:18:29 +0100 |
commit | 6d4e21e369f3c09e6a25056b9af2be9571855665 (patch) | |
tree | 6189480b3420b1f98a303be42251d2c560ac818c | |
parent | 6927ffe7479c72e7ebf885507227266a75f7c97d (diff) |
ksmbd: fix uninitialized pointer read in ksmbd_vfs_rename()
[ Upstream commit 48b47f0caaa8a9f05ed803cb4f335fa3a7bfc622 ]
Uninitialized rd.delegated_inode can be used in vfs_rename().
Fix this by setting rd.delegated_inode to NULL to avoid the uninitialized
read.
Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")
Reported-by: Coverity Scan <scan-admin@coverity.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/smb/server/vfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index 58a6665f1c3a..5d2bb58d77e8 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -744,6 +744,7 @@ retry: rd.new_dir = new_path.dentry->d_inode, rd.new_dentry = new_dentry, rd.flags = flags, + rd.delegated_inode = NULL, err = vfs_rename(&rd); if (err) ksmbd_debug(VFS, "vfs_rename failed err %d\n", err); |