CVE-2026-139610: hfs/hfsplus: serialize B-tree close against folio release
In the Linux kernel, the following vulnerability has been resolved:
hfs/hfsplus: serialize B-tree close against folio release
B-tree nodes with a zero reference count remain in the node hash until folio reclaim or tree teardown frees them. The folio release callbacks remove nodes while holding hashlock, but hfsbtreeclose() walks and frees the same hash without that lock. Reclaim can therefore unhash and free a node after close has loaded its pointer, causing a use-after-free or double-free.
The following syzkaller crashes seem to be the same UAF in {hfs,hfsplus}btreeclose() (or {hfs,hfsplus}bnodeunhash()) and follow the same pattern, but do not contain a reproducer to confirm.
Detach each node with hfsbnodeunhash() while holding hashlock before inspecting and freeing it. Drop the lock before hfsbnodefree() so a large tree is not freed while holding a spinlock. Apply the same fix to the matching HFS+ implementation.
Affected Software
Event History
Frequently Asked Questions
What conditions are needed to trigger this issue?
The race requires B-tree teardown to overlap with folio reclaim. During that overlap, reclaim can remove and free a zero-reference B-tree node after the close path has read its pointer, leading to a use-after-free or double-free.
Which filesystem code paths are affected?
The issue affects both the HFS and HFS+ B-tree close and node-unhash paths. The fix serializes node detachment from the hash with the hash lock before nodes are inspected and freed.
Are there confirmed exploit reproductions?
The report cites syzkaller crashes that appear to match the race in the HFS and HFS+ B-tree close or node-unhash paths, but states that no reproducer was available to confirm them.