CVE-2024-57849: s390/cpum_sf: Handle CPU hotplug remove during sampling
In the Linux kernel, the following vulnerability has been resolved:
s390/cpumsf: Handle CPU hotplug remove during sampling
CPU hotplug remove handling triggers the following function call sequence:
CPUHPAPPERFS390SFONLINE --> s390pmusfofflinecpu() ... CPUHPAPPERFONLINE --> perfeventexitcpu()
The s390 CPUMF sampling CPU hotplug handler invokes:
s390pmusfofflinecpu() +--> cpusfpmusetup() +--> setuppmccpu() +--> deallocatebuffers()
This function de-allocates all sampling data buffers (SDBs) allocated for that CPU at event initialization. It also clears the PMUFRESERVED bit. The CPU is gone and can not be sampled.
With the event still being active on the removed CPU, the CPU event hotplug support in kernel performance subsystem triggers the following function calls on the removed CPU:
perfeventexitcpu() +--> perfeventexitcpucontext() +--> perfeventexitcontext() +--> perfremovefromcontext() +--> eventschedout() +--> cpumsfpmudel() +--> cpumsfpmustop() +--> hwperfeventupdate()
to stop and remove the event. During removal of the event, the sampling device driver tries to read out the remaining samples from the sample data buffers (SDBs). But they have already been freed (and may have been re-assigned). This may lead to a use after free situation in which case the samples are most likely invalid. In the best case the memory has not been reassigned and still contains valid data.
Remedy this situation and check if the CPU is still in reserved state (bit PMUFRESERVED set). In this case the SDBs have not been released an contain valid data. This is always the case when the event is removed (and no CPU hotplug off occured). If the PMUFRESERVED bit is not set, the SDB buffers are gone.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-57849?
CVE-2024-57849 is classified with a moderate severity level due to its potential impact on system stability during CPU hotplug operations.
How do I fix CVE-2024-57849?
To mitigate CVE-2024-57849, ensure that you update to the latest patched version of the Linux kernel that addresses this vulnerability.
Which versions of the Linux Kernel are affected by CVE-2024-57849?
CVE-2024-57849 affects specific versions of the Linux kernel that handle CPU hotplug operations, but the exact affected versions should be checked against vendor advisories.
What are the potential impacts of CVE-2024-57849?
The potential impacts of CVE-2024-57849 include system instability and unexpected behavior when CPUs are dynamically added or removed.
Has CVE-2024-57849 been resolved?
Yes, CVE-2024-57849 has been resolved in recent updates to the Linux kernel.