CVE-2023-52491
kernel: media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · February 29, 2024
Updated · September 27, 2026
Description
This vulnerability in the Linux kernel affects the MediaTek JPEG (mtk-jpeg) media driver. The issue stems from improper error path handling within the decoder function. If a specific error occurs while setting up a decoding job, the driver mistakenly starts a timeout worker process even as it marks the job as finished. This creates a dangerous race condition: if the module is subsequently removed or the file descriptor is closed, the system cleans up and frees the associated memory. However, the improperly started timeout worker may still attempt to access that memory, triggering a use-after-free bug that can crash the kernel. Patched versions resolve this by ensuring the timeout worker is only launched if the main decoding worker successfully initializes, preventing the invalid memory access.
Statement
This vulnerability is rated as Low severity because exploitation requires local access, specific hardware prerequisites, and primarily results in a local denial of service. The affected MediaTek JPEG driver is specific to ARM-based MediaTek SoCs and is not enabled in standard Red Hat Enterprise Linux kernels. Consequently, default enterprise deployments are unaffected unless running on specialized hardware with custom kernel configurations enabling this driver.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 4.1CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
CWE-416 · Use After Free