nday
CVE-2023-53368

tracing: Fix race issue between cpu buffer write and swap

Linux / Linux

揭露時間:。nday 尚未取得修補依據,不能據此認為沒有修補。四個 PoC 來源皆未收錄。目前未列入 CISA KEV。

tags weakness typerace condition accesslocalno user interaction productLinux kernel product typeoperating system
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

race condition
CWE-362, stated by the ADP CISA-ADP、NVD's analysts 與 NVD, republishing 134c704f-9b21-4f2e-91b3-4a467353bcc0
local
AV:L in CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H (CVSS 3.1) from the ADP CISA-ADP
no user interaction
UI:N in CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H (CVSS 3.1) from the ADP CISA-ADP
Linux kernel
affected products in the CVE record: Linux · LinuxCPE names NVD's analysts give as vulnerable: o:linux:linux_kernel
operating system
affected products in the CVE record: Linux · LinuxCPE names NVD's analysts give as vulnerable: o:linux:linux_kernelthe product type of Linux kernel in nday's product registry
目前階段
DIS
揭露時間
CVSS
4.7 MEDIUM v3.1

生命週期

橫軸 UTC;點=精確到分鐘,寬條=僅日期,空心=不明或推斷。
時間不明
DIS揭露
2025-09-17T14:56Z
PAT修補
尚無紀錄
ANA分析
尚無紀錄
POCPoC
尚無紀錄
ITW遭利用
尚無紀錄
KEVKEV
尚無紀錄

摘要

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.

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:H
High: success depends on conditions outside the attacker's control, such as gathering details of the target or winning a race
Privileges required PR:L
Low: ordinary user privileges
User interaction UI:N
None: no action by anyone other than the attacker

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

CVSS 3.1 vector from the CVE record, added by the ADP CISA-ADP.

事件紀錄

+DIS揭露

CVE 紀錄由 Linux 發布。CVSS 4.7,屬中風險等級。

來源 cvelist · nday 於 批次匯入 · 原始
{
  "id": 309544,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2023-53368",
  "occurred_at": "2025-09-17T14:56:56.752Z",
  "observed_at": "2026-11-13T05:38:14.046808Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "source": "adp:CISA-ADP",
      "vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H",
      "version": "3.1",
      "base_score": 4.7,
      "base_severity": "MEDIUM"
    },
    "ssvc": {
      "timestamp": "2026-01-14T18:46:08.777326Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2025-09-17T14:56:56.752Z",
    "assigner_short_name": "Linux"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

研究員討論

近 7 天有 0 位研究員提及

名單內研究員在 X 上提及此 CVE 的貼文,照原文呈現,nday 不查核。

尚未收錄名單內研究員在 X 上提及此 CVE 的貼文。

Discussion

0 comments

No comments yet.