From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7857C77B73 for ; Mon, 8 May 2023 10:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234535AbjEHKXk (ORCPT ); Mon, 8 May 2023 06:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234435AbjEHKXB (ORCPT ); Mon, 8 May 2023 06:23:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DDD526465 for ; Mon, 8 May 2023 03:22:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C8D3162569 for ; Mon, 8 May 2023 10:22:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA65EC433EF; Mon, 8 May 2023 10:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683541368; bh=umZwhx9moBd5VhiNpykp4gODR1Hew9NqKztJDGBaYKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kU9Wd5N2GHVx+OxvLydgkInN7kft4cA/uY2MkpBtDQJlKZ5vCHU/icjW3lCXDAfY8 zGZ/g62N3+BldN22vQvjKgXqg97mUZvFCsawXhJfp0qa0PirpADkI979lTWL261Szl uSmt/RJ5Hh5VkYYskVOTDuHT7gjYyzOeDz8McOH4= 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.2 092/663] ksmbd: fix NULL pointer dereference in smb2_get_info_filesystem() Date: Mon, 8 May 2023 11:38:38 +0200 Message-Id: <20230508094431.442700852@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094428.384831245@linuxfoundation.org> References: <20230508094428.384831245@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 @@ -4915,6 +4915,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");