summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2023-05-03 01:38:33 +0200
committerSteve French <stfrench@microsoft.com>2023-05-04 06:03:01 +0200
commit3ac00a2ab69b34189942afa9e862d5170cdcb018 (patch)
tree6518967ea73fdaf2bf8fecd279fc5975f48a72d4 /fs
parentksmbd: fix memleak in session setup (diff)
downloadlinux-3ac00a2ab69b34189942afa9e862d5170cdcb018.tar.xz
linux-3ac00a2ab69b34189942afa9e862d5170cdcb018.zip
ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem()
If share is , share->path is NULL and it cause NULL pointer dereference issue. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20479 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ksmbd/smb2pdu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index 1d3931994a5d..b5f1a2a7389d 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -4885,6 +4885,9 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
int rc = 0, len;
int fs_infoclass_size = 0;
+ if (!share->path)
+ return -EIO;
+
rc = kern_path(share->path, LOOKUP_NO_SYMLINKS, &path);
if (rc) {
pr_err("cannot create vfs path\n");