CVE-2023-52491
media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
Description
In the Linux kernel, the following vulnerability has been resolved: media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run In mtk_jpeg_probe, &jpeg->job_timeout_work is bound with mtk_jpeg_job_timeout_work. In mtk_jpeg_dec_device_run, if error happens in mtk_jpeg_set_dec_dst, it will finally start the worker while mark the job as finished by invoking v4l2_m2m_job_finish. There are two methods to trigger the bug. If we remove the module, it which will call mtk_jpeg_remove to make cleanup. The possible sequence is as follows, which will cause a use-after-free bug. CPU0 CPU1 mtk_jpeg_dec_... | start worker | |mtk_jpeg_job_timeout_work mtk_jpeg_remove | v4l2_m2m_release | kfree(m2m_dev); | | | v4l2_m2m_get_curr_priv | m2m_dev->curr_ctx //use If we close the file descriptor, which will call mtk_jpeg_release, it will have a similar sequence. Fix this bug by starting timeout worker only if started jpegdec worker successfully. Then v4l2_m2m_job_finish will only be called in either mtk_jpeg_job_timeout_work or mtk_jpeg_dec_device_run.
INFO
Published Date :
March 11, 2024, 6:15 p.m.
Last Modified :
Dec. 12, 2024, 5:32 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | HIGH | [email protected] |
Solution
- Update the affected Linux kernel packages.
- Reboot the system after the update.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2023-52491.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2023-52491 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2023-52491
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2023-52491 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2023-52491 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Dec. 12, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Added CWE NIST CWE-416 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.12 up to (excluding) 5.10.210 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.149 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.76 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.15 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.7.3 Changed Reference Type https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 No Types Assigned https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 Patch Changed Reference Type https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 No Types Assigned https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 Patch Changed Reference Type https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e No Types Assigned https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e Patch Changed Reference Type https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e No Types Assigned https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e Patch Changed Reference Type https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 No Types Assigned https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 Patch Changed Reference Type https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 No Types Assigned https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 Patch Changed Reference Type https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c No Types Assigned https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c Patch Changed Reference Type https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c No Types Assigned https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c Patch Changed Reference Type https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 No Types Assigned https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 Patch Changed Reference Type https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 No Types Assigned https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 Patch Changed Reference Type https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 No Types Assigned https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 Patch Changed Reference Type https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 No Types Assigned https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 Patch Changed Reference Type https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html No Types Assigned https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html Patch -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 Added Reference https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e Added Reference https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 Added Reference https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c Added Reference https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 Added Reference https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 Added Reference https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Nov. 04, 2024
Action Type Old Value New Value Removed Reference kernel.org https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jun. 25, 2024
Action Type Old Value New Value Added Reference kernel.org https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html [No types assigned] -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 28, 2024
Action Type Old Value New Value -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
May. 14, 2024
Action Type Old Value New Value -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Mar. 11, 2024
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run In mtk_jpeg_probe, &jpeg->job_timeout_work is bound with mtk_jpeg_job_timeout_work. In mtk_jpeg_dec_device_run, if error happens in mtk_jpeg_set_dec_dst, it will finally start the worker while mark the job as finished by invoking v4l2_m2m_job_finish. There are two methods to trigger the bug. If we remove the module, it which will call mtk_jpeg_remove to make cleanup. The possible sequence is as follows, which will cause a use-after-free bug. CPU0 CPU1 mtk_jpeg_dec_... | start worker | |mtk_jpeg_job_timeout_work mtk_jpeg_remove | v4l2_m2m_release | kfree(m2m_dev); | | | v4l2_m2m_get_curr_priv | m2m_dev->curr_ctx //use If we close the file descriptor, which will call mtk_jpeg_release, it will have a similar sequence. Fix this bug by starting timeout worker only if started jpegdec worker successfully. Then v4l2_m2m_job_finish will only be called in either mtk_jpeg_job_timeout_work or mtk_jpeg_dec_device_run. Added Reference Linux https://git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c [No types assigned] Added Reference Linux https://git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e [No types assigned]