CVE-2023-53368

tracing: Fix race issue between cpu buffer write and swap

MEDIUM
4.7
CVSS Score
Published: September 17, 2025 at 02:56 PM UTC
Updated: June 17, 2026 at 06:45 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.1%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: tracing: Fix race issue between cpu buffer write and swap Warning happened in rb_end_commit() at code: if (RB_WARN_ON(cpu_buffer, !local_read(&cpu_buffer->committing))) WARNING: CPU: 0 PID: 139 at kernel/trace/ring_buffer.c:3142 rb_commit+0x402/0x4a0 Call Trace: ring_buffer_unlock_commit+0x42/0x250 trace_buffer_unlock_commit_regs+0x3b/0x250 trace_event_buffer_commit+0xe5/0x440 trace_event_buffer_reserve+0x11c/0x150 trace_event_raw_event_sched_switch+0x23c/0x2c0 __traceiter_sched_switch+0x59/0x80 __schedule+0x72b/0x1580 schedule+0x92/0x120 worker_thread+0xa0/0x6f0 It is because the race between writing event into cpu buffer and swapping cpu buffer through file per_cpu/cpu0/snapshot: Write on CPU 0 Swap buffer by per_cpu/cpu0/snapshot on CPU 1 -------- -------- tracing_snapshot_write() [...] ring_buffer_lock_reserve() cpu_buffer = buffer->buffers[cpu]; // 1. Suppose find 'cpu_buffer_a'; [...] rb_reserve_next_event() [...] ring_buffer_swap_cpu() if (local_read(&cpu_buffer_a->committing)) goto out_dec; if (local_read(&cpu_buffer_b->committing)) goto out_dec; buffer_a->buffers[cpu] = cpu_buffer_b; buffer_b->buffers[cpu] = cpu_buffer_a; // 2. cpu_buffer has swapped here. rb_start_commit(cpu_buffer); if (unlikely(READ_ONCE(cpu_buffer->buffer) != buffer)) { // 3. This check passed due to 'cpu_buffer->buffer' [...] // has not changed here. return NULL; } cpu_buffer_b->buffer = buffer_a; cpu_buffer_a->buffer = buffer_b; [...] // 4. Reserve event from 'cpu_buffer_a'. ring_buffer_unlock_commit() [...] cpu_buffer = buffer->buffers[cpu]; // 5. Now find 'cpu_buffer_b' !!! rb_commit(cpu_buffer) rb_end_commit() // 6. WARN for the wrong 'committing' state !!! Based on above analysis, we can easily reproduce by following testcase: ``` bash #!/bin/bash dmesg -n 7 sysctl -w kernel.panic_on_warn=1 TR=/sys/kernel/tracing echo 7 > ${TR}/buffer_size_kb echo "sched:sched_switch" > ${TR}/set_event while [ true ]; do echo 1 > ${TR}/per_cpu/cpu0/snapshot done & while [ true ]; do echo 1 > ${TR}/per_cpu/cpu0/snapshot done & while [ true ]; do echo 1 > ${TR}/per_cpu/cpu0/snapshot done & ``` To fix it, IIUC, we can use smp_call_function_single() to do the swap on the target cpu where the buffer is located, so that above race would be avoided.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.10 ≤ v < 5.10.1953.10 ≤ v < 5.15.1323.10 ≤ v < 5.4.2573.10 ≤ v < 6.1.533.10 ≤ v < 6.4.163.10 ≤ v < 6.5.33.10 ≤ v < 6.65.11 ≤ v < 5.15.1325.16 ≤ v < 6.1.535.5 ≤ v < 5.10.1956.2 ≤ v < 6.4.166.5 ≤ v < 6.5.33.10f1affcaaa861f27752a769f889bf1486ebd301fe
Vendor states this is fixed in 3163f635b20e9e1fb4659e74f47918c9dddfe64e (fixed)
Vendor states this is fixed in 37ca1b686078b00cc4ffa008e2190615f7709b5d (fixed)
Vendor states this is fixed in 6182318ac04648b46db9d441fd7d696337fcdd0b (fixed)
Vendor states this is fixed in 74c85396bd73eca80b96510b4edf93b9a3aff75f (fixed)
Vendor states this is fixed in 89c89da92a60028013f9539be0dcce7e44405a43 (fixed)
Vendor states this is fixed in 90e037cabc2c2dfc39b3dd9c5b22ea91f995539a (fixed)
Vendor states this is fixed in c5d30d6aa83d99fba8dfdd9cf6c4e4e7a63244db (fixed)
Vendor states this is fixed in 3.10 (unaffected)
Vendor states this is fixed in 5.10.195 (unaffected)
Vendor states this is fixed in 5.15.132 (unaffected)
Vendor states this is fixed in 5.4.257 (unaffected)
Vendor states this is fixed in 6.1.53 (unaffected)
Vendor states this is fixed in 6.4.16 (unaffected)
Vendor states this is fixed in 6.5.3 (unaffected)
Vendor states this is fixed in 6.6 (unaffected)

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

4.7MEDIUMCISA-ADP
Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-362

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card