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 kernel-debuginfoUpgrade kernel-debuginfo-common-aarch64Upgrade kernel-tools-develUpgrade bpftoolUpgrade kernel-headersUpgrade perfUpgrade python-perf-debuginfoUpgrade kernel-tools-debuginfoUpgrade kernel-develUpgrade kernelUpgrade perf-debuginfoUpgrade kernel-debuginfo-common-x86_64Upgrade kernel-livepatch-5.15.191-132.213Upgrade python-perfUpgrade bpftool-debuginfoUpgrade kernel-tools | May 20, 2026 | May 20, 2026 |
| Amazon_linux_2023 | — | Upgrade kernel-headersUpgrade kernel-debuginfo-common-x86_64Upgrade kernel-tools-debuginfoUpgrade kernel-develUpgrade kernel-modules-extraUpgrade kernel-debuginfoUpgrade kernel-tools-develUpgrade python3-perfUpgrade kernelUpgrade kernel-libbpfUpgrade kernel-libbpf-staticUpgrade kernel-libbpf-develUpgrade bpftool-debuginfoUpgrade kernel-toolsUpgrade perfUpgrade kernel-livepatch-6.1.127-135.201Upgrade bpftoolUpgrade kernel-debuginfo-common-aarch64Upgrade kernel-modules-extra-commonUpgrade perf-debuginfoUpgrade python3-perf-debuginfo | Feb 17, 2025 | Nov 7, 2024 |
| Debian | — | Upgrade linux-6.1Upgrade linux | Feb 10, 2025 | Nov 7, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Nov 7, 2024 |
| Ubuntu | — | Upgrade linux-image-6.11.0-1015-oemUpgrade linux-image-azure-lts-24.04Upgrade linux-image-6.11.0-1009-azure-fdeUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-6.8.0-58-lowlatency-64kUpgrade linux-image-nvidia-6.8Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-6.11.0-1010-lowlatencyUpgrade linux-image-6.11.0-18-generic-64kUpgrade linux-image-6.8.0-58-genericUpgrade linux-image-oem-22.04aUpgrade linux-image-6.11.0-1008-raspiUpgrade linux-image-6.11.0-1011-oracle-64kUpgrade linux-image-nvidia-64kUpgrade linux-image-azure-fdeUpgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-6.8.0-58-generic-64kUpgrade linux-image-oracle-lts-24.04Upgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-6.8.0-1027-azure-fdeUpgrade linux-image-azure-nvidiaUpgrade linux-image-oracle-64kUpgrade linux-image-genericUpgrade linux-image-lowlatency-64kUpgrade linux-image-6.11.0-1011-oracleUpgrade linux-image-nvidia-lowlatencyUpgrade linux-image-gkeopUpgrade linux-image-oem-22.04Upgrade linux-image-generic-64kUpgrade linux-image-6.8.0-1024-ibmUpgrade linux-image-6.8.0-1026-nvidia-lowlatency-64kUpgrade linux-image-6.11.0-18-genericUpgrade linux-image-azureUpgrade linux-image-6.8.1-1020-realtimeUpgrade linux-image-gkeop-6.8Upgrade linux-image-6.8.0-1026-nvidiaUpgrade linux-image-oem-24.04aUpgrade linux-image-6.8.0-1028-gcpUpgrade linux-image-lowlatencyUpgrade linux-image-oem-22.04cUpgrade linux-image-6.8.0-1026-oemUpgrade linux-image-6.11.0-1009-awsUpgrade linux-image-nvidiaUpgrade linux-image-raspiUpgrade linux-image-6.11.0-1009-azureUpgrade linux-image-ibmUpgrade linux-image-6.8.0-58-lowlatencyUpgrade linux-image-generic-lpaeUpgrade linux-image-ibm-classicUpgrade linux-image-gcp-64kUpgrade linux-image-virtual-hwe-22.04Upgrade linux-image-6.8.0-1028-gcp-64kUpgrade linux-image-6.8.0-1027-azureUpgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1028-raspiUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-gcp-lts-24.04Upgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-6.8.0-1014-azure-nvidiaUpgrade linux-image-aws-lts-24.04Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-virtualUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-ibm-lts-24.04Upgrade linux-image-nvidia-64k-6.8Upgrade linux-image-6.11.0-1005-realtimeUpgrade linux-image-oem-24.04bUpgrade linux-image-6.11.0-1009-gcpUpgrade linux-image-6.11.0-1010-lowlatency-64kUpgrade linux-image-gcpUpgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-6.8.0-1026-nvidia-lowlatencyUpgrade linux-image-oem-22.04bUpgrade linux-image-6.8.0-1010-gkeopUpgrade linux-image-realtimeUpgrade linux-image-6.8.0-1026-nvidia-64kUpgrade linux-image-kvmUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-6.8.0-2023-raspi-realtimeUpgrade linux-image-raspi-realtimeUpgrade linux-image-gkeUpgrade linux-image-6.8.0-1027-awsUpgrade linux-image-oem-22.04dUpgrade linux-image-awsUpgrade linux-image-6.8.0-1023-gkeUpgrade linux-image-oracleUpgrade linux-image-6.8.0-1024-oracle-64kUpgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-6.8.0-1024-oracleUpgrade linux-image-oem-24.04 | 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