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 676BD3F9C5 for ; Fri, 27 Dec 2024 13:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735307600; cv=none; b=AiUaDpqByx1XDq3S4zgphnxdsQkvc9Yo0I8dgiSBUH5kiTPl4lnC2m7sV4/pEcj4C5AMmG8n6cYC6QmaE3E3IOl/Wvp2YP+CltJIOU+18mM3RV27B4aoST72KHbtWd7na0AimL9Neqa1ajOWvUVcpv+uA1Sj6Kup/SA+1QOGdCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735307600; c=relaxed/simple; bh=sHE3OSyE5Ouue6KifA0NPEyGSO45ewh6FR427lwb0rU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RuHlDwNajogHqcqWNHVdRfo1ogywgn1J85HcGFqfIDXgneil15kvmkcuYzFkdS2zkkJ+sUeeeD5OQTAM876obdwXAexHj0ruxnnkCcH+Bt96jgTKNAaQZii9E3daKxylYb81vGBcGnfE/DgP4GyHBpZzbqfx/6CQbpmDGQ44vyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zg/GNqdp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zg/GNqdp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C70B6C4CED0; Fri, 27 Dec 2024 13:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735307600; bh=sHE3OSyE5Ouue6KifA0NPEyGSO45ewh6FR427lwb0rU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=zg/GNqdpwExXY+XqCDYvLuwmKEc3veLGqDenFc3rt+scAiqLJyc+dFWhRbbbzcf1w 95yBitTzbec5/IZgJAZYlAz4HgR/ksoBNA3sC8FKt0odogq1PbkTDAJeMCg9/TWxfR 2ks/GlxybHORfuAAcGN7gQv6qljifqzYMscHAvRo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53179: smb: client: fix use-after-free of signing key Date: Fri, 27 Dec 2024 14:52:25 +0100 Message-ID: <2024122719-CVE-2024-53179-2179@gregkh> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2545; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=sHE3OSyE5Ouue6KifA0NPEyGSO45ewh6FR427lwb0rU=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5G4X7D/Vl/91o/UTjbGTsj+rXCVOMLsarWe1VrzTlv 3C0Z5ZHRwwLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkczrDNKUC4f2Nr0IEvjyZ eHLp8pxpvC3qDAtWzTu6Y4Zo040+Ob7bW236tircPMIKAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: smb: client: fix use-after-free of signing key Customers have reported use-after-free in @ses->auth_key.response with SMB2.1 + sign mounts which occurs due to following race: task A task B cifs_mount() dfs_mount_share() get_session() cifs_mount_get_session() cifs_send_recv() cifs_get_smb_ses() compound_send_recv() cifs_setup_session() smb2_setup_request() kfree_sensitive() smb2_calc_signature() crypto_shash_setkey() *UAF* Fix this by ensuring that we have a valid @ses->auth_key.response by checking whether @ses->ses_status is SES_GOOD or SES_EXITING with @ses->ses_lock held. After commit 24a9799aa8ef ("smb: client: fix UAF in smb2_reconnect_server()"), we made sure to call ->logoff() only when @ses was known to be good (e.g. valid ->auth_key.response), so it's safe to access signing key when @ses->ses_status == SES_EXITING. The Linux kernel CVE team has assigned CVE-2024-53179 to this issue. Affected and fixed versions =========================== Fixed in 6.12.2 with commit 0e2b654a3848bf9da3b0d54c1ccf3f1b8c635591 Fixed in 6.13-rc1 with commit 343d7fe6df9e247671440a932b6a73af4fa86d95 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-53179 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/smb/client/smb2proto.h fs/smb/client/smb2transport.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/0e2b654a3848bf9da3b0d54c1ccf3f1b8c635591 https://git.kernel.org/stable/c/343d7fe6df9e247671440a932b6a73af4fa86d95