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=1795099698; b=q/nbw7Jf2X5USOhl0pvrwn8Ghl4UV+3TLOAQnlnYiYIlS1l2NXoVaPGtQXIJUgChbn8m ijJG0+OgbT8pdJWs+IwqaWgvGJmFKtY9GvoesUj8k+RqhGDskLy+kcgYUUCQ6IGPR/Tr5 JMXXN4Q+cgScs91J6LMlxzwbPOQ3yHu6Z0/d0we5FIe97fg2ruqxvwYpw0QNkihJKp8z2 0/HqZQVa76jDkve/7AoLE6N90YN+U1RGp3+fAqSkLe9qC80mkmSKK5ew+5xJVG/xiGP1Q KNSfU5e3eV9M08YPob8hjl7+hHmof+lGIY0fbS3jEbHX6AoCwXyxP+KjqtBwoRbXanQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795099698; 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=48nT9FG6CtkCM/1imG4hcp6NjPq+B8/qoUyKlxVVkMM=; b=KUHYBO6KopH/hTpOoT0W4hJ7Gfn2bt6iwIC0bAVjPgKDbqFGVWFBy33UJhifgF5qhwZE d3cee5niWQpM8/xPPN8LHiOeRPKReGrGjrCawMGZMtT5RfCHtN1K2i5KBxOcxb+5c2vMW jzkVEK07LwPhmEXPzTawCVzZI05fiU4xcYg1Vq4N69SpsjMoSq1RdzrMYt5RLHF711h2B r7c863vxxs7ZtepErU5VlbzBP79iDoRUUOrNjTHfl+t1R7qoU0T3/EqbyVyhji8dIIW4K PLBgn43w0px5iOT/mIvV8OEuTlGs5+cEPf3HCSQ7NVYA8tOR3GeJs2418blgaI4aHyw== 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=Nn56L6h5; 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 B4461606E101 for ; Thu, 19 Nov 2026 14:48:18 +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=Nn56L6h5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C07C31F000C8; Thu, 19 Nov 2026 14:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795099698; bh=48nT9FG6CtkCM/1imG4hcp6NjPq+B8/qoUyKlxVVkMM=; h=From:To:Cc:Subject:Date:Reply-To; b=Nn56L6h5nwYvSIQJ9z9KgZXV7sjacjDU41eVmm0ZWTfcfk5BPEIPD44XYQY5ElD7g y4jVG3Jh2nw23Ag+kuvCkYYMtiGQoiQpFSYSEUqVoNY23qu7sxN6eCwnOEZYCsHGJI KsCj/qRtp5cSWkk+CTr3gy8cngfIzOwJ5NeDdHU4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99429: ocfs2: pin refcount trees before dropping the lookup lock Date: Thu, 19 Nov 2026 15:25:27 +0100 Message-ID: <2026111902-CVE-2026-99429-3581@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=7934; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xM3zxc3RTFOBWJgVSrEZVSUB9jef2y5Di5jHrSS0pBY=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/2ZqMV366EtepuutHb3L6xM4Xx66JzNwT7LjJOdQ1v eX6vwz/jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIuQ3D/CCJC78k9TbUBS9b 2+54pGhNI9fk+wzzq5LCKtOOWdyvYdk0p1ia5+5eQfYbAA== 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: ocfs2: pin refcount trees before dropping the lookup lock A refcount tree returned to ocfs2_lock_refcount_tree() must stay alive until that caller releases its operation reference. However, ocfs2_get_refcount_tree() returns the cached pointer after dropping osb_lock, and the caller only takes its kref afterwards. The registry reference does not protect this gap from concurrent removal. This can happen when another node frees a refcount root and reuses its block with a different generation while this mount retains the old cached tree. Two local operations on different inodes sharing the new root, such as data CoW and an external xattr update, can then look up the same stale tree. Their inode locks are independent, and both the REFCOUNT DLM lock and rf_sem are acquired after the first operation reference. The following ordering is possible, with no other operation references: Data CoW Xattr update -------- ------------ Look up the old tree under osb_lock, then drop osb_lock Look up the same tree and take a kref Acquire the tree locks and read the new on-disk generation Erase the old tree under osb_lock Unlock and drop the operation kref Drop the registry kref, freeing tree Take a kref through the freed tree pointer The final kref_get() accesses freed rf_getcnt storage, and subsequent accesses in ocfs2_lock_refcount_tree() also use the freed allocation. Take the operation reference in ocfs2_get_refcount_tree() before releasing osb_lock, including when an insertion loses to another lookup. Removal must acquire the same lock, so it cannot drop the registry reference before the lookup has pinned the tree. Keep the existing unlock and error path puts. The two callers that already hold the refcount tree lock keep their borrowed lookup behavior and do not acquire an extra reference. KASAN report as below: BUG: KASAN: slab-use-after-free in ocfs2_lock_refcount_tree+0x94a/0x9b0 Read of size 4 at addr ffff888117212820 by task python3/497 [Kernel and hardware identification omitted.] Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? ocfs2_lock_refcount_tree+0x94a/0x9b0 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20e/0x420 ? ocfs2_lock_refcount_tree+0x94a/0x9b0 kasan_report+0xe0/0x110 ? ocfs2_lock_refcount_tree+0x94a/0x9b0 ocfs2_lock_refcount_tree+0x94a/0x9b0 ? __pfx_ocfs2_lock_refcount_tree+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? ocfs2_refcount_cow+0x3b6/0xd90 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kmalloc_cache_noprof+0x28d/0x610 ? ocfs2_refcount_cow+0x3b6/0xd90 ocfs2_refcount_cow+0x410/0xd90 ? __pfx_ocfs2_refcount_cow+0x10/0x10 ? __pfx___might_resched+0x10/0x10 ? down_write+0x11a/0x1f0 ? __pfx_down_write+0x10/0x10 ? ocfs2_inode_unlock+0x1a9/0x260 ? __pfx_ocfs2_inode_unlock+0x10/0x10 ? ocfs2_file_write_iter+0x1413/0x1d30 ocfs2_file_write_iter+0x157b/0x1d30 ? __pfx_ocfs2_file_write_iter+0x10/0x10 ? lock_acquire+0x190/0x300 ? __x64_sys_pwrite64+0x1b7/0x220 ? __pfx___might_resched+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? security_file_permission+0x26/0x80 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x8f/0x100 vfs_write+0x639/0x1010 ? __pfx_ocfs2_file_write_iter+0x10/0x10 ? lock_vma_under_rcu+0x154/0x4a0 ? __pfx_vfs_write+0x10/0x10 ? lock_release+0x121/0x290 ? srso_alias_return_thunk+0x5/0xfbef5 __x64_sys_pwrite64+0x1b7/0x220 ? __pfx___x64_sys_pwrite64+0x10/0x10 ? irqentry_exit+0xbe/0x820 ? srso_alias_return_thunk+0x5/0xfbef5 ? trace_hardirqs_on_prepare+0x11d/0x150 ? srso_alias_return_thunk+0x5/0xfbef5 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f [Register dump omitted.] Allocated by task 491: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x28d/0x610 ocfs2_allocate_refcount_tree+0x49/0x1a0 ocfs2_create_refcount_tree+0x5d7/0x1630 ocfs2_attach_refcount_tree+0x57d/0x1100 __ocfs2_reflink.isra.0+0x1c4/0x1940 ocfs2_reflink+0x501/0x9b0 ocfs2_reflink_ioctl+0x6b2/0x920 ocfs2_ioctl+0x538/0x640 __x64_sys_ioctl+0x163/0x1d0 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 498: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 kfree+0x308/0x580 ocfs2_lock_refcount_tree+0x672/0x9b0 ocfs2_xattr_set+0x72c/0x2530 ocfs2_xattr_user_set+0xaf/0xf0 __vfs_setxattr+0x143/0x1b0 __vfs_setxattr_noperm+0x112/0x5b0 __vfs_setxattr_locked+0xfe/0x2b0 vfs_setxattr+0x13c/0x370 do_setxattr+0x128/0x170 filename_setxattr+0x147/0x190 path_setxattrat+0x1ac/0x260 __x64_sys_setxattr+0xcb/0x140 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888117212800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 32 bytes inside of freed 1024-byte region [ffff888117212800, ffff888117212c00) [Page and memory dumps omitted.] The Linux kernel CVE team has assigned CVE-2026-99429 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.32 with commit 374a263e790c4de85844283c098810a92985f623 and fixed in 6.12.117 with commit ce7b46556af15642a1e9f8d0c596022dd7cfb4a7 Issue introduced in 2.6.32 with commit 374a263e790c4de85844283c098810a92985f623 and fixed in 6.18.61 with commit 7ff4f020f7b03fddd529735f0b61ac0a8dd92c9e Issue introduced in 2.6.32 with commit 374a263e790c4de85844283c098810a92985f623 and fixed in 7.3.2 with commit 2d9e864c234469dc7f56ea974f8269d251441e6a Issue introduced in 2.6.32 with commit 374a263e790c4de85844283c098810a92985f623 and fixed in 7.4-rc1 with commit 8c714a074074af7ae59233c1fa6ef9d7aa710462 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-99429 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/ocfs2/refcounttree.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/ce7b46556af15642a1e9f8d0c596022dd7cfb4a7 https://git.kernel.org/stable/c/7ff4f020f7b03fddd529735f0b61ac0a8dd92c9e https://git.kernel.org/stable/c/2d9e864c234469dc7f56ea974f8269d251441e6a https://git.kernel.org/stable/c/8c714a074074af7ae59233c1fa6ef9d7aa710462