Breaking: Java4Shell (CVE-2026-114938) - Less Than 0.12% of JVMs Estimated at Risk of RCE
Read the Report
Learn How MCP Is Bypassing a Decade of Cloud Security Best Practices
Read the Report
Are you exposed? Connect a repo in minutes.
Scan your repos free

CVE-2024-41009

kernel: bpf: Fix overrunning reservations in ringbuf

Overview

Published
17 Jul 2024
Modified
4 Aug 2026
Medium CVE
0 Registry packages
198 OS packages
15 Linux distributions
Yes Fix available

Description

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.

Source: OX vulnerability database

Severity

5.5 · MEDIUM

CVSS 3.1 base score, scored by NVD.

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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

Weakness: CWE-770

Affected packages · 0

No registry package. This ID affects operating system packages only.

Operating systems · 136 fixes

Azure Linux 1 release · 1 package

fixed 1
kernel
Azure Linux fixes for CVE-2024-41009
ReleasePackageFixed in
3.0 kernel 0:6.6.43.1-7.azl3

Oracle Linux 2 releases · 3 packages

fixed 5
kernel bpftool kernel-uek
Oracle Linux fixes for CVE-2024-41009
ReleasePackageFixed in
8 kernel +18 4.18.0-553.27.1.el8_10
8 bpftool +13 5.15.0-302.167.6.el8uek
9 kernel +28 5.14.0-503.15.1.el9_5
9 kernel-uek +12 5.15.0-302.167.6.el9uek
9 bpftool 7.4.0-503.15.1.el9_5

Photon OS 2 releases · 1 package

fixed 2
bpftool
Photon OS fixes for CVE-2024-41009
ReleasePackageFixed in
4.0 bpftool +10 5.10.223-1.ph4
5.0 bpftool +10 6.1.97-1.ph5

Red Hat 3 releases · 3 packages

eol 1 fixed 11 wont fix 1
bpftool kernel-rt kernel
Red Hat fixes for CVE-2024-41009
ReleasePackageFixed inAdvisory
7 bpftool +25 eol —
8 bpftool +21 0:4.18.0-372.123.1.el8_6 RHSA-2024:6753
8 bpftool +22 0:4.18.0-477.81.1.el8_8 RHSA-2024:10262
8 bpftool +22 0:4.18.0-553.27.1.el8_10 RHSA-2024:8856
8 kernel-rt +11 0:4.18.0-553.27.1.rt7.368.el8_10 RHSA-2024:8870
9 kernel-rt +20 wont fix —

7 more rows

SUSE Linux Enterprise 3 releases · 11 packages

fixed 17
kernel-livepatch-5-14-21-150400-24-133-default kernel-docs cluster-md-kmp-default kernel-default-base kernel-livepatch-5-14-21-150500-13-64-rt kernel-livepatch-5-14-21-150500-55-73-default +5
SUSE Linux Enterprise fixes for CVE-2024-41009
ReleasePackageFixed inAdvisory
15.4 kernel-livepatch-5-14-21-150400-24-133-default 1-150400.9.3.2 SUSE-SU-2024:3408-1
15.4 kernel-docs +1 5.14.21-150400.24.133.1 SUSE-SU-2024:3408-1
15.4 cluster-md-kmp-default +15 5.14.21-150400.24.133.2 SUSE-SU-2024:3408-1
15.4 kernel-default-base 5.14.21-150400.24.133.2.150400.24.64.5 SUSE-SU-2024:3408-1
15.5 kernel-livepatch-5-14-21-150500-13-64-rt 1-150500.11.3.1 SUSE-SU-2024:2894-1
15.5 kernel-livepatch-5-14-21-150500-55-73-default 1-150500.11.3.1 SUSE-SU-2024:2939-1

11 more rows

SUSE Linux Enterprise Micro 6 releases · 6 packages

