CVE-2024-57849·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: s390/cpum_sf: Handle CPU hotplug remove during sampling CPU hotplug remove handling triggers the following function call sequence: CPUHP_AP_PERF_S390_SF_ONLINE --> s390_pmu_sf_offline_cpu() ... CPUHP_AP_PERF_ONLINE --> perf_event_exit_cpu() The s390 CPUMF sampling CPU hotplug handler invokes: s390_pmu_sf_offline_cpu() +--> cpusf_pmu_setup() +--> setup_pmc_cpu() +--> deallocate_buffers() This function de-allocates all sampling data buffers (SDBs) allocated for that CPU at event initialization. It also clears the PMU_F_RESERVED 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: perf_event_exit_cpu() +--> perf_event_exit_cpu_context() +--> __perf_event_exit_context() +--> __perf_remove_from_context() +--> event_sched_out() +--> cpumsf_pmu_del() +--> cpumsf_pmu_stop() +--> hw_perf_event_update() 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 PMU_F_RESERVED 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 PMU_F_RESERVED bit is not set, the SDB buffers are gone.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.12.5
- Published
- 2025-01-11
Affected versions
From: 6.7
Until: 6.12.5
Fixed in: 6.12.5
How to fix this CVE
Update your Linux kernel to version 6.12.5 or later to resolve this CPU hotplug handling vulnerability in the s390 performance sampling subsystem. The vulnerability occurs when CPUs are removed while performance monitoring events are active, leading to potential use-after-free conditions. Apply the kernel update as soon as possible, particularly if you run performance monitoring workloads on s390 systems.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your kernel version: uname -r and verify it is 6.12.5 or later
- Confirm s390 CPUMF sampling is in use: grep -i 'cpum_sf\|perf_event' /proc/modules or perf list | grep -i s390
- Monitor system logs for use-after-free indicators: grep -i 'use after free\|memory corruption\|segfault' /var/log/kern.log or journalctl -k | grep -i 'fault\|error'
- Verify the fix by checking commit references in kernel release notes: grep -r '06a92f810df8037ca36157282ddcbefdcaf049b8' /boot/config* or checking kernel source tags
FAQ
What is CVE-2024-57849?
This vulnerability affects Linux kernel s390 CPU performance sampling when CPUs are hot-removed while performance monitoring events remain active, potentially causing the kernel to access freed memory buffers and triggering system instability or data corruption.
Is CVE-2024-57849 being actively exploited?
No, CVE-2024-57849 is not listed in the CISA Known Exploited Vulnerabilities catalog and no public exploits are available. However, it poses a reliability risk for production s390 systems using performance monitoring features.
What versions of Kernel are affected by CVE-2024-57849?
Linux kernel versions 6.7 through 6.12.4 are vulnerable. The vulnerability is resolved in kernel 6.12.5 and later.
How do I check if my server is vulnerable to CVE-2024-57849?
Run 'uname -r' to check your kernel version; if it shows 6.7 to 6.12.4 on an s390 system, you are vulnerable. Also verify s390 CPUMF is enabled with 'grep CONFIG_S390_CPUMSF /boot/config-$(uname -r)'.
Does Defensia detect CVE-2024-57849?
Yes — Defensia's CVE advisory scanner compares installed kernel versions against the NVD database. If a vulnerable kernel is detected on a monitored s390 system, CVE-2024-57849 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/06a92f810df8037ca36157282ddcbefdcaf049b8
- https://git.kernel.org/stable/c/238e3af849dfdcb1faed544349f7025e533f9aab
- https://git.kernel.org/stable/c/99192c735ed4bfdff0d215ec85c8a87a677cb898
- https://git.kernel.org/stable/c/a0bd7dacbd51c632b8e2c0500b479af564afadf3
- https://git.kernel.org/stable/c/a69752f1e5de817941a2ea0609254f6f25acd274
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-57849. Free for 1 server.
Get started free