CVE-2023-52491 json
media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
published 2024-02-29 2 y ago modified 2026-08-05 3 mo ago also EUVD-2023-57116
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 20%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 5.10.210, 5.15.149, 6.1.76, 6.6.15, 6.7.3, 6.8
- linux Debian 12 6.1.76-1
- linux Debian 14, Debian 13 6.6.15-1
debian advisories DEBIAN-CVE-2023-52491
- linux Ubuntu 22.04 LTS 5.15.0-106.116
- linux-aws Ubuntu 22.04 LTS 5.15.0-1061.67
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1059.67
- linux-gke Ubuntu 22.04 LTS 5.15.0-1058.63
- linux-ibm Ubuntu 22.04 LTS 5.15.0-1054.57
- linux-kvm Ubuntu 22.04 LTS 5.15.0-1058.63
- linux-azure Ubuntu 22.04 LTS 5.15.0-1063.72
- linux-gkeop Ubuntu 22.04 LTS 5.15.0-1044.51
ubuntu advisories UBUNTU-CVE-2023-52491
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git.kernel.org/stable/c/43872f44eee6c6781fea1348b38885d8e78face9 commit
- git.kernel.org/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590 commit
- git.kernel.org/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6 commit
- git.kernel.org/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7 commit
- git.kernel.org/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c commit
- git.kernel.org/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e commit
- lists.debian.org/debian-lts-announce/2024/06/msg00017.html patch
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2023-52491 updated cvss 4.1
kernel: media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +82 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.28% chance of exploitation in the next 30 days, higher than 20% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
-
git.kernel.org
/stable/c/43872f44eee6c6781fea1348b38885d8e78face9
patch
-
git.kernel.org
/stable/c/1b1036c60a37a30caf6759a90fe5ecd06ec35590
patch
-
git.kernel.org
/stable/c/9fec4db7fff54d9b0306a332bab31eac47eeb5f6
patch
-
git.kernel.org
/stable/c/8254d54d00eb6cdb8367399c7f912eb8d354ecd7
patch
-
git.kernel.org
/stable/c/6e2f37022f0fc0893da4d85a0500c9d547fffd4c
patch
-
git.kernel.org
/stable/c/206c857dd17d4d026de85866f1b5f0969f2a109e
patch
-
lists.debian.org
/debian-lts-announce/2024/06/msg00017.html
patch
Sources
- CVE List CVE-2023-52491
- NVD CVE-2023-52491
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.