# CVE-2025-38640: bpf: Disable migration in nf\_hook\_run\_bpf().

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.28% (percentile 13, 2026-11-26)
- **Published:** 2025-08-22T16:00:46.760Z
- **Modified:** 2026-10-15T22:18:47.880Z

## Who should check

- Anyone running Linux \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< ee2502485702e4398cd74dbfb288bfa111d25e62; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 62f6175d145e00fc999fd2fcbffad3f59253c66a; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< e0199c28167a8a4adec036005a8df268b2b68529; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 0a356da16fb933abbeeb7aea038c351f3342cd3f; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 17ce3e5949bc37557305ad46316f41c7875d6366
- Anyone running Linux 6.4

## Description

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

bpf: Disable migration in nf\_hook\_run\_bpf().

syzbot reported that the netfilter bpf prog can be called without
migration disabled in xmit path.

Then the assertion in \_\_bpf\_prog\_run() fails, triggering the splat
below. \[0\]

Let's use bpf\_prog\_run\_pin\_on\_cpu() in nf\_hook\_run\_bpf().

\[0\]:
BUG: assuming non migratable context at ./include/linux/filter.h:703
in\_atomic(): 0, irqs\_disabled(): 0, migration\_disabled() 0 pid: 5829, name: sshd-session
3 locks held by sshd-session/5829:
 \#0: ffff88807b4e4218 (sk\_lock-AF\_INET){+.+.}-{0:0}, at: lock\_sock include/net/sock.h:1667 \[inline\]
 \#0: ffff88807b4e4218 (sk\_lock-AF\_INET){+.+.}-{0:0}, at: tcp\_sendmsg+0x20/0x50 net/ipv4/tcp.c:1395
 \#1: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: rcu\_lock\_acquire include/linux/rcupdate.h:331 \[inline\]
 \#1: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: rcu\_read\_lock include/linux/rcupdate.h:841 \[inline\]
 \#1: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: \_\_ip\_queue\_xmit+0x69/0x26c0 net/ipv4/ip\_output.c:470
 \#2: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: rcu\_lock\_acquire include/linux/rcupdate.h:331 \[inline\]
 \#2: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: rcu\_read\_lock include/linux/rcupdate.h:841 \[inline\]
 \#2: ffffffff8e5c4e00 (rcu\_read\_lock){....}-{1:3}, at: nf\_hook+0xb2/0x680 include/linux/netfilter.h:241
CPU: 0 UID: 0 PID: 5829 Comm: sshd-session Not tainted 6.16.0-rc6-syzkaller-00002-g155a3c003e55 \#0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:94 \[inline\]
 dump\_stack\_lvl+0x16c/0x1f0 lib/dump\_stack.c:120
 \_\_cant\_migrate kernel/sched/core.c:8860 \[inline\]
 \_\_cant\_migrate+0x1c7/0x250 kernel/sched/core.c:8834
 \_\_bpf\_prog\_run include/linux/filter.h:703 \[inline\]
 bpf\_prog\_run include/linux/filter.h:725 \[inline\]
 nf\_hook\_run\_bpf+0x83/0x1e0 net/netfilter/nf\_bpf\_link.c:20
 nf\_hook\_entry\_hookfn include/linux/netfilter.h:157 \[inline\]
 nf\_hook\_slow+0xbb/0x200 net/netfilter/core.c:623
 nf\_hook+0x370/0x680 include/linux/netfilter.h:272
 NF\_HOOK\_COND include/linux/netfilter.h:305 \[inline\]
 ip\_output+0x1bc/0x2a0 net/ipv4/ip\_output.c:433
 dst\_output include/net/dst.h:459 \[inline\]
 ip\_local\_out net/ipv4/ip\_output.c:129 \[inline\]
 \_\_ip\_queue\_xmit+0x1d7d/0x26c0 net/ipv4/ip\_output.c:527
 \_\_tcp\_transmit\_skb+0x2686/0x3e90 net/ipv4/tcp\_output.c:1479
 tcp\_transmit\_skb net/ipv4/tcp\_output.c:1497 \[inline\]
 tcp\_write\_xmit+0x1274/0x84e0 net/ipv4/tcp\_output.c:2838
 \_\_tcp\_push\_pending\_frames+0xaf/0x390 net/ipv4/tcp\_output.c:3021
 tcp\_push+0x225/0x700 net/ipv4/tcp.c:759
 tcp\_sendmsg\_locked+0x1870/0x42b0 net/ipv4/tcp.c:1359
 tcp\_sendmsg+0x2e/0x50 net/ipv4/tcp.c:1396
 inet\_sendmsg+0xb9/0x140 net/ipv4/af\_inet.c:851
 sock\_sendmsg\_nosec net/socket.c:712 \[inline\]
 \_\_sock\_sendmsg net/socket.c:727 \[inline\]
 sock\_write\_iter+0x4aa/0x5b0 net/socket.c:1131
 new\_sync\_write fs/read\_write.c:593 \[inline\]
 vfs\_write+0x6c7/0x1150 fs/read\_write.c:686
 ksys\_write+0x1f8/0x250 fs/read\_write.c:738
 do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
 do\_syscall\_64+0xcd/0x4c0 arch/x86/entry/syscall\_64.c:94
 entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7fe7d365d407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 \<5b\> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP:

