CVE-2023-52491: media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run

Published Feb 29, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

media: mtk-jpeg: Fix use after free bug due to error path handling in mtkjpegdecdevicerun

In mtkjpegprobe, &jpeg->jobtimeoutwork is bound with mtkjpegjobtimeoutwork.

In mtkjpegdecdevicerun, if error happens in mtkjpegsetdecdst, it will finally start the worker while mark the job as finished by invoking v4l2m2mjobfinish.

There are two methods to trigger the bug. If we remove the module, it which will call mtkjpegremove to make cleanup. The possible sequence is as follows, which will cause a use-after-free bug.

CPU0 CPU1 mtkjpegdec... | start worker | |mtkjpegjobtimeoutwork mtkjpegremove | v4l2m2mrelease | kfree(m2mdev); | | | v4l2m2mgetcurrpriv | m2mdev->currctx //use

If we close the file descriptor, which will call mtkjpegrelease, it will have a similar sequence.

Fix this bug by starting timeout worker only if started jpegdec worker successfully. Then v4l2m2mjobfinish will only be called in either mtkjpegjobtimeoutwork or mtkjpegdecdevicerun.

Affected Software

6 affected componentsFixes available
Linux Linux kernel>=4.12<5.10.210
Linux Linux kernel>=5.11<5.15.149
Linux Linux kernel>=5.16<6.1.76
Linux Linux kernel>=6.2<6.6.15
Linux Linux kernel>=6.7<6.7.3
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1

Event History

Feb 29, 2024
CVE Published
via MITRE·03:52 PM
Data Sourced
via MITRE·03:52 PM
DescriptionSeverity
Mar 11, 2024
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
May 7, 2024
Data Sourced
via Launchpad·08:28 PM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·05:33 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2023-52491?

CVE-2023-52491 has a severity rating that depends on its exploitation context and the specific Linux kernel version in use.

2

How do I fix CVE-2023-52491?

You can fix CVE-2023-52491 by updating to the recommended versions, such as 5.10.223-1, 6.1.123-1, or 6.12.11-1 and higher.

3

Which versions of the Linux kernel are affected by CVE-2023-52491?

CVE-2023-52491 affects various versions of the Linux kernel, specifically those ranging from 4.12 to 6.7.

4

What is the nature of the vulnerability in CVE-2023-52491?

CVE-2023-52491 is a use-after-free vulnerability resulting from improper error path handling in the mtk_jpeg_dec_device_run function.

5

Who is responsible for addressing CVE-2023-52491?

The maintainers of the Linux kernel are responsible for addressing CVE-2023-52491 by releasing patches and updates.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203