CVE-2022-48848

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48848
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48848.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48848
Downstream
Published
2024-07-16T12:25:16Z
Modified
2025-10-15T16:26:39.951902Z
Summary
tracing/osnoise: Do not unregister events twice
Details

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 tracepointprobeunregister+0x280/0x370 [...] CPU: 0 PID: 1217 Comm: trace-cmd Not tainted 5.17.0-rc6-next-20220307-nico+ #19 RIP: 0010:tracepointprobeunregister+0x280/0x370 [...] CR2: 00007ff919b29497 CR3: 0000000109da4005 CR4: 0000000000170ef0 Call Trace: <TASK> osnoiseworkloadstop+0x36/0x90 tracingsettracer+0x108/0x260 tracingsettracewrite+0x94/0xd0 ? _checkobjectsize.part.0+0x10a/0x150 ? selinuxfilepermission+0x104/0x150 vfswrite+0xb5/0x290 ksyswrite+0x5f/0xe0 dosyscall64+0x3b/0x90 entrySYSCALL64afterhwframe+0x44/0xae RIP: 0033:0x7ff919a18127 [...] ---[ end trace 0000000000000000 ]---

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 > currenttracer # echo 0 > tracingon # 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 traceosnoisecallback_enabled variable to check if the events (and the workload) are actually active before trying to deactivate them.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2fac8d6486d5c34e2ec7028580142b8209da3f92
Fixed
4e10787d18379d9b296290c2288097feddef16d4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2fac8d6486d5c34e2ec7028580142b8209da3f92
Fixed
f0cfe17bcc1dd2f0872966b554a148e888833ee9

Affected versions

v5.*

v5.15
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.10
v5.16.11
v5.16.12
v5.16.13
v5.16.14
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.15