Vulnerability · Published Oct 28, 2025 · Assigned by Linux
CVE-2025-40079riscv, bpf: Sign extend struct ops return values properly
High 7.8
In plain English
A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: riscv, bpf: Sign extend struct ops return values properly The ns_bpf_qdisc selftest triggers a kernel panic: Unable to handle kernel paging request at virtual address ffffffffa38dbf58 Current test_progs pgtable: 4K pagesize, 57-bit VAs, pgdp=0x00000001109cc000 [ffffffffa38dbf58] pgd=000000011fffd801, p4d=000000011fffd401, pud=000000011fffd001, pmd=0000000000000000 Oops [#1] Modules linked in: bpf_testmod(OE) xt_conntrack nls_iso8859_1 [...] [last unloaded: bpf_testmod(OE)] CPU: 1 UID: 0 PID: 23584 Comm: test_progs Tainted: G W OE 6.17.0-rc1-g2465bb83e0b4 #1 NONE Tainted: [W]=WARN, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Hardware name: Unknown Unknown Product/Unknown Product, BIOS 2024.01+dfsg-1ubuntu5.1 01/01/2024 epc : __qdisc_run+0x82/0x6f0 ra : __qdisc_run+0x6e/0x6f0 epc : ffffffff80bd5c7a ra : ffffffff80bd5c66 sp : ff2000000eecb550 gp : ffffffff82472098 tp : ff60000096895940 t0 : ffffffff8001f180 t1 : ffffffff801e1664 t2 : 0000000000000000 s0 : ff2000000eecb5d0 s1 : ff60000093a6a600 a0 : ffffffffa38dbee8 a1 : 0000000000000001 a2 : ff2000000eecb510 a3 : 0000000000000001 a4 : 0000000000000000 a5 : 0000000000000010 a6 : 0000000000000000 a7 : 0000000000735049 s2 : ffffffffa38dbee8 s3 : 0000000000000040 s4 : ff6000008bcda000 s5 : 0000000000000008 s6 : ff60000093a6a680 s7 : ff60000093a6a6f0 s8 : ff60000093a6a6ac s9 : ff60000093140000 s10: 0000000000000000 s11: ff2000000eecb9d0 t3 : 0000000000000000 t4 : 0000000000ff0000 t5 : 0000000000000000 t6 : ff60000093a6a8b6 status: 0000000200000120 badaddr: ffffffffa38dbf58 cause: 000000000000000d [<ffffffff80bd5c7a>] __qdisc_run+0x82/0x6f0 [<ffffffff80b6fe58>] __dev_queue_xmit+0x4c0/0x1128 [<ffffffff80b80ae0>] neigh_resolve_output+0xd0/0x170 [<ffffffff80d2daf6>] ip6_finish_output2+0x226/0x6c8 [<ffffffff80d31254>] ip6_finish_output+0x10c/0x2a0 [<ffffffff80d31446>] ip6_output+0x5e/0x178 [<ffffffff80d2e232>] ip6_xmit+0x29a/0x608 [<ffffffff80d6f4c6>] inet6_csk_xmit+0xe6/0x140 [<ffffffff80c985e4>] __tcp_transmit_skb+0x45c/0xaa8 [<ffffffff80c995fe>] tcp_connect+0x9ce/0xd10 [<ffffffff80d66524>] tcp_v6_connect+0x4ac/0x5e8 [<ffffffff80cc19b8>] __inet_stream_connect+0xd8/0x318 [<ffffffff80cc1c36>] inet_stream_connect+0x3e/0x68 [<ffffffff80b42b20>] __sys_connect_file+0x50/0x88 [<ffffffff80b42bee>] __sys_connect+0x96/0xc8 [<ffffffff80b42c40>] __riscv_sys_connect+0x20/0x30 [<ffffffff80e5bcae>] do_trap_ecall_u+0x256/0x378 [<ffffffff80e69af2>] handle_exception+0x14a/0x156 Code: 892a 0363 1205 489c 8bc1 c7e5 2d03 084a 2703 080a (2783) 0709 ---[ end trace 0000000000000000 ]--- The bpf_fifo_dequeue prog returns a skb which is a pointer. The pointer is treated as a 32bit value and sign extend to 64bit in epilogue. This behavior is right for most bpf prog types but wrong for struct ops which requires RISC-V ABI. So let's sign extend struct ops return values according to the function model and RISC-V ABI([0]). [0]: https://riscv.org/wp-content/uploads/2024/12/riscv-calling.pdf
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.12.57-1 | DEBIAN-CVE-2025-40079 |
| Debian:14 | linux | 6.17.6-1 | DEBIAN-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux | 6.8.0-106.106 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux | 6.17.0-14.14 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1050.53 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-aws | 6.17.0-1007.7 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-aws-6.17 | 6.17.0-1007.7~24.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1050.53~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1051.57 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-azure | 6.17.0-1008.8 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1051.57~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-fde | 6.8.0-1058.65 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.8 | 6.8.0-1058.65~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1052.55 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-gcp | 6.17.0-1007.7 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gcp-6.17 | 6.17.0-1008.8~24.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1052.55~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1048.53 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1035.38 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-hwe-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-106.106~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1049.49 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1049.49~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-106.106.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-106.106.1~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1049.52 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-nvidia-6.17 | 6.17.0-1008.8 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1049.52~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1049.52.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1020.20 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oem-6.17 | 6.17.0-1011.11 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1047.48 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-oracle | 6.17.0-1007.7 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-oracle-6.17 | 6.17.0-1007.7~24.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1047.48~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1050.54 | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-raspi | 6.17.0-1008.8 | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-realtime | 6.17.0-1006.7 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:25.10 | linux-riscv | 6.17.0-14.14.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-106.106~22.04.1 | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2025-40079 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1028.29 | UBUNTU-CVE-2025-40079 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 25ad10658dc1068a671553ff10e19a812c2a3783 – before 92751937f12a7d34ad492577a251c94a55e97e7225ad10658dc1068a671553ff10e19a812c2a3783 – before 918a399501e28e0cc36dbd1fcfb4208f8aa1e4d125ad10658dc1068a671553ff10e19a812c2a3783 – before fd2e08128944a7679e753f920e9eda72057e427c |
| Linux | Linux | 6.6 |