]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem()
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 2 May 2023 23:38:33 +0000 (08:38 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:10:53 +0000 (23:10 +0900)
commit 3ac00a2ab69b34189942afa9e862d5170cdcb018 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/smb2pdu.c

index 61e47f66f2f2bc554e6c9e4c5a35d2303d0071f1..aef1eb1a0710b9de82c7f69ebdeef9fceb149a00 100644 (file)
@@ -4915,6 +4915,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");