fixed 20
kernel-rt kernel-default kernel-default-base kernel-livepatch-6-4-0-19-default kernel-livepatch-6-4-0-10-rt kernel-devel-rt
SUSE Linux Enterprise Micro fixes for CVE-2024-41009
ReleasePackageFixed inAdvisory
5.1 kernel-rt +1 5.3.18-150300.181.2 SUSE-SU-2024:3225-1
5.1 kernel-default 5.3.18-150300.59.174.1 SUSE-SU-2024:3249-1
5.1 kernel-default-base 5.3.18-150300.59.174.1.150300.18.103.1 SUSE-SU-2024:3249-1
5.2 kernel-rt +1 5.3.18-150300.181.2 SUSE-SU-2024:3225-1
5.2 kernel-default 5.3.18-150300.59.174.1 SUSE-SU-2024:3249-1
5.2 kernel-default-base 5.3.18-150300.59.174.1.150300.18.103.1 SUSE-SU-2024:3249-1

14 more rows

alma 2 releases · 3 packages

fixed 4
bpftool kernel-rt kernel
alma fixes for CVE-2024-41009
ReleasePackageFixed in
8 bpftool +19 4.18.0-553.27.1.el8_10
8 kernel-rt +9 4.18.0-553.27.1.rt7.368.el8_10
9 kernel +40 5.14.0-503.15.1.el9_5
9 bpftool 7.4.0-503.15.1.el9_5

amazon linux 1 release · 2 packages

fixed 2
kernel-livepatch-6-1-97-104-177 bpftool
amazon linux fixes for CVE-2024-41009
ReleasePackageFixed in
2023 kernel-livepatch-6-1-97-104-177 1.0-0.amzn2023
2023 bpftool +19 6.1.97-104.177.amzn2023

debian 4 releases · 2 packages

fixed 5
linux linux-6-1
debian fixes for CVE-2024-41009
ReleasePackageFixed in
11 linux 5.10.223-1
11 linux-6-1 6.1.119-1~deb11u1
12 linux 6.1.98-1
13 linux 6.9.8-1
14 linux 6.9.8-1

echo 1 release · 1 package

fixed 1
linux
echo fixes for CVE-2024-41009
ReleasePackageFixed in
linux 6.9.8-1

openSUSE Leap Micro 1 release · 3 packages

fixed 3
kernel-rt kernel-default kernel-default-base
openSUSE Leap Micro fixes for CVE-2024-41009
ReleasePackageFixed inAdvisory
5.5 kernel-rt 5.14.21-150500.13.64.1 SUSE-SU-2024:2894-1
5.5 kernel-default 5.14.21-150500.55.73.1 SUSE-SU-2024:2939-1
5.5 kernel-default-base 5.14.21-150500.55.73.1.150500.6.33.8 SUSE-SU-2024:2939-1

rocky 1 release · 1 package

fixed 1
bpftool
rocky fixes for CVE-2024-41009
ReleasePackageFixed in
8 bpftool +20 4.18.0-553.27.1.el8_10

root.io debian 3 releases · 1 package

fixed 3
rootio-linux
root.io debian fixes for CVE-2024-41009
ReleasePackageFixed in
11 rootio-linux 5.10.223-1
12 rootio-linux 6.1.98-1
13 rootio-linux 6.9.8-1

root.io ubuntu 2 releases · 1 package

fixed 2
rootio-linux
root.io ubuntu fixes for CVE-2024-41009
ReleasePackageFixed in
22.04 rootio-linux 5.15.0-122.132
24.04 rootio-linux 6.8.0-45.45

ubuntu 4 releases · 40 packages

fixed 57
linux-nvidia-tegra-5-15 linux-gkeop-5-15 linux-ibm-5-15 linux-intel-iotg-5-15 linux-riscv-5-15 linux-oracle-5-15 +34
ubuntu fixes for CVE-2024-41009
ReleasePackageFixed in
20.04 linux-nvidia-tegra-5-15 5.15.0-1030.30~20.04.1
20.04 linux-gkeop-5-15 5.15.0-1053.60~20.04.1
20.04 linux-ibm-5-15 5.15.0-1063.66~20.04.1
20.04 linux-intel-iotg-5-15 5.15.0-1065.71~20.04.1
20.04 linux-riscv-5-15 5.15.0-1066.70~20.04.1
20.04 linux-oracle-5-15 5.15.0-1068.74~20.04.1

51 more rows

References

Show all 109 references

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.