bpf: Fix overrunning reservations in ringbuf
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 24 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-770.
Summary
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix overrunning reservations in ringbuf The BPF ring buffer internally is implemented as a power-of-2 sized circular buffer, with two logical and ever-increasing counters: consumer_pos is the consumer counter to show which logical position the consumer consumed the data, and producer_pos which is the producer counter denoting the amount of data reserved by all producers. Each time a record is reserved, the producer that "owns" the record will successfully advance producer counter. In user space each time a record is read, the consumer of the data advanced the consumer counter once it finished processing. Both counters are stored in separate pages so that from user space, the producer counter is read-only and the consumer counter is read-write. One aspect that simplifies and thus speeds up the implementation of both producers and consumers is how the data area is mapped twice contiguously back-to-back in the virtual memory, allowing to not take any special measures for samples that have to wrap around at the end of the circular buffer data area, because the next page after the last data page would be first data page again, and thus the sample will still appear completely contiguous in virtual memory. Each record has a struct bpf_ringbuf_hdr { u32 len; u32 pg_off; } header for book-keeping the length and offset, and is inaccessible to the BPF program. Helpers like bpf_ringbuf_reserve() return `(void *)hdr + BPF_RINGBUF_HDR_SZ` for the BPF program to use. Bing-Jhong and Muhammad reported that it is however possible to make a second allocated memory chunk overlapping with the first chunk and as a result, the BPF program is now able to edit first chunk's header. For example, consider the creation of a BPF_MAP_TYPE_RINGBUF map with size of 0x4000. Next, the consumer_pos is modified to 0x3000 /before/ a call to bpf_ringbuf_reserve() is made. This will allocate a chunk A, which is in [0x0,0x3008], and the BPF program is able to edit [0x8,0x3008]. Now, lets allocate a chunk B with size 0x3000. This will succeed because consumer_pos was edited ahead of time to pass the `new_prod_pos - cons_pos > rb->mask` check. Chunk B will be in range [0x3008,0x6010], and the BPF program is able to edit [0x3010,0x6010]. Due to the ring buffer memory layout mentioned earlier, the ranges [0x0,0x4000] and [0x4000,0x8000] point to the same data pages. This means that chunk B at [0x4000,0x4008] is chunk A's header. bpf_ringbuf_submit() / bpf_ringbuf_discard() use the header's pg_off to then locate the bpf_ringbuf itself via bpf_ringbuf_restore_from_rec(). Once chunk B modified chunk A's header, then bpf_ringbuf_commit() refers to the wrong page and could cause a crash. Fix it by calculating the oldest pending_pos and check whether the range from the oldest outstanding record to the newest would span beyond the ring buffer size. If that is the case, then reject the request. We've tested with the ring buffer benchmark in BPF selftests (./benchs/run_bench_ringbufs.sh) before/after the fix and while it seems a bit slower on some benchmarks, it is still not significantly enough to matter.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Linux | Linux | 5.8 and later | 5.10.223, 5.15.164, 6.1.97, 6.6.37, 6.9.8, 6.10 | Patch available | CNA |
- Linux VendorLinux Affected 5.8 and later Fixed in 5.10.223, 5.15.164, 6.1.97, 6.6.37, 6.9.8, 6.10 Patch available CNA
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.8 to before 6.1.97; 6.2 to before 6.6.37; 6.7 to before 6.9.8 | Vulnerable | Linux |
- cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* Versions 5.8 to before 6.1.97; 6.2 to before 6.6.37; 6.7 to before 6.9.8 Vulnerable ·Linux
Remediation
- Fix · CNA Linux (Linux) Fixed in 5.10.223, 5.15.164, 6.1.97, 6.6.37, 6.9.8, 6.10
Red Hat 8 advisories
- RHSA-2024:10771 Released 2024-12-04 · Red Hat rating Moderatekernel security update
- Red Hat CodeReady Linux Builder EUS (v.9.4) kernel-tools-libs-devel-5.14.0-427.47.1.el9_4, libperf-5.14.0-427.47.1.el9_4
- Red Hat Enterprise Linux AppStream EUS (v.9.4) kernel-64k-debug-devel-5.14.0-427.47.1.el9_4, kernel-64k-debug-devel-matched-5.14.0-427.47.1.el9_4, kernel-64k-devel-5.14.0-427.47.1.el9_4 +11
- Red Hat Enterprise Linux BaseOS EUS (v.9.4) bpftool-7.3.0-427.47.1.el9_4, kernel-5.14.0-427.47.1.el9_4, kernel-64k-5.14.0-427.47.1.el9_4 +29
- Red Hat Enterprise Linux Real Time EUS (v.9.4) kernel-rt-5.14.0-427.47.1.el9_4, kernel-rt-core-5.14.0-427.47.1.el9_4, kernel-rt-debug-5.14.0-427.47.1.el9_4 +9
- Red Hat Enterprise Linux Real Time for NFV EUS (v.9.4) kernel-rt-5.14.0-427.47.1.el9_4, kernel-rt-core-5.14.0-427.47.1.el9_4, kernel-rt-debug-5.14.0-427.47.1.el9_4 +11
- RHSA-2024:10772 Released 2024-12-04 · Red Hat rating Moderatekernel security update
- Red Hat CodeReady Linux Builder EUS (v.9.2) kernel-tools-libs-devel-5.14.0-284.95.1.el9_2
- Red Hat Enterprise Linux AppStream EUS (v.9.2) kernel-64k-debug-devel-5.14.0-284.95.1.el9_2, kernel-64k-debug-devel-matched-5.14.0-284.95.1.el9_2, kernel-64k-devel-5.14.0-284.95.1.el9_2 +10
- Red Hat Enterprise Linux BaseOS EUS (v.9.2) bpftool-7.0.0-284.95.1.el9_2, kernel-5.14.0-284.95.1.el9_2, kernel-64k-5.14.0-284.95.1.el9_2 +29
- RHSA-2024:10773 Released 2024-12-04 · Red Hat rating Moderatekernel-rt security update
- Red Hat Enterprise Linux Real Time EUS (v.9.2) kernel-rt-5.14.0-284.95.1.rt14.380.el9_2, kernel-rt-core-5.14.0-284.95.1.rt14.380.el9_2, kernel-rt-debug-5.14.0-284.95.1.rt14.380.el9_2 +9
- Red Hat Enterprise Linux Real Time for NFV EUS (v.9.2) kernel-rt-5.14.0-284.95.1.rt14.380.el9_2, kernel-rt-core-5.14.0-284.95.1.rt14.380.el9_2, kernel-rt-debug-5.14.0-284.95.1.rt14.380.el9_2 +11
Show 5 more Red Hat advisories
- RHSA-2024:10274 Released 2024-11-26 · Red Hat rating Moderatekernel security update
- Red Hat CodeReady Linux Builder (v. 9) kernel-tools-libs-devel-5.14.0-503.15.1.el9_5, libperf-5.14.0-503.15.1.el9_5
- Red Hat Enterprise Linux AppStream (v. 9) kernel-64k-debug-devel-5.14.0-503.15.1.el9_5, kernel-64k-debug-devel-matched-5.14.0-503.15.1.el9_5, kernel-64k-devel-5.14.0-503.15.1.el9_5 +11
- Red Hat Enterprise Linux BaseOS (v. 9) bpftool-7.4.0-503.15.1.el9_5, kernel-5.14.0-503.15.1.el9_5, kernel-64k-5.14.0-503.15.1.el9_5 +30
- Red Hat Enterprise Linux Real Time (v. 9) kernel-rt-5.14.0-503.15.1.el9_5, kernel-rt-core-5.14.0-503.15.1.el9_5, kernel-rt-debug-5.14.0-503.15.1.el9_5 +9
- Red Hat Enterprise Linux Real Time for NFV (v. 9) kernel-rt-5.14.0-503.15.1.el9_5, kernel-rt-core-5.14.0-503.15.1.el9_5, kernel-rt-debug-5.14.0-503.15.1.el9_5 +11
- RHSA-2024:10262 Released 2024-11-26 · Red Hat rating Moderatekernel security update
- Red Hat CodeReady Linux Builder EUS (v.8.8) kernel-tools-libs-devel-4.18.0-477.81.1.el8_8
- Red Hat Enterprise Linux BaseOS EUS (v.8.8) bpftool-4.18.0-477.81.1.el8_8, kernel-4.18.0-477.81.1.el8_8, kernel-abi-stablelists-4.18.0-477.81.1.el8_8 +19
- RHSA-2024:8856 Released 2024-11-05 · Red Hat rating Moderatekernel security update
- Red Hat Enterprise Linux BaseOS (v. 8) bpftool-4.18.0-553.27.1.el8_10, kernel-4.18.0-553.27.1.el8_10, kernel-abi-stablelists-4.18.0-553.27.1.el8_10 +19
- Red Hat Enterprise Linux CRB (v. 8) kernel-tools-libs-devel-4.18.0-553.27.1.el8_10
- RHSA-2024:8870 Released 2024-11-05 · Red Hat rating Moderatekernel-rt security update
- Red Hat Enterprise Linux NFV (v. 8) kernel-rt-4.18.0-553.27.1.rt7.368.el8_10, kernel-rt-core-4.18.0-553.27.1.rt7.368.el8_10, kernel-rt-debug-4.18.0-553.27.1.rt7.368.el8_10 +9
- Red Hat Enterprise Linux RT (v. 8) kernel-rt-4.18.0-553.27.1.rt7.368.el8_10, kernel-rt-core-4.18.0-553.27.1.rt7.368.el8_10, kernel-rt-debug-4.18.0-553.27.1.rt7.368.el8_10 +7
- RHSA-2024:6753 Released 2024-09-18 · Red Hat rating Moderatekernel security update
- Red Hat Enterprise Linux BaseOS AUS (v.8.6) bpftool-4.18.0-372.123.1.el8_6, kernel-4.18.0-372.123.1.el8_6, kernel-abi-stablelists-4.18.0-372.123.1.el8_6 +14
- Red Hat Enterprise Linux BaseOS E4S (v.8.6) bpftool-4.18.0-372.123.1.el8_6, kernel-4.18.0-372.123.1.el8_6, kernel-abi-stablelists-4.18.0-372.123.1.el8_6 +19
- Red Hat Enterprise Linux BaseOS TUS (v.8.6) bpftool-4.18.0-372.123.1.el8_6, kernel-4.18.0-372.123.1.el8_6, kernel-abi-stablelists-4.18.0-372.123.1.el8_6 +14
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 9 | Affected | No fix planned: Will not fix |
| Red Hat CodeReady Linux Builder (v. 9) | Fixed | RHSA-2024:10274 |
| Red Hat CodeReady Linux Builder EUS (v.8.8) | Fixed | RHSA-2024:10262 |
| Red Hat CodeReady Linux Builder EUS (v.9.2) | Fixed | RHSA-2024:10772 |
| Red Hat CodeReady Linux Builder EUS (v.9.4) | Fixed | RHSA-2024:10771 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2024:10274 |
| Red Hat Enterprise Linux AppStream EUS (v.9.2) | Fixed | RHSA-2024:10772 |
| Red Hat Enterprise Linux AppStream EUS (v.9.4) | Fixed | RHSA-2024:10771 |
| Red Hat Enterprise Linux BaseOS (v. 8) | Fixed | RHSA-2024:8856 |
| Red Hat Enterprise Linux BaseOS (v. 9) | Fixed | RHSA-2024:10274 |
| Red Hat Enterprise Linux BaseOS AUS (v.8.6) | Fixed | RHSA-2024:6753 |
| Red Hat Enterprise Linux BaseOS E4S (v.8.6) | Fixed | RHSA-2024:6753 |
| Red Hat Enterprise Linux BaseOS EUS (v.8.8) | Fixed | RHSA-2024:10262 |
| Red Hat Enterprise Linux BaseOS EUS (v.9.2) | Fixed | RHSA-2024:10772 |
| Red Hat Enterprise Linux BaseOS EUS (v.9.4) | Fixed | RHSA-2024:10771 |
| Red Hat Enterprise Linux BaseOS TUS (v.8.6) | Fixed | RHSA-2024:6753 |
| Red Hat Enterprise Linux CRB (v. 8) | Fixed | RHSA-2024:8856 |
| Red Hat Enterprise Linux NFV (v. 8) | Fixed | RHSA-2024:8870 |
| Red Hat Enterprise Linux RT (v. 8) | Fixed | RHSA-2024:8870 |
| Red Hat Enterprise Linux Real Time (v. 9) | Fixed | RHSA-2024:10274 |
| Red Hat Enterprise Linux Real Time EUS (v.9.2) | Fixed | RHSA-2024:10773 |
| Red Hat Enterprise Linux Real Time EUS (v.9.4) | Fixed | RHSA-2024:10771 |
| Red Hat Enterprise Linux Real Time for NFV (v. 9) | Fixed | RHSA-2024:10274 |
| Red Hat Enterprise Linux Real Time for NFV EUS (v.9.2) | Fixed | RHSA-2024:10773 |
| Red Hat Enterprise Linux Real Time for NFV EUS (v.9.4) | Fixed | RHSA-2024:10771 |
Not affected: 2 products
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux AppStream EUS (v.9.2)
Timeline
- 2026-10-02 Threatist record created from CVE-2024-41009
- 2026-10-03 Alias added: GHSA-qvfw-rqcg-jh9g
References
Patch 4
More Linux Kernel vulnerabilities
- TI-2025-26358 tls: fix handling of zero-length records on the rx_list KEVCVSS 3.1CRITICAL 9.8
- TI-2026-38352 netfilter: bridge: make ebt_snat ARP rewrite writable KEVCVSS 3.1HIGH 8.8
- TI-2013-05264 The (1) get_user and (2) put_user API functions in the Linux kernel before 3.5.5 on the… KEVCVSS 3.1HIGH 8.8
- TI-2022-00125 Integer overflow in kernel KEVCVSS 3.1HIGH 8.4
- TI-2013-01864 The perf_swevent_init function in kernel/events/core.c in the Linux kernel before 3.8.9… KEVCVSS 3.1HIGH 8.4
- TI-2021-05514 Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACE KEVCVSS 3.1HIGH 8.3
Sources
- CVE-2024-41009 · CVE Program
- CVE-2024-41009 · NVD
- FIRST EPSS
- GHSA-qvfw-rqcg-jh9g · GitHub Advisory Database · CC BY 4.0
- CVE-2024-41009 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences