In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix overloading of MEM_UNINIT's meaning
Lonial reported an issue in the BPF verifier where check_mem_size_reg() has the following code:
if (!tnum_is_const(reg->var_off)) /* For unprivileged variable accesses, disable raw * mode so that the program is required to * initialize all the memory that the helper could * just partially fill up. */ meta = NULL;
This means that writes are not checked when the register containing the size of the passed buffer has not a fixed size. Through this bug, a BPF program can write to a map which is marked as read-only, for example, .rodata global maps.
The problem is that MEM_UNINIT's initial meaning that "the passed buffer to the BPF helper does not need to be initialized" which was added back in commit 435faee1aae9 ("bpf, verifier: add ARG_PTR_TO_RAW_STACK type") got overloaded over time with "the passed buffer is being written to".
The problem however is that checks such as the above which were added later via 06c1c049721a ("bpf: allow helpers access to variable memory") set meta to NULL in order force the user to always initialize the passed buffer to the helper. Due to the current double meaning of MEM_UNINIT, this bypasses verifier write checks to the memory (not boundary checks though) and only assumes the latter memory is read instead.
Fix this by reverting MEM_UNINIT back to its original meaning, and having MEM_WRITE as an annotation to BPF helpers in order to then trigger the BPF verifier checks for writing to memory.
Some notes: check_arg_pair_ok() ensures that for ARG_CONST_SIZE{,_OR_ZERO} we can access fn->arg_type[arg - 1] since it must contain a preceding ARG_PTR_TO_MEM. For check_mem_reg() the meta argument can be removed altogether since we do check both BPF_READ and BPF_WRITE. Same for the equivalent check_kfunc_mem_size_reg().
CVSS Details
- CVSS 3.1 Base Score: 7.1
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon Linux Ami 2 | — | Upgrade kernel-debuginfo-common-x86_64Upgrade kernel-livepatch-5.15.191-132.213Upgrade kernel-toolsUpgrade bpftool-debuginfoUpgrade perf-debuginfoUpgrade python-perfUpgrade kernel-debuginfo-common-aarch64Upgrade python-perf-debuginfoUpgrade kernel-develUpgrade kernel-debuginfoUpgrade perfUpgrade kernelUpgrade kernel-headersUpgrade kernel-tools-debuginfoUpgrade bpftoolUpgrade kernel-tools-devel | May 20, 2026 | May 20, 2026 |
| Amazon_linux_2023 | — | Upgrade perf-debuginfoUpgrade bpftoolUpgrade perfUpgrade kernel-livepatch-6.1.127-135.201Upgrade kernel-modules-extra-commonUpgrade kernel-debuginfo-common-aarch64Upgrade kernel-toolsUpgrade python3-perf-debuginfoUpgrade bpftool-debuginfoUpgrade kernel-tools-develUpgrade kernel-debuginfoUpgrade python3-perfUpgrade kernel-libbpf-develUpgrade kernel-libbpf-staticUpgrade kernelUpgrade kernel-develUpgrade kernel-libbpfUpgrade kernel-tools-debuginfoUpgrade kernel-headersUpgrade kernel-debuginfo-common-x86_64Upgrade kernel-modules-extra | Feb 17, 2025 | Nov 7, 2024 |
| Debian | — | Upgrade linuxUpgrade linux-6.1 | Feb 10, 2025 | Nov 7, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Nov 7, 2024 |
| Ubuntu | — | Upgrade linux-image-oem-22.04dUpgrade linux-image-realtimeUpgrade linux-image-aws-lts-24.04Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-6.8.0-1028-raspiUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-gcpUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-6.8.0-1027-azureUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-oem-24.04Upgrade linux-image-generic-hwe-22.04Upgrade linux-image-virtualUpgrade linux-image-6.11.0-1005-realtimeUpgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-oem-24.04bUpgrade linux-image-6.8.0-1014-azure-nvidiaUpgrade linux-image-6.11.0-1010-lowlatency-64kUpgrade linux-image-6.8.0-1027-awsUpgrade linux-image-6.8.0-1026-nvidia-64kUpgrade linux-image-6.8.0-2023-raspi-realtimeUpgrade linux-image-raspi-realtimeUpgrade linux-image-kvmUpgrade linux-image-gkeUpgrade linux-image-awsUpgrade linux-image-6.8.0-1026-nvidia-lowlatencyUpgrade linux-image-oracleUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-6.8.0-1023-gkeUpgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-gcp-lts-24.04Upgrade linux-image-6.8.0-1024-oracle-64kUpgrade linux-image-6.8.0-1024-oracleUpgrade linux-image-oem-22.04bUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-6.11.0-1009-gcpUpgrade linux-image-6.8.0-1010-gkeopUpgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-azureUpgrade linux-image-6.8.0-1028-gcp-64kUpgrade linux-image-6.8.0-1026-nvidiaUpgrade linux-image-nvidiaUpgrade linux-image-generic-64kUpgrade linux-image-gkeop-6.8Upgrade linux-image-6.8.0-1024-ibmUpgrade linux-image-nvidia-lowlatencyUpgrade linux-image-oem-24.04aUpgrade linux-image-genericUpgrade linux-image-6.11.0-1011-oracleUpgrade linux-image-ibmUpgrade linux-image-ibm-classicUpgrade linux-image-6.8.0-58-lowlatency-64kUpgrade linux-image-nvidia-6.8Upgrade linux-image-oem-22.04aUpgrade linux-image-6.11.0-1011-oracle-64kUpgrade linux-image-6.8.0-58-generic-64kUpgrade linux-image-6.8.0-1026-oemUpgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-azure-fdeUpgrade linux-image-6.11.0-1010-lowlatencyUpgrade linux-image-generic-lpaeUpgrade linux-image-6.8.0-58-genericUpgrade linux-image-6.8.0-1026-nvidia-lowlatency-64kUpgrade linux-image-6.11.0-1008-raspiUpgrade linux-image-gcp-64kUpgrade linux-image-6.8.0-58-lowlatencyUpgrade linux-image-raspiUpgrade linux-image-6.11.0-1009-awsUpgrade linux-image-virtual-hwe-22.04Upgrade linux-image-azure-nvidiaUpgrade linux-image-lowlatencyUpgrade linux-image-6.8.0-1028-gcpUpgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-6.8.0-1027-azure-fdeUpgrade linux-image-lowlatency-64kUpgrade linux-image-oem-22.04cUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-6.11.0-18-generic-64kUpgrade linux-image-6.11.0-1009-azure-fdeUpgrade linux-image-6.11.0-1015-oemUpgrade linux-image-6.11.0-18-genericUpgrade linux-image-oem-22.04Upgrade linux-image-oracle-64kUpgrade linux-image-oracle-lts-24.04Upgrade linux-image-6.11.0-1009-azureUpgrade linux-image-nvidia-64kUpgrade linux-image-azure-lts-24.04Upgrade linux-image-gkeopUpgrade linux-image-6.8.1-1020-realtime | Feb 20, 2025 | Nov 7, 2024 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Jul 2, 2025 | Nov 7, 2024 |
Prioritize with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub