CVE-2026-139066: media: imx-jpeg: finish the job on device_run() error paths
In the Linux kernel, the following vulnerability has been resolved:
media: imx-jpeg: finish the job on devicerun() error paths
mxcjpegdevicerun() returns early through a shared "end" label on several error paths (no free slot, mxcjpegallocslotdata() failure, or missing buffers or queue data), and none of them calls v4l2m2mjobfinish(). Since the delayed work is queued only after the hardware is started, those paths neither finish the job directly nor queue timeout work that could finish it later. The job is left with TRANSRUNNING set, so the waitevent() in v4l2m2mcanceljob() (reached from v4l2m2mctxrelease() at close) waits indefinitely and the close hangs.
mxcjpegallocslotdata() uses dmaalloccoherent(), so the failure path is reachable under memory pressure.
Return the src/dst buffers with VB2BUFSTATEERROR and call v4l2m2mjobfinish() on those paths: paths that have buffers use a "buffinish" label; the no-buffer path uses "jobfinish" directly. This mirrors the existing jpegparseerror path.
This bug was found by static analysis.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In mxc_jpeg_device_run() error paths, return available source/destination buffers with VB2_BUF_STATE_ERROR and call v4l2_m2m_job_finish(); on the no-buffer path, call v4l2_m2m_job_finish() directly.