CVE-2023-52584 spmi: mediatek: Fix UAF on device remove

Low 3.8 Published Updated

A use-after-free vulnerability in the MediaTek SPMI driver allows attackers to cause denial of service or execute code during device removal.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-52584?

CVE-2023-52584 is a low-severity use after free vulnerability in Linux kernel, published on 6 Mar 2024. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

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

spmi: mediatek: Fix UAF on device remove

The pmif driver data that contains the clocks is allocated along with spmi_controller. On device remove, spmi_controller will be freed first, and then devres , including the clocks, will be cleanup. This leads to UAF because putting the clocks will access the clocks in the pmif driver data, which is already freed along with spmi_controller.

This can be reproduced by enabling DEBUG_TEST_DRIVER_REMOVE and building the kernel with KASAN.

Fix the UAF issue by using unmanaged clk_bulk_get() and putting the clocks before freeing spmi_controller.

Weakness: CWE-416

Which versions are affected by CVE-2023-52584?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2023-52584?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2023-52584 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-52584 exists.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2023-52584, DEBIAN-CVE-2023-52584, GHSA-jmmm-pcpp-rrc4, UBUNTU-CVE-2023-52584.

Is CVE-2023-52584 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free