## Affected and fixed versions

- Linux: \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< ee2502485702e4398cd74dbfb288bfa111d25e62; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 62f6175d145e00fc999fd2fcbffad3f59253c66a; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< e0199c28167a8a4adec036005a8df268b2b68529; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 0a356da16fb933abbeeb7aea038c351f3342cd3f; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 17ce3e5949bc37557305ad46316f41c7875d6366 (cvelist)
- Linux: 6.4 (cvelist)

## Mitigation

- Upgrade Linux to 17ce3e5949bc37557305ad46316f41c7875d6366 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-38640. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38640.md
Affected: Linux >= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, < ee2502485702e4398cd74dbfb288bfa111d25e62; >= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, < 62f6175d145e00fc999fd2fcbffad3f59253c66a; >= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, < e0199c28167a8a4adec036005a8df268b2b68529; >= fd9c663b9ad67dedfc9a3fd…
Fixed in: Linux 62f6175d145e00fc999fd2fcbffad3f59253c66a, Linux 0a356da16fb933abbeeb7aea038c351f3342cd3f, Linux 17ce3e5949bc37557305ad46316f41c7875d6366

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-38640 being exploited?

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

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

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

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

Linux \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< ee2502485702e4398cd74dbfb288bfa111d25e62; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 62f6175d145e00fc999fd2fcbffad3f59253c66a; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< e0199c28167a8a4adec036005a8df268b2b68529; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 0a356da16fb933abbeeb7aea038c351f3342cd3f; \>= fd9c663b9ad67dedfc9a3fd3429ddd3e83782b4d, \< 17ce3e5949bc37557305ad46316f41c7875d6366; Linux 6.4.

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

Yes. Fixed in Linux 62f6175d145e00fc999fd2fcbffad3f59253c66a, Linux 0a356da16fb933abbeeb7aea038c351f3342cd3f, Linux 17ce3e5949bc37557305ad46316f41c7875d6366. Upgrade Linux to 17ce3e5949bc37557305ad46316f41c7875d6366 or later.

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

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/ee2502485702e4398cd74dbfb288bfa111d25e62>
- patch: <https://git.kernel.org/stable/c/62f6175d145e00fc999fd2fcbffad3f59253c66a>
- patch: <https://git.kernel.org/stable/c/e0199c28167a8a4adec036005a8df268b2b68529>
- patch: <https://git.kernel.org/stable/c/0a356da16fb933abbeeb7aea038c351f3342cd3f>
- patch: <https://git.kernel.org/stable/c/17ce3e5949bc37557305ad46316f41c7875d6366>

## 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-38640>

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