fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5f8d4a9008307e0bf210906948953386935d361c · < 43a1974da6bc7ce8f4d1dc1d03d56997428c29c3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fpga: microchip-spi: fix zero header_size OOB read in mpf_ops_parse_header()
mpf_ops_parse_header() reads header_size from the bitstream at MPF_HEADER_SIZE_OFFSET (24). When header_size is zero, the expression *(buf + header_size - 1) reads one byte before the buffer start.
Since initial_header_size is set to 71 in mpf_ops, the fpga-mgr core guarantees the buffer is large enough to reach MPF_HEADER_SIZE_OFFSET. The only real gap is the zero header_size case, which cannot be resolved by providing a larger buffer, so return -EINVAL.
From the CVE record · Linux
The Linux kernel’s Microchip SPI FPGA header parser reads one byte before the buffer when a bitstream declares a header size of zero. This can be triggered by someone able to supply such a bitstream; the input does not specify whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the Microchip SPI FPGA driver should check their versions; affected versions are not specified.