CVE-2023-52491
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
11/03/2024
Last modified:
12/12/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run<br />
<br />
In mtk_jpeg_probe, &jpeg->job_timeout_work is bound with<br />
mtk_jpeg_job_timeout_work.<br />
<br />
In mtk_jpeg_dec_device_run, if error happens in<br />
mtk_jpeg_set_dec_dst, it will finally start the worker while<br />
mark the job as finished by invoking v4l2_m2m_job_finish.<br />
<br />
There are two methods to trigger the bug. If we remove the<br />
module, it which will call mtk_jpeg_remove to make cleanup.<br />
The possible sequence is as follows, which will cause a<br />
use-after-free bug.<br />
<br />
CPU0 CPU1<br />
mtk_jpeg_dec_... |<br />
start worker |<br />
|mtk_jpeg_job_timeout_work<br />
mtk_jpeg_remove |<br />
v4l2_m2m_release |<br />
kfree(m2m_dev); |<br />
|<br />
| v4l2_m2m_get_curr_priv<br />
| m2m_dev->curr_ctx //use<br />
<br />
If we close the file descriptor, which will call mtk_jpeg_release,<br />
it will have a similar sequence.<br />
<br />
Fix this bug by starting timeout worker only if started jpegdec worker<br />
successfully. Then v4l2_m2m_job_finish will only be called in<br />
either mtk_jpeg_job_timeout_work or mtk_jpeg_dec_device_run.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.12 (including) | 5.10.210 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.149 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.76 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.15 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.7.3 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590
- https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e
- https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9
- https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c
- https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7
- https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6
- https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590
- https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e
- https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9
- https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c
- https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7
- https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html