CVE-2026-74633: tracing: Fix NULL pointer dereference in module event cache removal
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix NULL pointer dereference in module event cache removal
A module-only event filter such as ":mod:foo" is cached with a NULL eventmod->match when foo has not been loaded. If a later write tries to remove a specific match from the same module, removecachemod() passes the NULL cached match to strcmp(), causing a NULL pointer dereference.
The issue can be reproduced from userspace:
echo ':mod:traceeventskunitmissing' > /sys/kernel/tracing/setevent echo '!foobar:mod:traceeventskunitmissing' >> /sys/kernel/tracing/setevent
The second write must be a concatenation (">>") to not include OTRUNC as that would cause ftraceclearevents() to clear the cached modules lines.
The crash was reproduced on x8664 QEMU while KUnit workers contended on the event tracing path:
BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode RIP: 0010:strcmp+0x10/0x30 Call Trace: ftracesetclreventnolock+0x373/0x4a0 ftracesetclrevent+0xf0/0x180 ftraceeventwrite+0xdf/0x110 vfswrite+0xf6/0x440 ksyswrite+0x68/0xe0 dosyscall64+0xf9/0x540 entrySYSCALL64afterhwframe+0x77/0x7f
Check eventmod->match before comparing it, consistent with the existing NULL checks for the cached system and event fields. The mismatched removal continues to return -EINVAL; a broad cached module filter is removed with "!:mod:<module>".
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1
Event History
Frequently Asked Questions
What access is needed to trigger this issue?
An attacker needs the ability to write event-filter commands to /sys/kernel/tracing/set_event. The documented reproduction is performed from userspace using writes to that tracing control file.
What sequence triggers the NULL pointer dereference?
A module-only filter for a module that is not loaded must first be cached, leaving its cached match value NULL. A later appended write that removes a specific match from that same module can cause the kernel to pass that NULL value to strcmp().
Does the way the tracing file is opened matter for reproduction?
Yes. The second command must be appended rather than written with truncation, because O_TRUNC causes ftrace_clear_events() to clear the cached module entries and prevents the described trigger sequence.
How would the failure appear on an affected system?
The kernel can crash with a NULL pointer dereference during strcmp(), with the tracing event write path in the call trace, including __ftrace_set_clr_event_nolock, ftrace_set_clr_event, and ftrace_event_write.