{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99429","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.414Z","datePublished":"2026-11-19T14:40:51.812Z","dateUpdated":"2026-11-22T11:08:12.672Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-22T11:08:12.672Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: pin refcount trees before dropping the lookup lock\n\nA refcount tree returned to ocfs2_lock_refcount_tree() must stay alive\nuntil that caller releases its operation reference. However,\nocfs2_get_refcount_tree() returns the cached pointer after dropping\nosb_lock, and the caller only takes its kref afterwards. The registry\nreference does not protect this gap from concurrent removal.\n\nThis can happen when another node frees a refcount root and reuses its\nblock with a different generation while this mount retains the old\ncached tree. Two local operations on different inodes sharing the new\nroot, such as data CoW and an external xattr update, can then look up\nthe same stale tree. Their inode locks are independent, and both the\nREFCOUNT DLM lock and rf_sem are acquired after the first operation\nreference.\n\nThe following ordering is possible, with no other operation references:\n\n  Data CoW                         Xattr update\n  --------                         ------------\n  Look up the old tree under\n    osb_lock, then drop osb_lock\n                                   Look up the same tree and take a kref\n                                   Acquire the tree locks and read the\n                                     new on-disk generation\n                                   Erase the old tree under osb_lock\n                                   Unlock and drop the operation kref\n                                   Drop the registry kref, freeing tree\n  Take a kref through the\n    freed tree pointer\n\nThe final kref_get() accesses freed rf_getcnt storage, and subsequent\naccesses in ocfs2_lock_refcount_tree() also use the freed allocation.\n\nTake the operation reference in ocfs2_get_refcount_tree() before\nreleasing osb_lock, including when an insertion loses to another lookup.\nRemoval must acquire the same lock, so it cannot drop the registry\nreference before the lookup has pinned the tree. Keep the existing\nunlock and error path puts. The two callers that already hold the\nrefcount tree lock keep their borrowed lookup behavior and do not\nacquire an extra reference.\n\nKASAN report as below:\n\n    BUG: KASAN: slab-use-after-free in ocfs2_lock_refcount_tree+0x94a/0x9b0\n    Read of size 4 at addr ffff888117212820 by task python3/497\n\n[Kernel and hardware identification omitted.]\n\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x93/0xd0\n     print_report+0xce/0x630\n     ? ocfs2_lock_refcount_tree+0x94a/0x9b0\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __virt_addr_valid+0x20e/0x420\n     ? ocfs2_lock_refcount_tree+0x94a/0x9b0\n     kasan_report+0xe0/0x110\n     ? ocfs2_lock_refcount_tree+0x94a/0x9b0\n     ocfs2_lock_refcount_tree+0x94a/0x9b0\n     ? __pfx_ocfs2_lock_refcount_tree+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? ocfs2_refcount_cow+0x3b6/0xd90\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? __kmalloc_cache_noprof+0x28d/0x610\n     ? ocfs2_refcount_cow+0x3b6/0xd90\n     ocfs2_refcount_cow+0x410/0xd90\n     ? __pfx_ocfs2_refcount_cow+0x10/0x10\n     ? __pfx___might_resched+0x10/0x10\n     ? down_write+0x11a/0x1f0\n     ? __pfx_down_write+0x10/0x10\n     ? ocfs2_inode_unlock+0x1a9/0x260\n     ? __pfx_ocfs2_inode_unlock+0x10/0x10\n     ? ocfs2_file_write_iter+0x1413/0x1d30\n     ocfs2_file_write_iter+0x157b/0x1d30\n     ? __pfx_ocfs2_file_write_iter+0x10/0x10\n     ? lock_acquire+0x190/0x300\n     ? __x64_sys_pwrite64+0x1b7/0x220\n     ? __pfx___might_resched+0x10/0x10\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? security_file_permission+0x26/0x80\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     ? lock_is_held_type+0x8f/0x100\n     vfs_write+0x639/0x1010\n     ? __pfx_ocfs2_file_write_iter+0x10/0x10\n     ? lock_vma_under_rcu+0x154/0x4a0\n     ? __pfx_vfs_write+0x10/0x10\n     ? lock_release+0x121/0x290\n     ? srso_alias_return_thunk+0x5/0xfbef5\n     __x64_sys_pwrite64+0x1b7/0x220\n     ? __pfx___x64_sys_pwrite64+0x10/0x10\n     ? irqentry_exit+0xbe/0x820\n---truncated---"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - pwrite64 reaches the gap through ocfs2_file_write_iter, ocfs2_prepare_inode_for_write, ocfs2_refcount_cow, and ocfs2_lock_refcount_tree into ocfs2_get_refcount_tree, which drops osb_lock and returns the cached tree before kref_get of rf_getcnt. The freeing side is setxattr via ocfs2_xattr_user_set and ocfs2_xattr_set. The generation that causes the free is the on-disk rf_generation of the reused refcount block.\nAC:L - The attacker caches the tree on one node, then from the other node unlinks the last user so ocfs2_remove_refcount_tree frees the block and ocfs2_create_refcount_tree stores a new rf_generation when ocfs2_claim_metadata reuses it. On the caching node the attacker races pwrite and setxattr on two inodes whose inode locks are independent.\nPR:L - ocfs2_reflink_ioctl admits any caller who passes inode_permission MAY_WRITE|MAY_EXEC on the destination directory and MAY_READ on the source. The free is a user.* setxattr in ocfs2_xattr_user_set; xattr_permission allows that on a writable regular file.\nUI:N - The attacker creates the reflinked inodes and issues both pwrite64 and setxattr on the already-mounted cluster volume.\nS:U - The object freed by the generation-mismatch put in ocfs2_lock_refcount_tree is that mount's ocfs2_refcount_tree slab allocation, so the corruption remains in the same host kernel.\nC:H - kref_get touches the freed rf_getcnt, then ocfs2_refcount_lock walks the embedded rf_lockres and ocfs2_read_blocks calls through rf_ci.ci_ops, so a reclaim of the kmalloc-1k slot lets the attacker chase kernel pointers.\nI:H - On the freed ocfs2_refcount_tree, __ocfs2_lock_refcount_tree down_writes rf_sem and ocfs2_cluster_lock follows l_ops, and ocfs2_read_blocks calls ci_ops, so a sprayed 1024-byte object supplies a kernel write and a function-pointer call.\nA:H - The reported KASAN hit is a slab-use-after-free in ocfs2_lock_refcount_tree when kref_get uses the tree already freed by the setxattr path's generation-mismatch put, which oopses the kernel."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/refcounttree.c"],"versions":[{"version":"374a263e790c4de85844283c098810a92985f623","lessThan":"ce7b46556af15642a1e9f8d0c596022dd7cfb4a7","status":"affected","versionType":"git"},{"version":"374a263e790c4de85844283c098810a92985f623","lessThan":"7ff4f020f7b03fddd529735f0b61ac0a8dd92c9e","status":"affected","versionType":"git"},{"version":"374a263e790c4de85844283c098810a92985f623","lessThan":"2d9e864c234469dc7f56ea974f8269d251441e6a","status":"affected","versionType":"git"},{"version":"374a263e790c4de85844283c098810a92985f623","lessThan":"8c714a074074af7ae59233c1fa6ef9d7aa710462","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/refcounttree.c"],"versions":[{"version":"2.6.32","status":"affected"},{"version":"0","lessThan":"2.6.32","status":"unaffected","versionType":"semver"},{"version":"6.12.117","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.61","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.2","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.32","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.32","versionEndExcluding":"6.18.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.32","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.32","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/ce7b46556af15642a1e9f8d0c596022dd7cfb4a7"},{"url":"https://git.kernel.org/stable/c/7ff4f020f7b03fddd529735f0b61ac0a8dd92c9e"},{"url":"https://git.kernel.org/stable/c/2d9e864c234469dc7f56ea974f8269d251441e6a"},{"url":"https://git.kernel.org/stable/c/8c714a074074af7ae59233c1fa6ef9d7aa710462"}],"title":"ocfs2: pin refcount trees before dropping the lookup lock","x_generator":{"engine":"bippy-1.2.0"}}}}