Skip to contentSkip to conversation

CVE-2026-74471: tracing: Check return value of __register_event() in trace_module_add_events()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 15

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

tracing: Check return value of __register_event() in trace_module_add_events()

trace_module_add_events() ignores the return value of __register_event() and unconditionally calls __add_event_to_tracers() for each event.

If __register_event() fails (for example, if event_init() fails), the trace_event_call is not added to ftrace_events list, but __add_event_to_tracers() still creates a trace_event_file pointing to it. If module loading subsequently fails and module memory is freed, tracing state retains a stale trace_event_call pointer in trace_event_file, leading to a use-after-free when tracefs or tracing subsystem operations are later executed.

Fix this by checking the return value of __register_event() and only calling __add_event_to_tracers() if event registration succeeded.

The Linux kernel CVE team has assigned CVE-2026-74471 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 3.10 with commit ae63b31e4d0e2ec09c569306ea46f664508ef717 and fixed in 6.6.151 with commit d61ee2a27dfd5eb43ddc18af40168f5b9eb1cea5
	Issue introduced in 3.10 with commit ae63b31e4d0e2ec09c569306ea46f664508ef717 and fixed in 6.12.103 with commit 22f954f7a8afe975e85517aff41b35defe05144b
	Issue introduced in 3.10 with commit ae63b31e4d0e2ec09c569306ea46f664508ef717 and fixed in 6.18.44 with commit cbb5ed3be9cae70e1c12b1991009b4e12bf4a4ca
	Issue introduced in 3.10 with commit ae63b31e4d0e2ec09c569306ea46f664508ef717 and fixed in 7.1.8 with commit 000765dcdc3edf128990762790543adc4b868f6c
	Issue introduced in 3.10 with commit ae63b31e4d0e2ec09c569306ea46f664508ef717 and fixed in 7.2-rc6 with commit ac8719969e6c3c54e939834df812bc41f25453cf

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-74471

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
kernel/trace/trace_events.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/d61ee2a27dfd5eb43ddc18af40168f5b9eb1cea5
	https://git.kernel.org/stable/c/22f954f7a8afe975e85517aff41b35defe05144b
	https://git.kernel.org/stable/c/cbb5ed3be9cae70e1c12b1991009b4e12bf4a4ca
	https://git.kernel.org/stable/c/000765dcdc3edf128990762790543adc4b868f6c
	https://git.kernel.org/stable/c/ac8719969e6c3c54e939834df812bc41f25453cf