comedi: me4000: Fix potential overrun of firmware buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ac584af599452748187cf6d7865b1607c54ee443 · < eae19cab44204537f79146f15a51811b13227c38| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
comedi: me4000: Fix potential overrun of firmware buffer
`me4000_xilinx_download()` loads the firmware that was requested by `request_firmware()`. It is possible for it to overrun the source buffer because it blindly trusts the file format. It reads a data stream length from the first 4 bytes into variable `file_length` and reads the data stream contents of length `file_length` from offset 16 onwards.
Add a test to ensure that the supplied firmware is long enough to contain the header and the data stream. On failure, log an error and return `-EINVAL`.
Note: The firmware loading was totally broken before commit ac584af59945 ("staging: comedi: me4000: fix firmware downloading"), but that is the most sensible target for this fix.
From the CVE record · Linux
The Linux kernel’s comedi me4000 firmware loader trusts a length in the firmware file without checking that the file contains the full data stream. A supplied firmware file with an invalid length can cause a source-buffer overrun during firmware loading. The input does not specify how an attacker could supply the file or whether authentication or user interaction is required.
Engineers running Linux kernels with the comedi me4000 driver should check their deployments; affected versions are not specified.