CVE-2026-139135: writeback: don't kick a missing wb for dontcache writes
In the Linux kernel, the following vulnerability has been resolved:
writeback: don't kick a missing wb for dontcache writes
With CONFIGCGROUPWRITEBACK, inode->iwb stays NULL until the inode is dirtied for the first time (folioaccountdirtied(), markinodedirty() or wbcattachfdatawriteinode() attach it). genericwritesync() calls filemapdontcachekickwriteback() for every IOCBDONTCACHE write, including ODIRECT ones, which never dirty the page cache. The function then passes the NULL returned by unlockedinodetowbbegin() to wbhasdirtyio():
fd = open("/dev/ram0", OWRONLY | ODIRECT); pwritev2(fd, &iov, 1, 0, RWFDONTCACHE);
BUG: KASAN: null-ptr-deref in filemapdontcachekickwriteback+0xec Oops: general protection fault, probably for non-canonical address RIP: 0010:filemapdontcachekickwriteback+0xfd/0x7a0
The task dies inside rcureadlock(). blkdevwriteiter() gets there for any block device whose page cache has not been dirtied yet. nfsfiledirectwrite() calls genericwritesync() the same way.
An inode without a wb has never had dirty pages, so there is nothing to flush: skip the kick.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this failure?
Systems running the Linux kernel with CONFIG_CGROUP_WRITEBACK are affected when an IOCB_DONTCACHE write reaches an inode that has not previously been dirtied and therefore has no associated writeback structure. The described paths include direct writes to block devices and NFS direct writes.
What does an attacker or triggering workload need to do?
The triggering operation is an IOCB_DONTCACHE write, including an O_DIRECT write, against a block device whose page cache has not yet been dirtied. The example uses pwritev2() with RWF_DONTCACHE on /dev/ram0 opened with O_DIRECT.
What is the impact when the condition is triggered?
The kernel can dereference a NULL writeback pointer in filemap_dontcache_kick_writeback(), producing a KASAN null-pointer dereference or general protection fault. The task performing the write dies.
Is there a safe temporary mitigation if the fix cannot be deployed immediately?
Avoid IOCB_DONTCACHE/RWF_DONTCACHE writes, including the affected O_DIRECT write pattern, to block devices or NFS files whose inode has not yet been dirtied. This avoids the writeback kick that operates on the missing writeback structure.