media: venus: hfi: add check to handle incorrect queue size
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d96d3f30c0f2f564f6922bf4ccdf4464992e31fb · < 679424f8b31446f90080befd0300ea915485b096| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: venus: hfi: add check to handle incorrect queue size
qsize represents size of shared queued between driver and video firmware. Firmware can modify this value to an invalid large value. In such situation, empty_space will be bigger than the space actually available. Since new_wr_idx is not checked, so the following code will result in an OOB write. ... qsize = qhdr->q_size
if (wr_idx >= rd_idx) empty_space = qsize - (wr_idx - rd_idx) .... if (new_wr_idx < qsize) { memcpy(wr_ptr, packet, dwords << 2) --> OOB write
Add check to ensure qsize is within the allocated size while reading and writing packets into the queue.
From the CVE record · Linux
The Linux kernel’s Venus HFI driver does not adequately check the size of a queue shared with video firmware. If the firmware changes that size to an invalid large value, writing a packet can cause an out-of-bounds write. The input does not specify whether an attacker can trigger this over a network, whether authentication is needed, or whether user interaction is required.
Engineers running Linux kernels with the Venus HFI driver should check their kernel vendor’s advisory for affected versions.