Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2023-53368— tracing: Fix race issue between cpu buffer write and swap

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于cpu缓冲区写入和交换之间存在竞争条件,可能导致警告触发。

AI Predicted 5.5 Difficulty: Moderate EPSS 0.14% · P3

Possible ATT&CK Techniques 1 AI

T1056 · Input Capture

Affected Version Matrix 16

VendorProduct Version RangeStatus
Linux Linux f1affcaaa861f27752a769f889bf1486ebd301fe< 90e037cabc2c2dfc39b3dd9c5b22ea91f995539a affected
f1affcaaa861f27752a769f889bf1486ebd301fe< c5d30d6aa83d99fba8dfdd9cf6c4e4e7a63244db affected
f1affcaaa861f27752a769f889bf1486ebd301fe< 6182318ac04648b46db9d441fd7d696337fcdd0b affected
f1affcaaa861f27752a769f889bf1486ebd301fe< 74c85396bd73eca80b96510b4edf93b9a3aff75f affected
f1affcaaa861f27752a769f889bf1486ebd301fe< 89c89da92a60028013f9539be0dcce7e44405a43 affected
f1affcaaa861f27752a769f889bf1486ebd301fe< 37ca1b686078b00cc4ffa008e2190615f7709b5d affected
f1affcaaa861f27752a769f889bf1486ebd301fe< 3163f635b20e9e1fb4659e74f47918c9dddfe64e affected
3.10 affected
… +8 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2023-53368

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
tracing: Fix race issue between cpu buffer write and swap
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于cpu缓冲区写入和交换之间存在竞争条件,可能导致警告触发。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux f1affcaaa861f27752a769f889bf1486ebd301fe ~ 90e037cabc2c2dfc39b3dd9c5b22ea91f995539a -
Linux Linux 3.10 -

II. Public POCs for CVE-2023-53368

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2023-53368

请登录查看更多情报信息。

Same Patch Batch · Linux · 2025-09-17 · 56 CVEs total

CVE-2022-50363 9.8 CRITICAL skmsg: pass gfp argument to alloc_sk_msg()
CVE-2022-50373 9.8 CRITICAL fs: dlm: fix race in lowcomms
CVE-2023-53360 9.8 CRITICAL NFSv4.2: Rework scratch handling for READ_PLUS (again)
CVE-2023-53338 9.8 CRITICAL lwt: Fix return values of BPF xmit ops
CVE-2023-53358 8.8 HIGH ksmbd: fix racy issue under cocurrent smb2 tree disconnect
CVE-2022-50355 7.8 HIGH staging: vt6655: fix some erroneous memory clean-up loops
CVE-2022-50354 7.8 HIGH drm/amdkfd: Fix kfd_process_device_init_vm error handling
CVE-2023-53340 7.8 HIGH net/mlx5: Collect command failures data only for known commands
CVE-2023-53354 7.8 HIGH skbuff: skb_segment, Call zero copy functions before using skbuff frags
CVE-2022-50367 7.8 HIGH fs: fix UAF/GPF bug in nilfs_mdt_destroy
CVE-2022-50368 7.8 HIGH drm/msm/dsi: fix memory corruption with too many bridges
CVE-2022-50362 7.8 HIGH dmaengine: hisilicon: Add multi-thread support for a DMA channel
CVE-2023-53335 7.5 HIGH RDMA/cxgb4: Fix potential null-ptr-deref in pass_establish()
CVE-2022-50365 7.5 HIGH skbuff: Account for tail adjustment during pull operations
CVE-2022-50364 i2c: mux: reg: check return value after calling platform_get_resource()
CVE-2022-50374 Bluetooth: hci_{ldisc,serdev}: check percpu_init_rwsem() failure
CVE-2022-50372 cifs: Fix memory leak when build ntlmssp negotiate blob failed
CVE-2023-53336 media: ipu-bridge: Fix null pointer deref on SSDB/PLD parsing warnings
CVE-2022-50370 i2c: designware: Fix handling of real but unexpected device interrupts
CVE-2022-50371 led: qcom-lpg: Fix sleeping in atomic

Showing top 20 of 56 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2023-53368

No comments yet


Leave a comment