CVE-2026-89954 PUBLISHED

mtd: afs: validate v2 image info bounds

Assigner: Linux
Reserved: 11.09.2026 Published: 16.09.2026 Updated: 16.09.2026

In the Linux kernel, the following vulnerability has been resolved:

mtd: afs: validate v2 image info bounds

The AFS v2 parser uses footer[8] to locate the image information block inside the current erase block, then uses the image information region_count to walk entries from a fixed local array. The footer offset and region count come from flash contents and are not checked against the erase block or the local image-info array before use.

Reject v2 entries whose image information offset would underflow the erase block calculation, and reject region counts that cannot fit in the local image-info array before walking region entries.

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H
CVSS Score: 8

AV:L - The AFS v2 parser runs from parse_mtd_partitions() during local MTD/physmap probe, reading on-flash ARM Firmware Suite footers via mtd_read(); no network protocol, Bluetooth/Wi-Fi path, or USB gadget/host handler invokes this code. AC:L - An attacker who controls the flash image can plant valid AFS v2 magic and CRC and set footer[8] and region_count arbitrarily, so the unsigned info-block offset and the region walk run deterministically with no race or layout condition outside attacker control. PR:N - parse_afs_partitions() runs automatically at boot/probe on affected ARM/physmap systems with no credential or capability check; crafted AFS metadata can be delivered in firmware/OTA/supply-chain flash contents without a local OS account. UI:N - Partition parsing runs as part of MTD driver initialization at boot or bind; no separate victim action such as mounting a filesystem or opening a device node is required. S:U - The stack over-read and any resulting oops remain inside the host kernel; this is not a VM escape, IOMMU bypass, or sandbox breakout. C:H - Attacker-controlled region_count drives an unbounded read past the on-stack imginfo[36] array, and kstrdup() of a possibly non-NUL-terminated footer name can copy that kernel stack/adjacent memory into a partition name far beyond a small bounded leak. I:L - OOB-derived region offset/size and repeated kstrdup() results are stored in the registered mtd_partition object, modifying kernel flash-layout metadata, but the loop does not perform an out-of-bounds write or yield a control-flow hijack primitive. A:H - Walking region_count past imginfo[] reaches unmapped stack or vmalloc pages and oopses or panics the kernel; a huge count can also livelock probe and exhaust memory via kstrdup in the loop.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to 1bec05a68414cf8d0cab6cb42445b8603f32ffc4 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to 3ad8ff12fd44b08af9212ac4883a7e29d2ab7348 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to 875daa3c750814ff2e2dc050239c390048f0bcd0 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to da740539e8f370767317e24615349b9342a6e773 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to 1edea8900ca3e405c1421d8b5c29f97107874f72 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to 18916f475057cbd2fb8ea6ae86e6b85884ad1d53 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to d14e6298139f58a87a87d7022e26a7f37f0ddce7 (excl.)
  • affected from b7cf5e2830bbb128699d7635ce8404b7f605bc95 to e9290031f736e99ad17c25c00311c92c266843b7 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.2 is affected
  • unaffected from 0 to 5.2 (excl.)
  • unaffected from 5.10.270 to 5.10.* (incl.)
  • unaffected from 5.15.221 to 5.15.* (incl.)
  • unaffected from 6.1.188 to 6.1.* (incl.)
  • unaffected from 6.6.157 to 6.6.* (incl.)
  • unaffected from 6.12.110 to 6.12.* (incl.)
  • unaffected from 6.18.51 to 6.18.* (incl.)
  • unaffected from 7.2.5 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References