In the Linux kernel, the following vulnerability has been resolved:
bpf: Detect IP == ksym.end as part of BPF program
Now that bpf_throw kfunc is the first such call instruction that has noreturn semantics within the verifier, this also kicks in dead code elimination in unprecedented ways. For one, any instruction following a bpf_throw call will never be marked as seen. Moreover, if a callchain ends up throwing, any instructions after the call instruction to the eventually throwing subprog in callers will also never be marked as seen.
The tempting way to fix this would be to emit extra 'int3' instructions which bump the jited_len of a program, and ensure that during runtime when a program throws, we can discover its boundaries even if the call instruction to bpf_throw (or to subprogs that always throw) is emitted as the final instruction in the program.
An example of such a program would be this:
do_something(): ... r0 = 0 exit
foo(): r1 = 0 call bpf_throw r0 = 0 exit
bar(cond): if r1 != 0 goto pc+2 call do_something exit call foo r0 = 0 // Never seen by verifier exit //
main(ctx): r1 = ... call bar r0 = 0 exit
Here, if we do end up throwing, the stacktrace would be the following:
bpf_throw foo bar main
In bar, the final instruction emitted will be the call to foo, as such, the return address will be the subsequent instruction (which the JIT emits as int3 on x86). This will end up lying outside the jited_len of the program, thus, when unwinding, we will fail to discover the return address as belonging to any program and end up in a panic due to the unreliable stack unwinding of BPF programs that we never expect.
To remedy this case, make bpf_prog_ksym_find treat IP == ksym.end as part of the BPF program, so that is_bpf_text_address returns true when such a case occurs, and we are able to unwind reliably when the final instruction ends up being a call instruction.
CVSS Details
- CVSS 3.1 Base Score: 5.5
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon Linux Ami 2 | — | Upgrade kernel-headersUpgrade kernel-livepatch-5.10.205-195.804Upgrade kernel-debuginfo-common-x86_64Upgrade python-perfUpgrade bpftool-debuginfoUpgrade python-perf-debuginfoUpgrade kernelUpgrade kernel-debuginfo-common-aarch64Upgrade bpftoolUpgrade kernel-debuginfoUpgrade kernel-develUpgrade kernel-tools-debuginfoUpgrade kernel-toolsUpgrade perf-debuginfoUpgrade perfUpgrade kernel-tools-develUpgrade kernel-livepatch-5.15.145-95.156 | Dec 12, 2024 | May 21, 2024 |
| Amazon_linux_2023 | — | Upgrade kernel-libbpf-staticUpgrade kernelUpgrade bpftoolUpgrade kernel-libbpfUpgrade kernel-modules-extraUpgrade python3-perf-debuginfoUpgrade kernel-libbpf-develUpgrade kernel-debuginfoUpgrade kernel-debuginfo-common-x86_64Upgrade bpftool-debuginfoUpgrade kernel-livepatch-6.1.66-91.160Upgrade kernel-tools-debuginfoUpgrade kernel-toolsUpgrade python3-perfUpgrade kernel-develUpgrade kernel-debuginfo-common-aarch64Upgrade perf-debuginfoUpgrade kernel-tools-develUpgrade perfUpgrade kernel-headers | Feb 17, 2025 | May 21, 2024 |
| Debian | — | Upgrade linux | Jul 30, 2024 | May 21, 2024 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | May 21, 2024 |
| Ubuntu | — | Upgrade linuxUpgrade linux-nvidia-tegraUpgrade linux-riscv-5.15Upgrade linux-nvidia-tegra-igxUpgrade linux-gkeUpgrade linux-intel-iot-realtimeUpgrade linux-gcpUpgrade linux-nvidia-tegra-5.15Upgrade linux-aws-5.15Upgrade linux-awsUpgrade linux-ibm-5.15Upgrade linux-fipsUpgrade linux-realtimeUpgrade linux-intel-iotgUpgrade linux-lowlatencyUpgrade linux-gkeopUpgrade linux-gcp-5.15Upgrade linux-kvmUpgrade linux-bluefieldUpgrade linux-oracleUpgrade linux-hwe-5.15Upgrade linux-nvidia-6.5Upgrade linux-nvidiaUpgrade linux-azure-fdeUpgrade linux-intel-iotg-5.15Upgrade linux-azure-fde-5.15Upgrade linux-oracle-5.15Upgrade linux-gkeop-5.15Upgrade linux-ibmUpgrade linux-aws-fipsUpgrade linux-raspiUpgrade linux-lowlatency-hwe-5.15Upgrade linux-azure-5.15Upgrade linux-azureUpgrade linux-xilinx-zynqmpUpgrade linux-gcp-fips | Nov 19, 2024 | May 21, 2024 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Jan 20, 2025 | May 21, 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