CVE-2022-48848 Information
Description
In the Linux kernel the following vulnerability has been resolved:
tracing/osnoise: Do not unregister events twice
Nicolas reported that using:
trace-cmd record -e all -M 10 -p osnoise –poll
Resulted in the following kernel warning:
————[ cut here ]————
WARNING: CPU: 0 PID: 1217 at kernel/tracepoint.c:404 tracepoint_probe_unregister+0x280/0x370
[…]
CPU: 0 PID: 1217 Comm: trace-cmd Not tainted 5.17.0-rc6-next-20220307-nico+ 19
RIP: 0010:tracepoint_probe_unregister+0x280/0x370
[…]
CR2: 00007ff919b29497 CR3: 0000000109da4005 CR4: 0000000000170ef0
Call Trace:
The warning complains about an attempt to unregister an unregistered tracepoint.
This happens on trace-cmd because it first stops tracing and then switches the tracer to nop. Which is equivalent to:
cd /sys/kernel/tracing/ echo osnoise > current_tracer echo 0 > tracing_on echo nop > current_tracer
The osnoise tracer stops the workload when no trace instance is actually collecting data. This can be caused both by disabling tracing or disabling the tracer itself.
To avoid unregistering events twice use the existing trace_osnoise_callback_enabled variable to check if the events (and the workload) are actually active before trying to deactivate them.
Reference
https://git.kernel.org/stable/c/4e10787d18379d9b296290c2288097feddef16d4 https://git.kernel.org/stable/c/f0cfe17bcc1dd2f0872966b554a148e888833ee9
Share on: