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.
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.
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
Low |
| User Interaction |
None |
Availability Impact |
High |
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.
CVSS 3.1