fpga: dfl: add bounds check in dfh_get_param_size()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fpga: dfl: add bounds check in dfh_get_param_size()
dfh_get_param_size() can return a parameter size larger than the feature region because the loop bounds check is evaluated before incrementing size. If the EOP (End of Parameters) bit is set in the same iteration, the inflated size is returned without re-validation against max.
This can cause create_feature_instance() to call memcpy_fromio() with a size exceeding the ioremap'd region when a malicious FPGA device provides crafted DFHv1 parameter headers.
Add a bounds check after the size increment to ensure the accumulated size never exceeds the feature boundary.
From the CVE record · Linux
The Linux kernel’s FPGA DFL parameter-size check can return a size larger than the feature region. A malicious FPGA device with crafted DFHv1 parameter headers can cause the kernel to read beyond the mapped I/O region. The input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels that use FPGA DFL should check whether their kernel includes the bounds-check fix; affected versions are not specified.