remoteproc: fix OOB read via signed offset in rsc_table_for_each_entry()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fd2c15ec1dd3c2fdfc6ff03bb9644da9d530e3b9 · < 6fd220604f06c746760183df74b07384c3fdd660| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
remoteproc: fix OOB read via signed offset in rsc_table_for_each_entry()
table->offset[i] is a u32 from firmware, but was stored into a signed int. A crafted offset like 0xFFFFFFF0 becomes -16, placing hdr 16 bytes before the table buffer. The subsequent avail check was bypassed because the negative int was promoted to a large size_t in the expression "table_sz - offset - sizeof(*hdr)", yielding a large positive avail and letting the out-of-bounds hdr->type read proceed undetected.
Store the offset as u32 and validate it with unsigned comparisons before any pointer arithmetic.
From the CVE record · Linux
The Linux kernel's remoteproc resource-table parser can read outside a table buffer when a firmware-provided offset is interpreted as a negative value. An attacker who can supply a crafted firmware resource table could trigger the read; the input does not specify a network path, authentication requirement, or user interaction.
Engineers running Linux kernels that use remoteproc should check whether their kernel includes the fix; affected versions are not specified.