CVE-2026-143012: dm-raid: bound array_position before indexing failed_devices
In the Linux kernel, the following vulnerability has been resolved:
dm-raid: bound arrayposition before indexing faileddevices
superinitvalidation() reads role = le32tocpu(sb2->arrayposition) out of an on-disk dmraidsuperblock and then uses it as a bit index into the faileddevices bitmap via testbit(role, (void )faileddevices). faileddevices is a uint64t[DISKSARRAYELEMS] (DISKSARRAYELEMS == 4, i.e. 256 bits) living on the stack. The only guard is role < 0, so any on-disk arrayposition >= 256 makes testbit() read past the end of the stack array (arrayposition == 256 reads faileddevices[4], 8 bytes past the object). For a raid1 set the role != raiddisk reorder branch falls through to the same testbit().
A crafted dm-raid superblock therefore causes a stack out-of-bounds read during table load. Reachable by anyone able to issue a dmsetup create with attacker-controlled metadata (CAPSYSADMIN in the target namespace); the crash fires in the constructor / analysesuperblocks path, before any mdrun or array sizing.
BUG: KASAN: stack-out-of-bounds in supervalidate+0x1cd0/0x3390 Read of size 8 at addr ffff888007b17828 by task poc/152 Call Trace: dumpstacklvl+0x64/0x80 printreport+0xd0/0x630 kasanreport+0xe5/0x120 kasancheckrange+0x105/0x1b0 supervalidate+0x1cd0/0x3390 (superinitvalidation, inlined) raidctr+0x2c4b/0xa0f0 dmtableaddtarget+0x66f/0xf80 tableload+0x2ee/0x780 ctlioctl+0x362/0x9f0 dmctlioctl+0x9/0x10 x64sysioctl+0x134/0x1c0 dosyscall64+0xe2/0x4b0 entrySYSCALL64afterhwframe+0x77/0x7f
role is a device position that must refer to an actual member of the array, so reject anything outside [0, rs->raiddisks) instead of only the negative case. rs->raiddisks is always <= the 256-bit capacity of faileddevices, so this both closes the out-of-bounds access and matches the intended semantics.
This bug was discovered by Artiphishell's vTriage pipeline, which generated a crafted raid1 superblock (magic "DmRd", compatfeatures=1, numdevices=2, arrayposition=256, level=1) and a dmsetup-create reproducer that reliably triggers the KASAN report on an unpatched kernel (the precursor DMINFO "raid device #256 now at position #0" is visible in the serial log just before the splat). The fix below was drafted with the Claude coding assistant; a userspace reproducer is available on request.
Affected Software
Event History
Frequently Asked Questions
Who can trigger this issue?
An attacker must be able to run dmsetup create with attacker-controlled dm-raid metadata. The described requirement is CAP_SYS_ADMIN in the target namespace.
Does exploitation require bringing the RAID array online?
No. The out-of-bounds read occurs while the device-mapper table is loaded, in the constructor/analyse_superblocks path, before md_run or array sizing.
Are RAID1 configurations excluded by the role-reordering logic?
No. For RAID1, the role != raid_disk reorder path can fall through to the same failed_devices bitmap access.
What indicates an attempted trigger or affected execution path?
A crafted superblock with array_position of 256 or greater can cause a stack out-of-bounds read when the table is created. The provided report shows KASAN reporting a read of size 8 in super_validate.