{"id":"CVE-2026-139438","aliases":["CVE-2026-139438"],"related":[],"kind":"vulnerability","state":"published","title":"block: use iomap_dirty_folio for block devices","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nblock: use iomap_dirty_folio for block devices\n\nWith CONFIG_BUFFER_HEAD=n, block devices are written back through iomap,\nbut def_blk_aops uses filemap_dirty_folio, which only sets PG_dirty. It\ndoes not set the per-block dirty bits in the folio's iomap_folio_state,\nso iomap_writeback_folio() finds no dirty range, submits no I/O and\nclears PG_dirty, resulting in data loss.\n\nOther iomap users set .dirty_folio to iomap_dirty_folio, which marks the\nfolio's blocks dirty before calling filemap_dirty_folio().\n\nThis is only observable with block size < folio size. With a single\nblock there is no iomap_folio_state to get out of sync and\niomap_writeback_folio() marks the whole folio dirty itself. For a\npage-aligned device, this may require using the BLKBSZSET ioctl to set\nthe block size, which requires CAP_SYS_ADMIN. A device whose size is not\npage aligned already gets a sub-page block size from\nset_init_blocksize(), so no ioctl and no privilege is needed.\n\nTo reproduce, on a device with a sub-page block size, write a known\npattern with O_DIRECT, mmap the same range, store to it, msync() and\nfsync(), then read it back with O_DIRECT. A reproducer is available at\n[1].\n\n[1] https://gist.github.com/tzussman/18ab05cba4b3fdc79cce0a69d1fd05b4","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nblock: use iomap_dirty_folio for block devices\n\nWith CONFIG_BUFFER_HEAD=n, block devices are written back through iomap,\nbut def_blk_aops uses filemap_dirty_folio, which only sets PG_dirty. It\ndoes not set the per-block dirty bits in the folio's iomap_folio_state,\nso iomap_writeback_folio() finds no dirty range, submits no I/O and\nclears PG_dirty, resulting in data loss.\n\nOther iomap users set .dirty_folio to iomap_dirty_folio, which marks the\nfolio's blocks dirty before calling filemap_dirty_folio().\n\nThis is only observable with block size < folio size. With a single\nblock there is no iomap_folio_state to get out of sync and\niomap_writeback_folio() marks the whole folio dirty itself. For a\npage-aligned device, this may require using the BLKBSZSET ioctl to set\nthe block size, which requires CAP_SYS_ADMIN. A device whose size is not\npage aligned already gets a sub-page block size from\nset_init_blocksize(), so no ioctl and no privilege is needed.\n\nTo reproduce, on a device with a sub-page block size, write a known\npattern with O_DIRECT, mmap the same range, store to it, msync() and\nfsync(), then read it back with O_DIRECT. A reproducer is available at\n[1].\n\n[1] https://gist.github.com/tzussman/18ab05cba4b3fdc79cce0a69d1fd05b4","source":"cvelist"}],"published":"2026-11-30T13:34:45.484Z","modified":"2026-11-30T14:19:14.110Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"925c86a19bacf8ce10eb666328fb3fa5aff7b951","fixed":"6d6239c59c38a1743abd835f97ba032dc1db943f","status":"affected"},{"type":"git","introduced":"925c86a19bacf8ce10eb666328fb3fa5aff7b951","fixed":"ee52ddbd70de6538262c29466a49a1f1b875aac5","status":"affected"},{"type":"git","introduced":"925c86a19bacf8ce10eb666328fb3fa5aff7b951","fixed":"f2ee24d9e70b21d078273eac11a7b84aef7c3b78","status":"affected"},{"type":"git","introduced":"925c86a19bacf8ce10eb666328fb3fa5aff7b951","fixed":"2c163c18e8e2adf2f9ed865275ddcf50773e388a","status":"affected"},{"type":"git","introduced":"925c86a19bacf8ce10eb666328fb3fa5aff7b951","fixed":"be1e33eda3e6699e57ed3fe6e34078f115b4a1ec","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.6","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.119","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.65","lastAffected":"6.18.*","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/6d6239c59c38a1743abd835f97ba032dc1db943f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ee52ddbd70de6538262c29466a49a1f1b875aac5","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f2ee24d9e70b21d078273eac11a7b84aef7c3b78","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2c163c18e8e2adf2f9ed865275ddcf50773e388a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/be1e33eda3e6699e57ed3fe6e34078f115b4a1ec","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139438","url":"https://www.cve.org/CVERecord?id=CVE-2026-139438","licence":"CVE Terms of Use","modified":"2026-11-30T13:34:45.484Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139438","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139438","licence":"Public domain","modified":"2026-11-30T14:19:14.110Z"}],"updatedAt":"2026-11-30T14:33:22.225Z","epss":{"score":0.00201,"percentile":0.10475,"date":"2026-12-01T12:00:22.000Z"}}