{"id":"CVE-2026-139135","state":"PUBLISHED","title":"writeback: don't kick a missing wb for dontcache writes","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nwriteback: don't kick a missing wb for dontcache writes\n\nWith CONFIG_CGROUP_WRITEBACK, inode->i_wb stays NULL until the inode is\ndirtied for the first time (folio_account_dirtied(), __mark_inode_dirty()\nor wbc_attach_fdatawrite_inode() attach it).  generic_write_sync() calls\nfilemap_dontcache_kick_writeback() for every IOCB_DONTCACHE write,\nincluding O_DIRECT ones, which never dirty the page cache.  The function\nthen passes the NULL returned by unlocked_inode_to_wb_begin() to\nwb_has_dirty_io():\n\n  fd = open(\"/dev/ram0\", O_WRONLY | O_DIRECT);\n  pwritev2(fd, &iov, 1, 0, RWF_DONTCACHE);\n\n  BUG: KASAN: null-ptr-deref in filemap_dontcache_kick_writeback+0xec\n  Oops: general protection fault, probably for non-canonical address\n  RIP: 0010:filemap_dontcache_kick_writeback+0xfd/0x7a0\n\nThe task dies inside rcu_read_lock().  blkdev_write_iter() gets there for\nany block device whose page cache has not been dirtied yet.\nnfs_file_direct_write() calls generic_write_sync() the same way.\n\nAn inode without a wb has never had dirty pages, so there is nothing to\nflush: skip the kick.","publishedAt":"2026-11-30T13:31:54.364Z","updatedAt":"2026-11-30T13:31:54.364Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","status":"affected","lessThan":"7563d6969fe7fb497eeafc0e71d27f5364ab7b14","versionType":"git"},{"version":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","status":"affected","lessThan":"aa6439028dc39230e62917ba0a7dafdc103564cf","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"]}],"references":["https://git.kernel.org/stable/c/7563d6969fe7fb497eeafc0e71d27f5364ab7b14","https://git.kernel.org/stable/c/aa6439028dc39230e62917ba0a7dafdc103564cf"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139135.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139135","state":"PUBLISHED","datePublished":"2026-11-30T13:31:54.364Z","dateUpdated":"2026-11-30T13:31:54.364Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.916Z"},"containers":{"cna":{"title":"writeback: don't kick a missing wb for dontcache writes","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nwriteback: don't kick a missing wb for dontcache writes\n\nWith CONFIG_CGROUP_WRITEBACK, inode->i_wb stays NULL until the inode is\ndirtied for the first time (folio_account_dirtied(), __mark_inode_dirty()\nor wbc_attach_fdatawrite_inode() attach it).  generic_write_sync() calls\nfilemap_dontcache_kick_writeback() for every IOCB_DONTCACHE write,\nincluding O_DIRECT ones, which never dirty the page cache.  The function\nthen passes the NULL returned by unlocked_inode_to_wb_begin() to\nwb_has_dirty_io():\n\n  fd = open(\"/dev/ram0\", O_WRONLY | O_DIRECT);\n  pwritev2(fd, &iov, 1, 0, RWF_DONTCACHE);\n\n  BUG: KASAN: null-ptr-deref in filemap_dontcache_kick_writeback+0xec\n  Oops: general protection fault, probably for non-canonical address\n  RIP: 0010:filemap_dontcache_kick_writeback+0xfd/0x7a0\n\nThe task dies inside rcu_read_lock().  blkdev_write_iter() gets there for\nany block device whose page cache has not been dirtied yet.\nnfs_file_direct_write() calls generic_write_sync() the same way.\n\nAn inode without a wb has never had dirty pages, so there is nothing to\nflush: skip the kick."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","status":"affected","lessThan":"7563d6969fe7fb497eeafc0e71d27f5364ab7b14","versionType":"git"},{"version":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","status":"affected","lessThan":"aa6439028dc39230e62917ba0a7dafdc103564cf","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.2","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7563d6969fe7fb497eeafc0e71d27f5364ab7b14"},{"url":"https://git.kernel.org/stable/c/aa6439028dc39230e62917ba0a7dafdc103564cf"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:31:54.364Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.2","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}