
A C-based Linux security utility for detecting, safely verifying (Proof of Concept), and mitigating CVE-2026-64600 (RefluXFS). It provides kernel vulnerability assessment, XFS reflink detection, a safe race-condition PoC, and layered mitigation using SystemTap and XFS hardening.
This repository provides a comprehensive C utility to detect, safely verify, and mitigate the RefluXFS vulnerability (CVE‑2026‑64600) on Linux systems running the XFS filesystem. The tool checks for a vulnerable kernel, identifies reflink‑enabled XFS mounts, optionally attempts a safe race‑trigger, and deploys a two‑layer mitigation (SystemTap probe + remount with reflink=0) when needed.
⚠️ Disclaimer: This tool is intended for authorised security assessment and system hardening only. Use it only on systems you own or have explicit permission to test. The authors assume no liability for misuse.
CVE-2026-64600 (RefluXFS) is a high‑severity race condition in the Linux kernel’s XFS filesystem, specifically in the copy‑on‑write (CoW) path for reflinked files (introduced in kernel 4.11). An unprivileged local attacker can corrupt or overwrite arbitrary files on the same XFS volume by racing concurrent O_DIRECT writes on a reflink clone against a protected file. The corruption occurs at the block layer, survives reboots, and leaves no trace in kernel logs.
Affected Kernels: Linux 4.11 through fixed versions:
Impact: Local privilege escalation to root, persistent data corruption, silent overwrite of setuid binaries or sensitive files.
This tool implements:
/proc/mounts).-m fix is used):
FICLONE and copy_file_range syscalls on XFS, returning -EOPNOTSUPP.reflink=0 (defence in depth).-c) – run arbitrary commands (e.g., id) only if the system is vulnerable.-m exploit).reflink=0 (-m fix, requires root).--dry-run – preview mitigation actions without applying them.--force – force mitigation deployment even if conditions are not met (lab/demo).-v) for detailed parsing information.-c) – execute a command only if the system is vulnerable (default: id).git clone https://github.com/Debajyoti0-0/CVE-2026-64600.git
cd cve-2026-64600
gcc -o cve-2026-64600 cve-2026-64600.c -lm -lpthread
Prerequisites:
-m fix):
stap command) – optional, but recommended for full mitigation.Optional: If SystemTap is not available, the tool will fall back to remount hardening only (if supported by the XFS version).
./cve-2026-64600
./cve-2026-64600 -v
./cve-2026-64600 -p /mnt/data
./cve-2026-64600 -m exploit
./cve-2026-64600 -m auto
sudo ./cve-2026-64600 -m fix
sudo ./cve-2026-64600 -m fix --dry-run
sudo ./cve-2026-64600 -m fix --force
./cve-2026-64600 -c "whoami"
./cve-2026-64600 -v -c "id"
$ ./cve-2026-64600
┌──────────────────────────────────────────────────────────────────────┐
│ CVE-2026-64600 (RefluXFS) — Mode: check │
└──────────────────────────────────────────────────────────────────────┘
─── System Information ───
Kernel 5.15.0-91-generic
Architecture x86_64
─── Vulnerability Assessment ───
Kernel Vulnerable NO
XFS Reflink (any mount) DISABLED
Distribution Affected (heuristic) NO
────────────────────────────────────────────────────────────────────
FINAL VERDICT
────────────────────────────────────────────────────────────────────
┌──────────────────────────────────────────────────────────────────────┐
│ SAFE: kernel not vulnerable and no XFS reflink found │
└──────────────────────────────────────────────────────────────────────┘
Kernel: 5.15.0-91-generic (not vulnerable)
XFS reflink: not detected
System appears secure against CVE-2026-64600
────────────────────────────────────────────────────────────────────
$ ./cve-2026-64600
┌──────────────────────────────────────────────────────────────────────┐
│ CVE-2026-64600 (RefluXFS) — Mode: check │
└──────────────────────────────────────────────────────────────────────┘
─── System Information ───
Kernel 6.12.0-rc2
Architecture x86_64
─── Vulnerability Assessment ───
Kernel Vulnerable YES
XFS Reflink (any mount) DISABLED
Distribution Affected (heuristic) YES
A vulnerable kernel was detected. Show remediation advisory? [y/n]: n
────────────────────────────────────────────────────────────────────
FINAL VERDICT
────────────────────────────────────────────────────────────────────
┌──────────────────────────────────────────────────────────────────────┐
│ PARTIAL: vulnerable kernel, but no XFS reflink found │
└──────────────────────────────────────────────────────────────────────┘
Kernel: 6.12.0-rc2 (vulnerable)
XFS reflink: not detected
Recommendation: still consider kernel update as precaution
────────────────────────────────────────────────────────────────────
$ sudo ./cve-2026-64600 -m fix
┌──────────────────────────────────────────────────────────────────────┐
│ CVE-2026-64600 (RefluXFS) — Mode: fix │
└──────────────────────────────────────────────────────────────────────┘
─── System Information ───
Kernel 6.12.0-rc2
Architecture x86_64
─── Vulnerability Assessment ───
Kernel Vulnerable YES
XFS Reflink (any mount) ENABLED
Distribution Affected (heuristic) YES
--- Mitigation Deployment ---
Layer 2/2: mount-level hardening (remount reflink=0)
Remounted /mnt/xfs with reflink=0
Layer 1/2: syscall-level block (SystemTap probe)
Status DEPLOYED (SystemTap)
Log: /var/log/refluxfs-block.log
Stop: sudo pkill -f 'stap.*refluxfs-block'
Verify: cp --reflink=always /etc/passwd /tmp/test 2>&1 | grep -q 'Operation not supported'
Status MITIGATION ACTIVE (both layers)
--- FINAL VERDICT ---
┌──────────────────────────────────────────────────────────────────────┐
│ CONFIRMED VULNERABLE (race triggered) │
└──────────────────────────────────────────────────────────────────────┘
Kernel: 6.12.0-rc2 (vulnerable)
XFS reflink: enabled
Distribution: affected
To test this tool in a safe environment, you can set up a Linux VM with an XFS partition created with reflink=1. For example:
# Create a loop device with an XFS filesystem (reflink enabled)
dd if=/dev/zero of=/tmp/xfs.img bs=1M count=1024
mkfs.xfs -m reflink=1 /tmp/xfs.img
sudo mount -o loop /tmp/xfs.img /mnt/xfs
Then run the tool on the mounted path (-p /mnt/xfs) to test detection and mitigation.
This project is licensed under the GNU General Public License v3.0 – see the LICENSE file for details.
Issues and pull requests are welcome. Please ensure your contributions maintain the same functionality and adhere to the ethical usage guidelines.
Remember: Always obtain proper authorisation before testing any security tool. Stay ethical and responsible.
| Option | Description |
|---|
-h, --help | Show help message and exit. |
-v, --verbose | Verbose output (show parsed kernel version details). |
-p <path> | Check XFS reflink status on a specific mount point. |
-m, --mode <mode> | Operation mode: check (default), exploit, auto, fix. |
-c, --cmd <command> | Execute custom command only if the system is vulnerable (default: id). |
--dry-run | Preview mitigation actions (with -m fix) without applying. |
--force | Force mitigation deployment even if conditions are not met (lab/demo). |
| Mode | Description |
|---|
check | Passive detection – reports kernel version, XFS reflink status, and distribution heuristic. No actions taken. |
exploit | Runs the safe race verification (PoC) even if system is vulnerable. Does not apply mitigation. |
auto | If system is vulnerable, runs the safe race verification; otherwise just checks. |
fix | Applies layered mitigation (requires root). Deploys SystemTap probe and attempts to remount XFS with reflink=0. Only applies if kernel is vulnerable and XFS reflink is enabled (unless --force is used). |