KernelScan.io

HIGH Introduced in 5.2

mtd AFSV2 OOB

CVE-2026-89954

CVSS 8.0 / 10.0 NVD

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

KernelScan AI6.1MEDIUM

01

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.

02

Engine v0.6.0

Risk summary

An attacker who can place a crafted image on a device's MTD flash can trigger out-of-bounds reads in the kernel's AFS v2 partition parser, potentially leaking kernel stack data or crashing the system. The vulnerability is exploitable at boot when the parser probes the flash, requiring physical access to the flash chip or a reflashing interface. Embedded and bare-metal appliances with NOR/NAND flash are primarily at risk.

Affecteddrivers/mtd/parsers/afs.c (mtd afs partition parser)

Vulnerability analysis

The AFS v2 flash partition parser trusts two values read directly from flash contents — an image information offset stored in the footer and a region count stored in the image information block — without checking them against the erase block size or the size of a fixed local array. A crafted flash image can set the offset large enough to underflow the erase block calculation, or set the region count to exceed the array bounds, causing the kernel to read beyond a stack-local buffer. This can leak kernel stack data or crash the kernel with a page fault. The fix adds validation that rejects entries whose offset would underflow the erase block or whose region count cannot fit in the local array before either value is used. The parser runs automatically when an MTD device is probed at boot, so an attacker only needs to place a crafted image on the flash chip — typically requiring physical access to the device or a compromised firmware update path.

03

BranchIntroducedFixed inPatch commit
5.105.25.10.2701bec05a68414
5.155.25.15.2213ad8ff12fd44
6.15.26.1.188875daa3c7508
6.125.26.12.1101edea8900ca3
6.185.26.18.5118916f475057
6.65.26.6.157da740539e8f3
7.25.27.2.5d14e6298139f
mainline5.27.3e9290031f736
cip/5.105.25.10.271-cip781bec05a68414
cip/6.15.26.1.189-cip61875daa3c7508
cip/6.1-rt5.26.1.189-cip61-rt32875daa3c7508
cip/6.125.26.12.111-cip321edea8900ca3

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.268-cip77-rt34)