media: chips-media: wave5: Move src_buf Removal to finish_encode
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: chips-media: wave5: Move src_buf Removal to finish_encode
During encoder processing, there is a case where the IRQ response could return the buffer back to userspace via v4l2_m2m_buf_done call. In this time, userspace could queue up this same buffer before start_encode removes the index from the ready queue. This would then lead to a case where the buffer in the ready queue could be a self loop due to the WRITE_ONCE(prev->next, new) call in __list_add.
When __list_del is finally called, the loop is already made so nothing points back to ready queue list head and pointers are poisoned.
A buffer should not be marked as DONE before the buffer is removed from m2m ready queue. Move removal entirely to finish_encode.
From the CVE record · Linux
The Linux kernel wave5 encoder can return a buffer to userspace before removing it from the ready queue. If local userspace queues that buffer again during this timing window, the ready queue can form a self-loop and its pointers can be poisoned. The description does not specify whether authentication is required.
Engineers running Linux kernels that include the chips-media wave5 encoder should check their kernel versions; affected versions were not provided.