# CVE-2025-21852: net: Add rx\_skb of kfree\_skb to raw\_tp\_null\_args\[\].

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-03-12T09:42:07.175Z
- **Modified:** 2026-06-17T08:44:26.773Z

## Who should check

- Anyone running Linux \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< f579afacd0a66971fc8481f30d2d377e230a8342; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 4dba79c1e7aad6620bbb707b6c4459380fd90860; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 5da7e15fb5a12e78de974d8908f348e279922ce9
- Anyone running Linux 6.11

## 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 and fixed versions

- Linux: \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< f579afacd0a66971fc8481f30d2d377e230a8342; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 4dba79c1e7aad6620bbb707b6c4459380fd90860; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 5da7e15fb5a12e78de974d8908f348e279922ce9 (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- Upgrade Linux to 5da7e15fb5a12e78de974d8908f348e279922ce9 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-21852. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21852.md
Affected: Linux >= c53795d48ee8f385c6a9e394651e7ee914baaeba, < f579afacd0a66971fc8481f30d2d377e230a8342; >= c53795d48ee8f385c6a9e394651e7ee914baaeba, < 4dba79c1e7aad6620bbb707b6c4459380fd90860; >= c53795d48ee8f385c6a9e394651e7ee914baaeba, < 5da7e15fb5a12e78de974d8908f348e279922ce9; Linux 6.11
Fixed in: Linux 4dba79c1e7aad6620bbb707b6c4459380fd90860, Linux 5da7e15fb5a12e78de974d8908f348e279922ce9

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-21852 being exploited?

There is no confirmed exploitation: CVE-2025-21852 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-21852?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-21852?

Linux \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< f579afacd0a66971fc8481f30d2d377e230a8342; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 4dba79c1e7aad6620bbb707b6c4459380fd90860; \>= c53795d48ee8f385c6a9e394651e7ee914baaeba, \< 5da7e15fb5a12e78de974d8908f348e279922ce9; Linux 6.11.

### Is there a fix for CVE-2025-21852?

Yes. Fixed in Linux 4dba79c1e7aad6620bbb707b6c4459380fd90860, Linux 5da7e15fb5a12e78de974d8908f348e279922ce9. Upgrade Linux to 5da7e15fb5a12e78de974d8908f348e279922ce9 or later.

### How do I check if I'm affected by CVE-2025-21852?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f579afacd0a66971fc8481f30d2d377e230a8342>
- patch: <https://git.kernel.org/stable/c/4dba79c1e7aad6620bbb707b6c4459380fd90860>
- patch: <https://git.kernel.org/stable/c/5da7e15fb5a12e78de974d8908f348e279922ce9>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-21852>

HTML: <https://flawdb.com/CVE-2025-21852> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-21852>
