CVE-2025-38131 coresight: prevent deactivate active config while enabling the config

High 7.8 Published Updated

A race condition in the Linux kernel Coresight driver allows a use-after-free, potentially enabling local attackers to execute code or escalate privileges.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38131?

CVE-2025-38131 is a high-severity use after free vulnerability in Debian Debian Linux, published on 3 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

coresight: prevent deactivate active config while enabling the config

While enable active config via cscfg_csdev_enable_active_config(), active config could be deactivated via configfs' sysfs interface. This could make UAF issue in below scenario:

CPU0 CPU1 (sysfs enable) load module cscfg_load_config_sets() activate config. // sysfs (sys_active_cnt == 1) ... cscfg_csdev_enable_active_config() lock(csdev->cscfg_csdev_lock) // here load config activate by CPU1 unlock(csdev->cscfg_csdev_lock)

deactivate config // sysfs (sys_activec_cnt == 0) cscfg_unload_config_sets() unload module

// access to config_desc which freed // while unloading module. cscfg_csdev_enable_config

To address this, use cscfg_config_desc's active_cnt as a reference count which will be holded when - activate the config. - enable the activated config. and put the module reference when config_active_cnt == 0.

Weakness: CWE-416

Which versions are affected by CVE-2025-38131?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38131?

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-2025-38131 being exploited?

There is no known exploitation of CVE-2025-38131 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-64538, BELL-CVE-2025-38131, DEBIAN-CVE-2025-38131, GHSA-vrjc-hpch-xwfv, ROOT-OS-DEBIAN-12-CVE-2025-38131, ROOT-OS-UBUNTU-2204-CVE-2025-38131 and 2 more.

Is CVE-2025-38131 in your software?

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

Check your SBOMs for free