CVE-2026-139610

hfs/hfsplus: serialize B-tree close against folio release

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
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 hash_lock, but hfs_btree_close() 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}_btree_close() (or {hfs,hfsplus}_bnode_unhash()) and follow
the same pattern, but do not contain a reproducer to confirm.

Detach each node with hfs_bnode_unhash() while holding hash_lock before
inspecting and freeing it. Drop the lock before hfs_bnode_free() so a
large tree is not freed while holding a spinlock. Apply the same fix to
the matching HFS+ implementation.

Analysis

AI-generated

Technical impact

The Linux kernel has a flaw in the HFS and HFS+ file system implementation where B‑tree nodes that have a zero reference count remain cached until they are freed. The close routine walks and frees these nodes without holding the hash lock, while the folio release callbacks remove them under the lock, causing a use‑after‑free or double‑free condition. An attacker who can trigger the close of such a tree can obtain an unreferenced pointer to freed memory, enabling a kernel memory corruption that can be leveraged to execute arbitrary code with kernel privileges.

Affected Systems

All Linux kernel releases that include the HFS/HFS+ file system code are affected, regardless of specific patch levels. The vulnerability exists until the fixes applied in the referenced kernel commits are incorporated by the distribution maintainers.

Risk and Exploitability

Although EPSS data is not available and the vulnerability is not listed in the CISA KEV catalog, the nature of a kernel use‑after‑free gives the bug a high severity. The flaw can be exploited locally by any user who can manipulate files on an HFS/HFS+ mounted partition or remotely if the system exposes the file system to untrusted input. The lack of a lock around the node cleanup routine creates a race condition that can be triggered by concurrent read/write activity, making the bug potentially easier to exploit in multi‑threaded environments.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest kernel update that incorporates the HFS/HFS+ patch commits
  • If an immediate kernel update is not possible, disable or unload the HFS and HFS+ kernel modules to prevent the vulnerable code from being used
  • Review and restrict access to any underlying storage devices that may mount HFS/HFS+ partitions, ensuring only trusted users and processes can interact with them

Generated by OpenCVE AI on December 1, 2026 at 00:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-362
CWE-416
Type Values Removed Values Added
Description 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 hash_lock, but hfs_btree_close() 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}_btree_close() (or {hfs,hfsplus}_bnode_unhash()) and follow the same pattern, but do not contain a reproducer to confirm. Detach each node with hfs_bnode_unhash() while holding hash_lock before inspecting and freeing it. Drop the lock before hfs_bnode_free() so a large tree is not freed while holding a spinlock. Apply the same fix to the matching HFS+ implementation.
Title hfs/hfsplus: serialize B-tree close against folio release
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-416

    Use After Free

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM