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 F160B1C84D7 for ; Tue, 9 Dec 2025 04:10:19 +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=1765253420; cv=none; b=sfMc50SMEDCvA2Yd7Qcl+Utu8udjnNAqBFh1BOC8i2gE1j8iUVy4OTiAvYWPWsCUMljPxnLH3HiH/QHsv/ZoJtemI1ixT409TQUEaFzCiNwhiC++81qa6LLwUtjogKN3C0szAKOu9ub+2FD7nJyxewa+4u+rj1gbINf64b8X7rg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765253420; c=relaxed/simple; bh=Jf7R5xFPoEY2Vxdsf2+SNwB/l6Mu9DFfhHH2PJqtczw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dWm9xEVGNacDgzCu6DKfD6qGFtwvq8WorQ9BcwjWObZ8F7yvYI5nepVpKKJ0occIUfjViL8CU5G0JgwDwXWiuhEVWgzNZfR2q0DEJdwo+JEP5myKa3yW+YcDqw2K4OHLxfFzKkF8mNsUl+l9N5xy4SGu+CXAnQhVhOM/dBNpOT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=c2vOUYgH; 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="c2vOUYgH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28196C4CEF5; Tue, 9 Dec 2025 04:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765253419; bh=Jf7R5xFPoEY2Vxdsf2+SNwB/l6Mu9DFfhHH2PJqtczw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=c2vOUYgH7/CMLkXgeETQ6n3j6rK+LlL2Tc4RFIqoNtzH+32xHQPpbJJWCSwPN8Ioi +5/c7TmNC+56xI3Vl8iT311AYaV7tER1yaQ4X/ibnZopdwiUP9M4h0XUIG+soVSkMY +2dvsoQ1gJpdlg66KSEGHhAh/YxdBrFirX3axi2Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40328: smb: client: fix potential UAF in smb2_close_cached_fid() Date: Tue, 9 Dec 2025 13:10:10 +0900 Message-ID: <2025120909-CVE-2025-40328-a95b@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2524; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GMPiYrEKrpTV2KgLZqj4BzIHzClYMsbHSiXX4KdGhJ0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmCxV9ehmyeR4d37BELVR7pr+rr2/ueoG7jxoq6uN+G hxsvFPaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABN5fJNhwYZAa643PtWGLfI3 fkblflsgqRHwn2GuiLN2BjOHZXJ8+enjUa1rpZo8/qcAAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: smb: client: fix potential UAF in smb2_close_cached_fid() find_or_create_cached_dir() could grab a new reference after kref_put() had seen the refcount drop to zero but before cfid_list_lock is acquired in smb2_close_cached_fid(), leading to use-after-free. Switch to kref_put_lock() so cfid_release() is called with cfid_list_lock held, closing that gap. The Linux kernel CVE team has assigned CVE-2025-40328 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit ebe98f1447bbccf8228335c62d86af02a0ed23f7 and fixed in 6.6.117 with commit cb52d9c86d70298de0ab7c7953653898cbc0efd6 Issue introduced in 6.1 with commit ebe98f1447bbccf8228335c62d86af02a0ed23f7 and fixed in 6.12.58 with commit 065bd62412271a2d734810dd50336cae88c54427 Issue introduced in 6.1 with commit ebe98f1447bbccf8228335c62d86af02a0ed23f7 and fixed in 6.17.8 with commit bdb596ceb4b7c3f28786a33840263728217fbcf5 Issue introduced in 6.1 with commit ebe98f1447bbccf8228335c62d86af02a0ed23f7 and fixed in 6.18 with commit 734e99623c5b65bf2c03e35978a0b980ebc3c2f8 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-2025-40328 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/cached_dir.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/cb52d9c86d70298de0ab7c7953653898cbc0efd6 https://git.kernel.org/stable/c/065bd62412271a2d734810dd50336cae88c54427 https://git.kernel.org/stable/c/bdb596ceb4b7c3f28786a33840263728217fbcf5 https://git.kernel.org/stable/c/734e99623c5b65bf2c03e35978a0b980ebc3c2f8