CVE-2026-139260: ntfs: drain in-flight DIO before buffered write fallback
In the Linux kernel, the following vulnerability has been resolved:
ntfs: drain in-flight DIO before buffered write fallback
An asynchronous direct write can remain in flight after the inode lock is released. If another direct write falls back to buffered I/O while the first write is still pending, iomapfilebufferedwrite() can dirty pages before the first write completes its post-I/O page cache invalidation. The invalidation then finds dirty pages, reports a page cache invalidation failure, and records -EIO in the mapping error sequence. A later fsync() therefore returns -EIO.
Commit 15cdefd0c0522f9d5e12d947fa04f4c11649b699 ("ext4: drain in-flight DIO before buffered write fallback") fixed the same race in ext4. NTFS has an equivalent fallback after iomapdiorw() returns -ENOTBLK or a short write, but does not drain other in-flight DIO before dirtying the page cache.
Wait for in-flight DIO before calling iomapfilebufferedwrite() in the fallback path. Since NTFS supports IOCBNOWAIT, do not enter the blocking fallback for such requests. Return -EAGAIN if no bytes were written, or preserve the positive short-write result if the direct write made partial progress.
A reproducer using concurrent AIO direct writes and buffered fallback triggered the following warning and made a subsequent fsync() return -EIO:
Page cache invalidation failure on direct I/O. Possible data corruption due to collision with buffered I/O!
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1 - Compensating control
In the NTFS buffered-write fallback, wait for in-flight direct I/O to finish before calling iomap_file_buffered_write(); for IOCB_NOWAIT requests, do not block—return -EAGAIN if no bytes were written and preserve a positive short-write result if the direct write made partial progress.
Event History
Frequently Asked Questions
Which workloads can trigger this issue?
The race requires an asynchronous direct write to remain in flight while another direct write falls back to buffered I/O after iomap_dio_rw() returns -ENOTBLK or performs a short write. It affects the NTFS fallback path when buffered writes dirty page-cache pages before the earlier direct I/O completes.
What is the observable impact?
The completed direct I/O may fail to invalidate dirty page-cache pages, causing a page-cache invalidation failure and recording -EIO in the mapping error sequence. A later fsync() can then return -EIO.
How are nonblocking direct-I/O requests handled by the fix?
For IOCB_NOWAIT requests, the corrected behavior does not enter the blocking buffered-I/O fallback. It returns -EAGAIN when no bytes were written, or preserves a positive short-write result when the direct write made partial progress.