CVE-2026-46160
BTRFS directory removal fsync corruption vulnerability
Publication date: 2026-05-28
Last updated on: 2026-05-28
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | kernel | * |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Linux kernel's btrfs filesystem implementation. When a directory is removed, the system fails to update the directory's last_unlink_trans field. This missing update can cause incorrect behavior when fsync is called on a directory after it has been removed but while a file descriptor to it is still open.
In practical terms, if a directory is deleted and then fsync is called on an open file descriptor to that directory, the filesystem's internal state may become inconsistent. This can lead to errors during filesystem mount operations, such as log replay failures and corruption messages, potentially causing the filesystem to be inaccessible or unstable.
How can this vulnerability impact me? :
The impact of this vulnerability is that it can cause filesystem corruption or mount failures after a power failure or crash if the described scenario occurs. Specifically, the filesystem may fail to mount properly, returning input/output errors (-EIO), and system logs may show critical corruption messages.
This can lead to data loss or unavailability of data stored on the affected btrfs filesystem, potentially disrupting system operations or requiring filesystem repair or recovery procedures.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by observing filesystem errors related to BTRFS during mount or log replay operations. Specifically, if the filesystem log replay fails with an -EIO error and kernel logs (dmesg or syslog) show messages indicating corrupt leaf nodes or invalid link counts for directories, it may indicate the presence of this issue.
To detect this on your system, you can check the kernel logs for BTRFS related errors using the following command:
- dmesg | grep -i btrfs
Additionally, you can attempt to mount the BTRFS filesystem and observe if it fails with errors similar to those described in the vulnerability scenario.
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to update the Linux kernel to a version where this vulnerability has been fixed. The fix involves correctly updating the last_unlink_trans field when removing a directory in BTRFS, preventing incorrect fsync behavior and filesystem corruption.
Until the kernel is updated, avoid operations that involve removing directories while holding open file descriptors on them, as this can trigger the issue.
Regularly back up important data to prevent data loss in case of filesystem corruption caused by this vulnerability.