{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2023-54285",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-12-30T12:06:44.526Z",
        "datePublished": "2025-12-30T12:23:25.770Z",
        "dateUpdated": "2026-08-05T09:18:57.424Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T09:18:57.424Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\niomap: Fix possible overflow condition in iomap_write_delalloc_scan\n\nfolio_next_index() returns an unsigned long value which left shifted\nby PAGE_SHIFT could possibly cause an overflow on 32-bit system. Instead\nuse folio_pos(folio) + folio_size(folio), which does this correctly."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
                        "baseScore": 7.1,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The flaw is reached through a local `write()`/`pwrite()` syscall on a buffered file on an iomap/XFS filesystem, via `iomap_file_buffered_write()` → `xfs_buffered_write_iomap_end()` → `iomap_write_delalloc_release()`. No network-facing service reliably produces the required short-write-with-partial-copy condition, so local access is needed.\nAC:L - The attacker deterministically controls every trigger condition: creating a file larger than 4 GiB, dirtying folios above that offset, and forcing a short write by passing a buffer that straddles an unmapped/PROT_NONE page so `fault_in_iov_iter_readable()` fails. On the affected deployment class (32-bit ARM/x86 embedded, industrial and NAS devices running XFS) the 32-bit truncation is a fixed property of the target, not a race or a condition outside attacker control.\nPR:L - Only an unprivileged local account with write access to any file on an XFS filesystem (e.g. /tmp, /var, or a home directory) is required. No capability, root, or namespace trickery is needed anywhere along the `vfs_write` → iomap path.\nUI:N - The attacker performs the entire sequence — extending the file past 4 GiB, dirtying page cache, issuing the faulting write — in its own process. No victim action or cooperation is required.\nS:U - The overflow and its effects are confined to the kernel's own filesystem/page-cache state on the same system; no VM, IOMMU, or sandbox security boundary is crossed.\nC:N - The miscalculation only causes delalloc (unwritten reservation) extents to be removed; `xfs_bmap_punch_delalloc_range()` explicitly skips real allocated extents via the `isnullstartblock()` check, so no out-of-bounds read occurs and punched ranges read back as zeroes rather than exposing stale disk or kernel memory.\nI:H - The wrapped `punch_start_byte` causes delalloc reservations to be punched over a range up to ~4 GiB below the intended one, leaving dirty page-cache data with no backing reservation; `xfs_map_blocks()` then finds a hole at writeback and the data is silently discarded, permanently destroying file contents — including data written concurrently by other users to a shared file — and leaving the on-disk extent state inconsistent with the page cache.\nA:H - The corrupted punch range trips `WARN_ON_ONCE(start_byte < punch_start_byte)` (a panic under `panic_on_warn`) and drives writeback into holes, producing XFS writeback errors and filesystem shutdown that renders the volume unusable; on affected kernels the same 32-bit truncation in the adjacent loop-advance expression additionally yields an unkillable infinite loop while holding `i_rwsem` and the mapping invalidate lock, permanently wedging the inode and burning a CPU."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/iomap/buffered-io.c"
                    ],
                    "versions": [
                        {
                            "version": "38be53c3fd7f4f4bd5de319a323d72f9f6beb16d",
                            "lessThan": "0c6cf409093f307ee05114f834516730c0da5b21",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f43dc4dc3eff028b5ddddd99f3a66c5a6bdd4e78",
                            "lessThan": "5c281b0c5d18c8eeb1cfd5023f4adb153e6d1240",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f43dc4dc3eff028b5ddddd99f3a66c5a6bdd4e78",
                            "lessThan": "eee2d2e6ea5550118170dbd5bb1316ceb38455fb",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "6.1.92",
                            "lessThan": "6.1.162",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/iomap/buffered-io.c"
                    ],
                    "versions": [
                        {
                            "version": "6.2",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.2",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.162",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.5.5",
                            "lessThanOrEqual": "6.5.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1.92",
                                    "versionEndExcluding": "6.1.162"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "6.5.5"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.2",
                                    "versionEndExcluding": "6.6"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/0c6cf409093f307ee05114f834516730c0da5b21"
                },
                {
                    "url": "https://git.kernel.org/stable/c/5c281b0c5d18c8eeb1cfd5023f4adb153e6d1240"
                },
                {
                    "url": "https://git.kernel.org/stable/c/eee2d2e6ea5550118170dbd5bb1316ceb38455fb"
                }
            ],
            "title": "iomap: Fix possible overflow condition in iomap_write_delalloc_scan",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}