CVE-2022-49165: media: imx-jpeg: Prevent decoding NV12M jpegs into single-planar buffers
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
media: imx-jpeg: Prevent decoding NV12M jpegs into single-planar buffers
If the application queues an NV12M jpeg as output buffer, but then queues a single planar capture buffer, the kernel will crash with "Unable to handle kernel NULL pointer dereference" in mxc_jpeg_addrs, prevent this by finishing the job with error.
The Linux kernel CVE team has assigned CVE-2022-49165 to this issue.
Affected and fixed versions
===========================
Fixed in 5.15.33 with commit eff76b180751e5e55c872d17755680c3b83ba9ab Fixed in 5.16.19 with commit 8d075ede7d24f19dc817c5bd517a53f0524f9031 Fixed in 5.17.2 with commit 4eb591c47c82a6a6ad293ed108c3cb77115fbc25 Fixed in 5.18 with commit 417591a766b3c040c346044541ff949c0b2bb7b2
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-49165
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/media/platform/imx-jpeg/mxc-jpeg.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/eff76b180751e5e55c872d17755680c3b83ba9ab https://git.kernel.org/stable/c/8d075ede7d24f19dc817c5bd517a53f0524f9031 https://git.kernel.org/stable/c/4eb591c47c82a6a6ad293ed108c3cb77115fbc25 https://git.kernel.org/stable/c/417591a766b3c040c346044541ff949c0b2bb7b2