{"id":"CVE-2026-139135","aliases":["CVE-2026-139135"],"related":[],"kind":"vulnerability","state":"published","title":"writeback: don't kick a missing wb for dontcache writes","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-11-30T13:31:54.364Z","modified":"2026-11-30T14:18:30.183Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","fixed":"7563d6969fe7fb497eeafc0e71d27f5364ab7b14","status":"affected"},{"type":"git","introduced":"e1bf79628453e6afac81ffa57f4f40f28e5512ff","fixed":"aa6439028dc39230e62917ba0a7dafdc103564cf","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.2","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/7563d6969fe7fb497eeafc0e71d27f5364ab7b14","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/aa6439028dc39230e62917ba0a7dafdc103564cf","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139135","url":"https://www.cve.org/CVERecord?id=CVE-2026-139135","licence":"CVE Terms of Use","modified":"2026-11-30T13:31:54.364Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139135","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139135","licence":"Public domain","modified":"2026-11-30T14:18:30.183Z"}],"updatedAt":"2026-11-30T14:32:41.468Z","epss":{"score":0.0019,"percentile":0.09064,"date":"2026-12-01T12:00:22.000Z"}}