CVE-2024-38601 json
ring-buffer: Fix a race between readers and resize checks
published 2024-06-19 2 y ago modified 2026-06-17 4 mo ago also EUVD-2024-37464
- cvss
- 4.7
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 7%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
ring-buffer: Fix a race between readers and resize checks
The reader code in rb_get_reader_page() swaps a new reader page into the ring buffer by doing cmpxchg on old->list.prev->next to point it to the new page. Following that, if the operation is successful, old->list.next->prev gets updated too. This means the underlying doubly-linked list is temporarily inconsistent, page->prev->next or page->next->prev might not be equal back to page for some page in the ring buffer.
The resize operation in ring_buffer_resize() can be invoked in parallel. It calls rb_check_pages() which can detect the described inconsistency and stop further tracing:
[ 190.271762] ------------[ cut here ]------------ [ 190.271771] WARNING: CPU: 1 PID: 6186 at kernel/trace/ring_buffer.c:1467 rb_check_pages.isra.0+0x6a/0xa0 [ 190.271789] Modules linked in: [...] [ 190.271991] Unloaded tainted modules: intel_uncore_frequency(E):1 skx_edac(E):1 [ 190.272002] CPU: 1 PID: 6186 Comm: cmd.sh Kdump: loaded Tainted: G E 6.9.0-rc6-default #5 158d3e1e6d0b091c34c3b96bfd99a1c58306d79f [ 190.272011] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.0-0-gd239552c-rebuilt.opensuse.org 04/01/2014 [ 190.272015] RIP: 0010:rb_check_pages.isra.0+0x6a/0xa0 [ 190.272023] Code: [...] [ 190.272028] RSP: 0018:ffff9c37463abb70 EFLAGS: 00010206 [ 190.272034] RAX: ffff8eba04b6cb80 RBX: 0000000000000007 RCX: ffff8eba01f13d80 [ 190.272038] RDX: ffff8eba01f130c0 RSI: ffff8eba04b6cd00 RDI: ffff8eba0004c700 [ 190.272042] RBP: ffff8eba0004c700 R08: 0000000000010002 R09: 0000000000000000 [ 190.272045] R10: 00000000ffff7f52 R11: ffff8eba7f600000 R12: ffff8eba0004c720 [ 190.272049] R13: ffff8eba00223a00 R14: 0000000000000008 R15: ffff8eba067a8000 [ 190.272053] FS: 00007f1bd64752c0(0000) GS:ffff8eba7f680000(0000) knlGS:0000000000000000 [ 190.272057] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 190.272061] CR2: 00007f1bd6662590 CR3: 000000010291e001 CR4: 0000000000370ef0 [ 190.272070] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 190.272073] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 190.272077] Call Trace: [ 190.272098] <TASK> [ 190.272189] ring_buffer_resize+0x2ab/0x460 [ 190.272199] __tracing_resize_ring_buffer.part.0+0x23/0xa0 [ 190.272206] tracing_resize_ring_buffer+0x65/0x90 [ 190.272216] tracing_entries_write+0x74/0xc0 [ 190.272225] vfs_write+0xf5/0x420 [ 190.272248] ksys_write+0x67/0xe0 [ 190.272256] do_syscall_64+0x82/0x170 [ 190.272363] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 190.272373] RIP: 0033:0x7f1bd657d263 [ 190.272381] Code: [...] [ 190.272385] RSP: 002b:00007ffe72b643f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 190.272391] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f1bd657d263 [ 190.272395] RDX: 0000000000000002 RSI: 0000555a6eb538e0 RDI: 0000000000000001 [ 190.272398] RBP: 0000555a6eb538e0 R08: 000000000000000a R09: 0000000000000000 [ 190.272401] R10: 0000555a6eb55190 R11: 0000000000000246 R12: 00007f1bd6662500 [ 190.272404] R13: 0000000000000002 R14: 00007f1bd6667c00 R15: 0000000000000002 [ 190.272412] </TASK> [ 190.272414] ---[ end trace 0000000000000000 ]---
Note that ring_buffer_resize() calls rb_check_pages() only if the parent trace_buffer has recording disabled. Recent commit d78ab792705c ("tracing: Stop current tracer when resizing buffer") causes that it is now always the case which makes it more likely to experience this issue.
The window to hit this race is nonetheless very small. To help reproducing it, one can add a delay loop in rb_get_reader_page():
ret = rb_head_page_replace(reader, cpu_buffer->reader_page); if (!ret) goto spin; for (unsigned i = 0; i < 1U << 26; i++) /* inserted delay loop */ __asm__ __volatile__ ("" : : : "memory"); rb_list_head(reader->list.next)->prev = &cpu_buffer->reader_page->list;
.. ---truncated---
Patch / fix
- Linux Linux 4.19.316, 5.4.278, 5.10.219, 5.15.161, 6.1.93, 6.6.33, 6.8.12, 6.9.3, 6.10
- linux Debian 12 6.1.94-1
- linux Debian 14, Debian 13 6.8.12-1
debian advisories DEBIAN-CVE-2024-38601
- linux Ubuntu 20.04 LTS 5.4.0-192.212
- linux Ubuntu 22.04 LTS 5.15.0-121.131
- linux Ubuntu 24.04 LTS 6.8.0-40.40
- linux-aws Ubuntu 20.04 LTS 5.4.0-1130.140
- linux-aws Ubuntu 22.04 LTS 5.15.0-1069.75
- linux-aws Ubuntu 24.04 LTS 6.8.0-1013.14
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1134.143
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1068.76
ubuntu advisories UBUNTU-CVE-2024-38601
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel RHEL 9 5.14.0-427.37.1.el9_4
- rv RHEL 9 5.14.0-427.37.1.el9_4
- perf RHEL 9 5.14.0-427.37.1.el9_4
- rtla RHEL 9 5.14.0-427.37.1.el9_4
- bpftool RHEL 9 7.3.0-427.37.1.el9_4
- libperf RHEL 9 5.14.0-427.37.1.el9_4
- kernel-rt RHEL 9 5.14.0-427.37.1.el9_4
- kernel-64k RHEL 9 5.14.0-427.37.1.el9_4
red hat advisories RHSA-2024:6997
- kernel-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source Linux Micro 6.0 6.4.0-18.1
- kernel-default Linux Micro 6.0 6.4.0-18.1
- kernel-kvmsmall Linux Micro 6.0 6.4.0-18.1
- kernel-default-base Linux Micro 6.0 6.4.0-17.1.1.51
- kernel-rt Real Time Module 15 SP6, openSUSE Leap 15.6 6.4.0-150600.10.5.1
- kernel-syms-rt Real Time Module 15 SP6, openSUSE Leap 15.6 6.4.0-150600.10.5.1
suse advisories SUSE-SU-2025:20028-1SUSE-SU-2025:20008-1SUSE-SU-2024:2973-1SUSE-SU-2024:2939-1SUSE-SU-2024:2896-1SUSE-SU-2024:2571-1
- kernel AlmaLinux 9 5.14.0-427.37.1.el9_4
- rv AlmaLinux 9 5.14.0-427.37.1.el9_4
- perf AlmaLinux 9 5.14.0-427.37.1.el9_4
- rtla AlmaLinux 9 5.14.0-427.37.1.el9_4
- bpftool AlmaLinux 9 7.3.0-427.37.1.el9_4
- libperf AlmaLinux 9 5.14.0-427.37.1.el9_4
- kernel-rt AlmaLinux 9 5.14.0-427.37.1.el9_4
- kernel-64k AlmaLinux 9 5.14.0-427.37.1.el9_4
almalinux advisories ALSA-2024:6997
- git.kernel.org/stable/c/b50932ea673b5a089a4bb570a8a868d95c72854e commit
- git.kernel.org/stable/c/c68b7a442ee61d04ca58b2b5cb5ea7cb8230f84a commit
- git.kernel.org/stable/c/1e160196042cac946798ac192a0bc3398f1aa66b commit
- git.kernel.org/stable/c/595363182f28786d641666a09e674b852c83b4bb commit
- git.kernel.org/stable/c/54c64967ba5f8658ae7da76005024ebd3d9d8f6e commit
- git.kernel.org/stable/c/af3274905b3143ea23142bbf77bd9b610c54e533 commit
- git.kernel.org/stable/c/5ef9e330406d3fb4f4b2c8bca2c6b8a93bae32d1 commit
- git.kernel.org/stable/c/79b52013429a42b8efdb0cda8bb0041386abab87 commit
- git.kernel.org/stable/c/c2274b908db05529980ec056359fae916939fdaa commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-38601 updated cvss 4.1
kernel: ring-buffer: Fix a race between readers and resize checks
-
Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 kernel-rt, kernel-rt-kvm, kernel-rt-core, kernel-rt-modules, kernel-rt-debug-kvm, kernel-rt-debug-core, +12 moreaffected: no fix available “Fix deferred”
-
Red Hat Enterprise Linux AppStream (v. 9) rv 5.14.0-427.37.1.el9_4, perf 5.14.0-427.37.1.el9_4, rtla 5.14.0-427.37.1.el9_4, kernel-devel-matched 5.14.0-427.37.1.el9_4, kernel-64k-devel-matched 5.14.0-427.37.1.el9_4, kernel-debug-devel-matched 5.14.0-427.37.1.el9_4, +6 more Red Hat Enterprise Linux BaseOS (v. 9) bpftool 7.3.0-427.37.1.el9_4, kernel 5.14.0-427.37.1.el9_4, kernel-64k 5.14.0-427.37.1.el9_4, kernel-core 5.14.0-427.37.1.el9_4, kernel-tools 5.14.0-427.37.1.el9_4, python3-perf 5.14.0-427.37.1.el9_4, +28 more Red Hat Enterprise Linux CRB (v. 9) libperf 5.14.0-427.37.1.el9_4, kernel-debuginfo-common-s390x 5.14.0-427.37.1.el9_4, kernel-debuginfo-common-x86_64 5.14.0-427.37.1.el9_4, kernel-debuginfo-common-aarch64 5.14.0-427.37.1.el9_4, kernel-debuginfo-common-ppc64le 5.14.0-427.37.1.el9_4 Red Hat Enterprise Linux NFV (v. 9) kernel-rt 5.14.0-427.37.1.el9_4, kernel-rt-kvm 5.14.0-427.37.1.el9_4, kernel-rt-core 5.14.0-427.37.1.el9_4, kernel-rt-modules 5.14.0-427.37.1.el9_4, kernel-rt-debug-kvm 5.14.0-427.37.1.el9_4, kernel-rt-debug-core 5.14.0-427.37.1.el9_4, +6 more Red Hat Enterprise Linux RT (v. 9) kernel-rt 5.14.0-427.37.1.el9_4, kernel-rt-core 5.14.0-427.37.1.el9_4, kernel-rt-modules 5.14.0-427.37.1.el9_4, kernel-rt-debug-core 5.14.0-427.37.1.el9_4, kernel-rt-modules-core 5.14.0-427.37.1.el9_4, kernel-rt-debug-modules 5.14.0-427.37.1.el9_4, +4 morefixed: vendor fix RHSA-2024:6997
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-25-226-15 updated cvss 0.0
Siemens SINEC OS
-
Siemens RUGGEDCOM RST2428P (6GK6242-6PA00) < 3.1 Siemens SCALANCE XCM-/XRM-/XCH-/XRH-300 family < 3.1affected: fixed in V3.1 support.industry.siemens.com
-
Siemens SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 familynot affected
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.18% chance of exploitation in the next 30 days, higher than 7% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 4.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization
- Technology feeds
References
-
git.kernel.org
/stable/c/b50932ea673b5a089a4bb570a8a868d95c72854e
patch
-
git.kernel.org
/stable/c/c68b7a442ee61d04ca58b2b5cb5ea7cb8230f84a
patch
-
git.kernel.org
/stable/c/1e160196042cac946798ac192a0bc3398f1aa66b
patch
-
git.kernel.org
/stable/c/595363182f28786d641666a09e674b852c83b4bb
patch
-
git.kernel.org
/stable/c/54c64967ba5f8658ae7da76005024ebd3d9d8f6e
patch
-
git.kernel.org
/stable/c/af3274905b3143ea23142bbf77bd9b610c54e533
patch
-
git.kernel.org
/stable/c/5ef9e330406d3fb4f4b2c8bca2c6b8a93bae32d1
patch
-
git.kernel.org
/stable/c/79b52013429a42b8efdb0cda8bb0041386abab87
patch
-
git.kernel.org
/stable/c/c2274b908db05529980ec056359fae916939fdaa
patch
- lists.debian.org /debian-lts-announce/2024/06/msg00020.html
Sources
- CVE List CVE-2024-38601
- NVD CVE-2024-38601
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.