From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 439FA168B4 for ; Mon, 8 May 2023 09:53:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBA59C433EF; Mon, 8 May 2023 09:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683539638; bh=Q2Sai8ec9u1/+g6OIGrAdwFdvHVwtH13NwfguS3+Bfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aauAisIwK/a0l/nURPdYUQMlxqYq/BP5ByCzrrnRZ54WcjZlOQjRUAtDTc1JCTvsj pdOHW1qQ4IT8X92UXq8yHYax2OK27BStJ5BMnQ1n5fuInVc2gmBSZQ2QZGLe9lJlJz 9w/bcswhCp46xag0qBuYpx7Uu9TJhl7B3Qttb980= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Namjae Jeon , Steve French , zdi-disclosures@trendmicro.com Subject: [PATCH 6.1 089/611] ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem() Date: Mon, 8 May 2023 11:38:51 +0200 Message-Id: <20230508094425.049125170@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094421.513073170@linuxfoundation.org> References: <20230508094421.513073170@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Namjae Jeon 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 Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/ksmbd/smb2pdu.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -4913,6 +4913,9 @@ static int smb2_get_info_filesystem(stru 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");