Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795100697; b=0YeJPrJIPKVeIfAAkPTXaD/Ik7cnuF5ZyldMKVZIxVAwCOwje1Cbv9ElQ7cvpdUPPXsD knsSJBcI2n0QZyfDuPgTmB0Nt4RmzQRAfQ/SSt/STDbSA0Zt27iIaWqDBT6wOoBAqh39T 6B+e2QKOm87CA1e/IEKNqKD9D8XStr0QfIOmQP6vA3O0tJtpbgJatcfudUpE5F2+zwXtr sJlj4pWcp4JWwuDjPfT4D8P1W50D+cBIsOhq7mJ8AqNRi3PFKvxI/P1B8Go1BgDTI8eAS EXIW+LdcY+zVyCbpJrQmFM9VrCObkTZeDruSvDQpPNxy6ppkW46fyaM7ZaELb+7yToQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795100697; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=Lp5oLUOphUl4ckIN8NVDX/d0KdBeI4RsQkPGkoFHF5w=; b=QUcaFFDtYTWmTJ3m8HwhSj4T5aFAky8Vf2pI4VZwlGSB3RYUlYY5ohlvilJ0emPU0kis aeMwtmzeADm+V1UkoTsFf/MA1vGl3OTDf+qc/PAMeBhm/H8iFbVdzHyrTTZ8WlHRBmx8w ReNNzQd1NYbsCuK6RWW9LMVDnIn9ApPL0WiMWzhC1COkNZo8eMuaw36IriETEH61Ebix5 9hw8UX943QwTNln5XttrZzEiv0qtrTgrlc76W73RSdqPw8YOI8X7wqr17LY/HuD4nX9xN J90BOI+GK0XAbCOOQ+iRkdwYFt+0bp71JcJPH6nvS/h2huduSmK9xGI/qGFUsXSou3Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=lI7rhl3P; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C95DB606A320 for ; Thu, 19 Nov 2026 15:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=lI7rhl3P Received: by smtp.kernel.org (Postfix) with ESMTPSA id A59831F000C4; Thu, 19 Nov 2026 15:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795100697; bh=Lp5oLUOphUl4ckIN8NVDX/d0KdBeI4RsQkPGkoFHF5w=; h=From:To:Cc:Subject:Date:Reply-To; b=lI7rhl3P9EzW6AjifszrUILZGMjExvTYTGHdu2Ay7I5JG20CnuVqkKLDMjXovLfdc u3PeYm7D0fMbtvwWMmHM1z6yj/viq2up3924Up+x/jCyA8QfRjrw1XV+C+JWGEOCrq 9Ld/G9NR4Oviil1l5I6wVtq0lgK4eb9EiK9fTDxg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99540: ksmbd: fix parent dentry lifetime in directory enumeration Date: Thu, 19 Nov 2026 15:27:18 +0100 Message-ID: <2026111923-CVE-2026-99540-314b@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3852; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=sCjDkklFXaghgV99694XOYnzg1frFHki57IoblLnFuU=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/2aav2zY/ZULBxraXUxzcpzSzFhQX1/T/VUri8NUxm HuwnNW1I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZSdYBhnsZzD+V8rZsn0/P2 fJ+/N2LT/VmSnQzz0zcYlHZvfG7CJ9dt6Xpq+uS8VfGmAA== 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: ksmbd: fix parent dentry lifetime in directory enumeration ksmbd_populate_dot_dotdot_entries() builds the ".." entry from the open directory's d_parent and passes that pointer to ksmbd_vfs_fill_dentry_attrs() without taking a reference. That pointer is only valid while the directory stays under this parent. If a concurrent rename moves the directory elsewhere, the old parent loses its last reference; a following rmdir then turns it into a negative dentry with d_inode cleared, and after the RCU grace period the dentry itself is freed. The worker still holds the raw pointer and dereferences d_inode through vfs_getattr() and vfs_getxattr(). A remote SMB client, authenticated or guest, triggers this by listing a directory while that directory is moved under a new parent and the old parent is deleted. It can be done by the client itself with write access or by other concurrent writers, triggering null-ptr-deref and slab-use-after-free on a KASAN build. KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] Workqueue: ksmbd-io handle_ksmbd_work RIP: 0010:xattr_permission+0x9d/0x160 Call Trace: vfs_getxattr+0x9c/0x1b0 ksmbd_vfs_getxattr+0x82/0x100 ksmbd_vfs_get_dos_attrib_xattr+0x7f/0x130 ksmbd_vfs_fill_dentry_attrs+0x435/0x650 ksmbd_populate_dot_dotdot_entries+0x25e/0x630 smb2_query_dir+0xcf9/0x1a20 handle_ksmbd_work+0x5f1/0x1c80 process_one_work+0x90b/0x19d0 Fix by using the dentry reference counting APIs: take the parent with dget_parent(), take a matching dget() on ".", and dput() the dentry once ksmbd_vfs_fill_dentry_attrs() has returned or the pattern does not match. The Linux kernel CVE team has assigned CVE-2026-99540 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 6.12.117 with commit 32934b13b1a63c86d2fa68df0bfb28c51ce38879 Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 6.18.61 with commit 93566781118cdff874023d5ca4e7b8054baaec31 Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 7.3.2 with commit b62ef8cfec9351662e42cbf7da2d743068699bba Issue introduced in 5.15 with commit e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 and fixed in 7.4-rc1 with commit 171df27077fb49b4af2c53ad2cedcd0e39664fe8 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-2026-99540 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/server/smb_common.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/32934b13b1a63c86d2fa68df0bfb28c51ce38879 https://git.kernel.org/stable/c/93566781118cdff874023d5ca4e7b8054baaec31 https://git.kernel.org/stable/c/b62ef8cfec9351662e42cbf7da2d743068699bba https://git.kernel.org/stable/c/171df27077fb49b4af2c53ad2cedcd0e39664fe8