CVE-2025-38131
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
03/07/2025
Last modified:
03/07/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
coresight: prevent deactivate active config while enabling the config<br />
<br />
While enable active config via cscfg_csdev_enable_active_config(),<br />
active config could be deactivated via configfs&#39; sysfs interface.<br />
This could make UAF issue in below scenario:<br />
<br />
CPU0 CPU1<br />
(sysfs enable) load module<br />
cscfg_load_config_sets()<br />
activate config. // sysfs<br />
(sys_active_cnt == 1)<br />
...<br />
cscfg_csdev_enable_active_config()<br />
lock(csdev->cscfg_csdev_lock)<br />
// here load config activate by CPU1<br />
unlock(csdev->cscfg_csdev_lock)<br />
<br />
deactivate config // sysfs<br />
(sys_activec_cnt == 0)<br />
cscfg_unload_config_sets()<br />
unload module<br />
<br />
// access to config_desc which freed<br />
// while unloading module.<br />
cscfg_csdev_enable_config<br />
<br />
To address this, use cscfg_config_desc&#39;s active_cnt as a reference count<br />
which will be holded when<br />
- activate the config.<br />
- enable the activated config.<br />
and put the module reference when config_active_cnt == 0.
Impact
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/31028812724cef7bd57a51525ce58a32a6d73b22
- https://git.kernel.org/stable/c/408c97c4a5e0b634dcd15bf8b8808b382e888164
- https://git.kernel.org/stable/c/b3b4efa2e623aecaebd7c9b9e4171f5c659e9724
- https://git.kernel.org/stable/c/dfe8224c9c7a43d356eb9f74b06868aa05f90223
- https://git.kernel.org/stable/c/ed42ee1ed05ff2f4c36938379057413a40c56680