Skip to content
OpenAdvisories
Medium · 5.5 CVE-2025-21852 EUVD-2025-6395GHSA-g33r-c4mc-9962

net: Add rx_skb of kfree_skb to raw_tp_null_args[].

Published Mar 12, 2025 · Updated May 11, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.8 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-azure Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.8 Package: linux-azure-6.11 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.2 Package: linux-gcp Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.8 Package: linux-gcp-6.11 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.8 Package: linux-hwe-6.11 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.11 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-nvidia-6.11 Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.11 Package: linux-oem-6.5 Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.8 Package: linux-oracle-6.5 Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.5 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

Description

In the Linux kernel, the following vulnerability has been resolved:

net: Add rx_skb of kfree_skb to raw_tp_null_args[].

Yan Zhai reported a BPF prog could trigger a null-ptr-deref [0]
in trace_kfree_skb if the prog does not check if rx_sk is NULL.

Commit c53795d48ee8 ("net: add rx_sk to trace_kfree_skb") added
rx_sk to trace_kfree_skb, but rx_sk is optional and could be NULL.

Let's add kfree_skb to raw_tp_null_args[] to let the BPF verifier
validate such a prog and prevent the issue.

Now we fail to load such a prog:

libbpf: prog 'drop': -- BEGIN PROG LOAD LOG --
0: R1=ctx() R10=fp0
; int BPF_PROG(drop, struct sk_buff *skb, void *location, @ kfree_skb_sk_null.bpf.c:21
0: (79) r3 = *(u64 *)(r1 +24)
func 'kfree_skb' arg3 has btf_id 5253 type STRUCT 'sock'
1: R1=ctx() R3_w=trusted_ptr_or_null_sock(id=1)
; bpf_printk("sk: %d, %d\n", sk, sk->__sk_common.skc_family); @ kfree_skb_sk_null.bpf.c:24
1: (69) r4 = *(u16 *)(r3 +16)
R3 invalid mem access 'trusted_ptr_or_null_'
processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --

Note this fix requires commit 838a10bd2ebf ("bpf: Augment raw_tp
arguments with PTR_MAYBE_NULL").

[0]:
BUG: kernel NULL pointer dereference, address: 0000000000000010
PF: supervisor read access in kernel mode
PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
PREEMPT SMP
RIP: 0010:bpf_prog_5e21a6db8fcff1aa_drop+0x10/0x2d
Call Trace:
<TASK>
? __die+0x1f/0x60
? page_fault_oops+0x148/0x420
? search_bpf_extables+0x5b/0x70
? fixup_exception+0x27/0x2c0
? exc_page_fault+0x75/0x170
? asm_exc_page_fault+0x22/0x30
? bpf_prog_5e21a6db8fcff1aa_drop+0x10/0x2d
bpf_trace_run4+0x68/0xd0
? unix_stream_connect+0x1f4/0x6f0
sk_skb_reason_drop+0x90/0x120
unix_stream_connect+0x1f4/0x6f0
__sys_connect+0x7f/0xb0
__x64_sys_connect+0x14/0x20
do_syscall_64+0x47/0xc30
entry_SYSCALL_64_after_hwframe+0x4b/0x53

Affected products

VendorProductAffectedFixed
Linux Linux 6.11 6.12.17

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 6.12.17-1 —
Debian 13 linux 6.12.17-1 —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS linux-gcp-6.11 +1 6.11.0-1015.15~24.04.1 USN-7521-1
Ubuntu 24.04 LTS linux-hwe-6.11 6.11.0-26.26~24.04.1 USN-7521-1
Ubuntu 24.04 LTS linux-lowlatency-hwe-6.11 6.11.0-1014.15~24.04.1 USN-7521-3
Ubuntu 24.04 LTS linux-nvidia-6.11 6.11.0-1010.10 —
Ubuntu 24.04 LTS linux-oem-6.11 6.11.0-1022.22 USN-7521-1
Ubuntu 24.04 LTS linux-realtime +1 No fix yet —
Ubuntu 22.04 LTS linux-riscv +32 No fix yet —
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP7 kernel-64kb +6 6.4.0-150700.53.3.1 SUSE-SU-2025:01951-1
SLES 15 SP7 kernel-azure +2 6.4.0-150700.20.3.1 SUSE-SU-2025:01967-1
SLES 15 SP7 kernel-default-base 6.4.0-150700.53.3.1.150700.17.2.1 SUSE-SU-2025:01951-1
SLES 15 SP6 kernel-64kb +6 6.4.0-150600.23.50.1 SUSE-SU-2025:01614-1
SLES 15 SP6 kernel-azure +2 6.4.0-150600.8.37.1 SUSE-SU-2025:01707-1
SLES 15 SP6 kernel-coco +3 6.4.0-15061.21.coco15sp6.1 SUSE-SU-2025:01919-1
SLES 15 SP6 kernel-default-base 6.4.0-150600.23.50.1.150600.12.22.1 SUSE-SU-2025:01614-1
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.1 kernel-default-base 6.4.0-29.1.21.7 SUSE-SU-2025:20354-1
SLE Micro 6.1 kernel-livepatch-MICRO-6-0_Update_7 +1 1-1.2 SUSE-SU-2025:20355-1, SUSE-SU-2025:20354-1
SLE Micro 6.1 kernel-rt +1 6.4.0-31.1 SUSE-SU-2025:20355-1
SLE Micro 6.1 kernel-source +2 6.4.0-29.1 SUSE-SU-2025:20354-1
SLE Micro 6.0 kernel-default-base 6.4.0-29.1.21.7 SUSE-SU-2025:20343-1
SLE Micro 6.0 kernel-livepatch-MICRO-6-0_Update_7 +1 1-1.2 SUSE-SU-2025:20344-1, SUSE-SU-2025:20343-1
SLE Micro 6.0 kernel-rt +1 6.4.0-31.1 SUSE-SU-2025:20344-1
SLE Micro 6.0 kernel-source +2 6.4.0-29.1 SUSE-SU-2025:20343-1
SLE Live Patching 15 SP7 kernel-default 6.4.0-150700.53.3.1 SUSE-SU-2025:01951-1
SLE Live Patching 15 SP7 kernel-livepatch-SLE15-SP7-RT_Update_1 1-150700.1.3.1 SUSE-SU-2025:01972-1
SLE Live Patching 15 SP7 kernel-livepatch-SLE15-SP7_Update_1 1-150700.15.3.1 SUSE-SU-2025:01951-1
SLE Live Patching 15 SP6 kernel-default 6.4.0-150600.23.50.1 SUSE-SU-2025:01614-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_11 1-150600.1.3.2 SUSE-SU-2025:01964-1
SLE Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_11 1-150600.13.3.1 SUSE-SU-2025:01614-1
SUSE Real Time Module 15 SP7 kernel-rt +3 6.4.0-150700.7.3.1 SUSE-SU-2025:01972-1
SUSE Real Time Module 15 SP6 kernel-rt +3 6.4.0-150600.10.39.1 SUSE-SU-2025:01964-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 dtb-aarch64 +10 6.4.0-150600.23.50.1 SUSE-SU-2025:01614-1
openSUSE Leap 15.6 kernel-azure +2 6.4.0-150600.8.37.1 SUSE-SU-2025:01707-1
openSUSE Leap 15.6 kernel-default-base 6.4.0-150600.23.50.1.150600.12.22.1 SUSE-SU-2025:01614-1
openSUSE Leap 15.6 kernel-rt +3 6.4.0-150600.10.39.1 SUSE-SU-2025:01964-1

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 kernel-uek +34 6.12.0-101.33.4.3.el10uek ELSA-2025-20530, ELSA-2025-20480

Advisories 16

References