CVE-2025-40042
kernel: tracing: Fix race condition in kprobe initialization causing NULL pointer dereference
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 28, 2025
Updated · June 30, 2026
Description
A race condition flaw was found in the Linux kernel's tracing subsystem during kprobe initialization. The race occurs between kprobe activation and perf_events initialization on different CPUs. When CPU0 enables kprobe functionality via class->reg() but before perf_events is fully assigned, CPU1 can trigger the kprobe and attempt to access the perf_events pointer while it is still NULL. This results in a NULL pointer dereference in kprobe_perf_func(), causing a kernel crash. A local user with the ability to use tracing/kprobe functionality could exploit this to cause a denial of service.
Statement
This vulnerability requires local access and the ability to use kernel tracing features (kprobes/perf). The race window is narrow but reproducible under specific conditions. Exploitation results in a kernel crash requiring a system reboot.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 5.5CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-609 · Double-Checked Locking