iomap: fix out-of-bounds bitmap_set() with zero-length range
In the Linux kernel, the following vulnerability has been resolved: iomap: fix out-of-bounds bitmap_set() with zero-length range ifs_set_range_dirty() and ifs_set_range_uptodate() compute last_blk as (off + len - 1) >> i_blkbits. When off is 0 and len is 0, the unsigned subtraction underflows to SIZE_MAX, producing a huge last_blk and nr_blks value that causes bitmap_set() to write far beyond the ifs->state allocation. Regarding ifs_set_range_uptodate(), it is temporarily safe because len cannot be passed in as 0. However, for ifs_set_range_dirty() this is reachable from __iomap_write_end(): when copy_folio_from_iter_atomic() returns 0 (e.g. user buffer fault) and the folio is already uptodate, the guard at the top of __iomap_write_end() does not trigger because !folio_test_uptodate() is false, and iomap_set_range_dirty() is called with copied == 0. Add a !len guard to both functions before the computation, so that a zero-length range is a no-op.
CVE-2026-68145
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-68145
Linux
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Linux
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "4ce02c67972211be488408c275c8fbf19faf29b3",
"lessThan": "48829622212f6b8f49155889aecc818ba28ba680",
"versionType": "git"
},
{
"status": "affected",
"version": "4ce02c67972211be488408c275c8fbf19faf29b3",
"lessThan": "fb4fad9105c88b1d82f1b3c39e3b6abea8249af6",
"versionType": "git"
},
{
"status": "affected",
"version": "4ce02c67972211be488408c275c8fbf19faf29b3",
"lessThan": "7037e7bdcd26f46c080b8ce307dee5cb471c4b7c",
"versionType": "git"
},
{
"status": "affected",
"version": "4ce02c67972211be488408c275c8fbf19faf29b3",
"lessThan": "c5b6a48a8a716a7730e39af1cad083dc4ec955ce",
"versionType": "git"
},
{
"status": "affected",
"version": "4ce02c67972211be488408c275c8fbf19faf29b3",
"lessThan": "9c7d8f7c8994c790fca501dc45ce66e7356cbe05",
"versionType": "git"
}
],
"programFiles": [
"fs/iomap/buffered-io.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "6.6"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "6.6",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "6.6.153",
"versionType": "semver",
"lessThanOrEqual": "6.6.*"
},
{
"status": "unaffected",
"version": "6.12.101",
"versionType": "semver",
"lessThanOrEqual": "6.12.*"
},
{
"status": "unaffected",
"version": "6.18.42",
"versionType": "semver",
"lessThanOrEqual": "6.18.*"
},
{
"status": "unaffected",
"version": "7.1.6",
"versionType": "semver",
"lessThanOrEqual": "7.1.*"
},
{
"status": "unaffected",
"version": "7.2",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"fs/iomap/buffered-io.c"
],
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2026-68145
Source reference:
/cveMetadata/cveId
Publisher severity
high
Source reference: /containers/cna/metrics
- Event
- #41136 · Revision 1
- Added to Heist Feed
- Publisher date