mtd: intel-dg: Fix accessing regions before setting nregions
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.146.19.47.0In the Linux kernel, the following vulnerability has been resolved:
mtd: intel-dg: Fix accessing regions before setting nregions
The regions array is counted by nregions, but it's set only after accessing it:
[] UBSAN: array-index-out-of-bounds in drivers/mtd/devices/mtd_intel_dg.c:750:15 [] index 0 is out of range for type '<unknown> [*]'
Fix it by also fixing an undesired behavior: the loop silently ignores ENOMEM and continues setting the other entries.
From the CVE record · Linux
The Linux kernel’s Intel DG MTD driver accesses its regions array before setting the count used to bound it. This can cause an out-of-bounds access during region setup; the input does not establish an attacker path or specify network access, authentication, or user-interaction requirements.
Engineers running Linux kernels with the Intel DG MTD driver should check their versions against the vendor advisory; affected versions are not specified.