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.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon Linux Ami 2 | — | Upgrade kernelUpgrade kernel-develUpgrade kernel-tools-debuginfoUpgrade kernel-tools-develUpgrade kernel-headersUpgrade python-perf-debuginfoUpgrade perfUpgrade kernel-debuginfoUpgrade bpftoolUpgrade kernel-debuginfo-common-aarch64Upgrade python-perfUpgrade perf-debuginfoUpgrade kernel-toolsUpgrade kernel-livepatch-5.15.191-132.213Upgrade kernel-debuginfo-common-x86_64Upgrade bpftool-debuginfo | May 20, 2026 | May 20, 2026 |
| Amazon_linux_2023 | — | Upgrade kernel-debuginfoUpgrade kernel-libbpf-develUpgrade kernelUpgrade kernel-headersUpgrade kernel-tools-develUpgrade kernel-modules-extraUpgrade kernel-tools-debuginfoUpgrade kernel-develUpgrade kernel-libbpfUpgrade kernel-libbpf-staticUpgrade python3-perfUpgrade kernel-debuginfo-common-x86_64Upgrade python3-perf-debuginfoUpgrade perf-debuginfoUpgrade kernel-debuginfo-common-aarch64Upgrade bpftool-debuginfoUpgrade kernel-toolsUpgrade kernel-livepatch-6.1.127-135.201Upgrade perfUpgrade kernel-modules-extra-commonUpgrade bpftool | 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-6.8.0-1010-gkeopUpgrade linux-image-gcpUpgrade linux-image-oracleUpgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-oem-24.04Upgrade linux-image-6.8.0-1026-nvidia-64kUpgrade linux-image-6.8.0-1023-gkeUpgrade linux-image-6.8.0-1024-oracleUpgrade linux-image-6.8.0-1027-azureUpgrade linux-image-6.8.0-1028-raspiUpgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-6.8.0-1026-nvidia-lowlatencyUpgrade linux-image-gcp-lts-24.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-6.11.0-1009-gcpUpgrade linux-image-6.8.0-1014-azure-nvidiaUpgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-virtualUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-6.11.0-1010-lowlatency-64kUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1024-oracle-64kUpgrade linux-image-aws-lts-24.04Upgrade linux-image-kvmUpgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-oem-24.04bUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-6.11.0-1005-realtimeUpgrade linux-image-oem-22.04dUpgrade linux-image-awsUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-oem-22.04bUpgrade linux-image-6.8.0-2023-raspi-realtimeUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-realtimeUpgrade linux-image-raspi-realtimeUpgrade linux-image-6.8.0-1027-awsUpgrade linux-image-gkeUpgrade linux-image-6.11.0-1011-oracle-64kUpgrade linux-image-nvidia-6.8Upgrade linux-image-oem-22.04aUpgrade linux-image-oem-22.04Upgrade linux-image-oracle-64kUpgrade linux-image-6.11.0-1009-azureUpgrade linux-image-oracle-lts-24.04Upgrade linux-image-6.8.0-58-lowlatency-64kUpgrade linux-image-gkeop-6.8Upgrade linux-image-azure-fdeUpgrade linux-image-nvidia-64kUpgrade linux-image-6.11.0-18-genericUpgrade linux-image-6.8.0-58-genericUpgrade linux-image-gcp-64kUpgrade linux-image-6.8.0-1026-nvidiaUpgrade linux-image-6.11.0-1008-raspiUpgrade linux-image-generic-64kUpgrade linux-image-6.8.0-58-generic-64kUpgrade linux-image-raspiUpgrade linux-image-virtual-hwe-22.04Upgrade linux-image-generic-lpaeUpgrade linux-image-ibmUpgrade linux-image-6.8.0-58-lowlatencyUpgrade linux-image-6.11.0-1009-azure-fdeUpgrade linux-image-ibm-classicUpgrade linux-image-azure-lts-24.04Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-6.11.0-18-generic-64kUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-6.11.0-1015-oemUpgrade linux-image-oem-24.04aUpgrade linux-image-nvidia-lowlatencyUpgrade linux-image-6.8.1-1020-realtimeUpgrade linux-image-nvidiaUpgrade linux-image-azure-nvidiaUpgrade linux-image-6.8.0-1024-ibmUpgrade linux-image-6.8.0-1026-nvidia-lowlatency-64kUpgrade linux-image-6.11.0-1009-awsUpgrade linux-image-6.8.0-1028-gcp-64kUpgrade linux-image-6.8.0-1026-oemUpgrade linux-image-genericUpgrade linux-image-lowlatency-64kUpgrade linux-image-oem-22.04cUpgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-6.8.0-1028-gcpUpgrade linux-image-azureUpgrade linux-image-6.8.0-1027-azure-fdeUpgrade linux-image-6.11.0-1011-oracleUpgrade linux-image-lowlatencyUpgrade linux-image-6.11.0-1010-lowlatencyUpgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-gkeop | 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 |
Prioritise 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