Commit 3ac00a2a authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

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: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6d7cb549
...@@ -4885,6 +4885,9 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work, ...@@ -4885,6 +4885,9 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
int rc = 0, len; int rc = 0, len;
int fs_infoclass_size = 0; int fs_infoclass_size = 0;
if (!share->path)
return -EIO;
rc = kern_path(share->path, LOOKUP_NO_SYMLINKS, &path); rc = kern_path(share->path, LOOKUP_NO_SYMLINKS, &path);
if (rc) { if (rc) {
pr_err("cannot create vfs path\n"); pr_err("cannot create vfs path\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment