comedi: me_daq: Fix potential overrun of firmware buffer
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 85acac61096f946a78cf0c4b65f7cebe580693b6 · < a47ae40339c1048f519df33ff8840731720f57cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
comedi: me_daq: Fix potential overrun of firmware buffer
`me2600_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. Although it checks that the supplied firmware is at least 16 bytes long, it does not check that it is long enough to contain the data stream.
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`.
From the CVE record · Linux
The Linux kernel's comedi me_daq driver can read past a firmware buffer when the length declared in the firmware header exceeds the data available. This requires the driver to load a malformed firmware file; the input does not specify how an attacker could supply one or whether authentication or user interaction is needed.
Engineers running the Linux kernel with the comedi me_daq driver should check their deployments; affected versions are not specified.