media: meson: vdec: fix NULL pointer deref in vdec_try_fmt_common
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3e7f51bd96077acad6acd7b45668f65b44233c4e · < 96dafbae77f50bfe2228bcfedcd8652c5e5f08e8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: meson: vdec: fix NULL pointer deref in vdec_try_fmt_common
When VIDIOC_TRY_FMT is called with an unsupported pixel format on the OUTPUT queue, vdec_try_fmt_common() falls back to V4L2_PIX_FMT_MPEG2. However, if a distro has locally patched MPEG2 support out (as it has been broken for some time) the platform format table does not contain MPEG2 so find_format() returns NULL and the subsequent dereference of fmt_out->max_width triggers a NULL pointer dereference.
Fix this by falling back to the first format in the platform's format array instead of hardcoding V4L2_PIX_FMT_MPEG2. This is always valid since every platform defines at least one format.
From the CVE record · Linux
The meson video decoder can dereference a NULL pointer when VIDIOC_TRY_FMT receives an unsupported OUTPUT pixel format on a kernel with MPEG2 support locally patched out. A caller able to make that request can trigger the dereference; the input does not specify authentication or other access requirements.
Teams running Linux kernels with MPEG2 support locally patched out should check whether their meson video decoder includes this fix; affected versions are not specified.