# CVE-2025-40178: pid: Add a judgment for ns null in pid\_nr\_ns

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-11-12T21:56:24.051Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 75dbc029c5359438be4a6f908bfbfdab969af776; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c2d09d724856b6f82ab688f65fc1ce833bb56333; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c3b654021931dc806ba086c549e8756c3f204a67; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< e10c36a771c5cc910abd9fe4aa9033ee32a47c38; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 09d227c59d97efda7d5cc878a4335a6b2bb224c2; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 2076b916bf41be48799d1443df0f8fc75d12ccd0; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< a0212978af1825b37da0b453b94d9b0e5af11478; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7
- Anyone running Linux 3.8

## Description

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

pid: Add a judgment for ns null in pid\_nr\_ns

\_\_task\_pid\_nr\_ns
        ns = task\_active\_pid\_ns(current);
        pid\_nr\_ns(rcu\_dereference(\*task\_pid\_ptr(task, type)), ns);
                if (pid && ns-\>level \<= pid-\>level) {

Sometimes null is returned for task\_active\_pid\_ns. Then it will trigger kernel panic in pid\_nr\_ns.

For example:
	Unable to handle kernel NULL pointer dereference at virtual address 0000000000000058
	Mem abort info:
	ESR = 0x0000000096000007
	EC = 0x25: DABT (current EL), IL = 32 bits
	SET = 0, FnV = 0
	EA = 0, S1PTW = 0
	FSC = 0x07: level 3 translation fault
	Data abort info:
	ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
	CM = 0, WnR = 0, TnD = 0, TagAccess = 0
	GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
	user pgtable: 4k pages, 39-bit VAs, pgdp=00000002175aa000
	\[0000000000000058\] pgd=08000002175ab003, p4d=08000002175ab003, pud=08000002175ab003, pmd=08000002175be003, pte=0000000000000000
	pstate: 834000c5 (Nzcv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
	pc : \_\_task\_pid\_nr\_ns+0x74/0xd0
	lr : \_\_task\_pid\_nr\_ns+0x24/0xd0
	sp : ffffffc08001bd10
	x29: ffffffc08001bd10 x28: ffffffd4422b2000 x27: 0000000000000001
	x26: ffffffd442821168 x25: ffffffd442821000 x24: 00000f89492eab31
	x23: 00000000000000c0 x22: ffffff806f5693c0 x21: ffffff806f5693c0
	x20: 0000000000000001 x19: 0000000000000000 x18: 0000000000000000
	x17: 00000000529c6ef0 x16: 00000000529c6ef0 x15: 00000000023a1adc
	x14: 0000000000000003 x13: 00000000007ef6d8 x12: 001167c391c78800
	x11: 00ffffffffffffff x10: 0000000000000000 x9 : 0000000000000001
	x8 : ffffff80816fa3c0 x7 : 0000000000000000 x6 : 49534d702d535449
	x5 : ffffffc080c4c2c0 x4 : ffffffd43ee128c8 x3 : ffffffd43ee124dc
	x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffffff806f5693c0
	Call trace:
	\_\_task\_pid\_nr\_ns+0x74/0xd0
	...
	\_\_handle\_irq\_event\_percpu+0xd4/0x284
	handle\_irq\_event+0x48/0xb0
	handle\_fasteoi\_irq+0x160/0x2d8
	generic\_handle\_domain\_irq+0x44/0x60
	gic\_handle\_irq+0x4c/0x114
	call\_on\_irq\_stack+0x3c/0x74
	do\_interrupt\_handler+0x4c/0x84
	el1\_interrupt+0x34/0x58
	el1h\_64\_irq\_handler+0x18/0x24
	el1h\_64\_irq+0x68/0x6c
	account\_kernel\_stack+0x60/0x144
	exit\_task\_stack\_account+0x1c/0x80
	do\_exit+0x7e4/0xaf8
	...
	get\_signal+0x7bc/0x8d8
	do\_notify\_resume+0x128/0x828
	el0\_svc+0x6c/0x70
	el0t\_64\_sync\_handler+0x68/0xbc
	el0t\_64\_sync+0x1a8/0x1ac
	Code: 35fffe54 911a02a8 f9400108 b4000128 (b9405a69)
	---\[ end trace 0000000000000000 \]---
	Kernel panic - not syncing: Oops: Fatal exception in interrupt

## Affected and fixed versions

- Linux: \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 75dbc029c5359438be4a6f908bfbfdab969af776; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c2d09d724856b6f82ab688f65fc1ce833bb56333; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c3b654021931dc806ba086c549e8756c3f204a67; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< e10c36a771c5cc910abd9fe4aa9033ee32a47c38; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 09d227c59d97efda7d5cc878a4335a6b2bb224c2; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 2076b916bf41be48799d1443df0f8fc75d12ccd0; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< a0212978af1825b37da0b453b94d9b0e5af11478; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-40178.md
Affected: Linux >= 17cf22c33e1f1b5e435469c84e43872579497653, < 75dbc029c5359438be4a6f908bfbfdab969af776; >= 17cf22c33e1f1b5e435469c84e43872579497653, < c2d09d724856b6f82ab688f65fc1ce833bb56333; >= 17cf22c33e1f1b5e435469c84e43872579497653, < c3b654021931dc806ba086c549e8756c3f204a67; >= 17cf22c33e1f1b5e435469c…
Fixed in: Linux 75dbc029c5359438be4a6f908bfbfdab969af776, Linux 09d227c59d97efda7d5cc878a4335a6b2bb224c2, Linux 2076b916bf41be48799d1443df0f8fc75d12ccd0, Linux 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7

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

There is no confirmed exploitation: CVE-2025-40178 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-40178?

It has no CVSS score yet. Unknown.

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

Linux \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 75dbc029c5359438be4a6f908bfbfdab969af776; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c2d09d724856b6f82ab688f65fc1ce833bb56333; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< c3b654021931dc806ba086c549e8756c3f204a67; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< e10c36a771c5cc910abd9fe4aa9033ee32a47c38; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 09d227c59d97efda7d5cc878a4335a6b2bb224c2; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 2076b916bf41be48799d1443df0f8fc75d12ccd0; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< a0212978af1825b37da0b453b94d9b0e5af11478; \>= 17cf22c33e1f1b5e435469c84e43872579497653, \< 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7; Linux 3.8.

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

Yes. Fixed in Linux 75dbc029c5359438be4a6f908bfbfdab969af776, Linux 09d227c59d97efda7d5cc878a4335a6b2bb224c2, Linux 2076b916bf41be48799d1443df0f8fc75d12ccd0, Linux 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7. Upgrade Linux to 006568ab4c5ca2309ceb36fa553e390b4aa9c0c7 or later.

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

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

- other: <https://git.kernel.org/stable/c/75dbc029c5359438be4a6f908bfbfdab969af776>
- other: <https://git.kernel.org/stable/c/c2d09d724856b6f82ab688f65fc1ce833bb56333>
- other: <https://git.kernel.org/stable/c/c3b654021931dc806ba086c549e8756c3f204a67>
- other: <https://git.kernel.org/stable/c/e10c36a771c5cc910abd9fe4aa9033ee32a47c38>
- other: <https://git.kernel.org/stable/c/09d227c59d97efda7d5cc878a4335a6b2bb224c2>
- other: <https://git.kernel.org/stable/c/2076b916bf41be48799d1443df0f8fc75d12ccd0>
- other: <https://git.kernel.org/stable/c/a0212978af1825b37da0b453b94d9b0e5af11478>
- other: <https://git.kernel.org/stable/c/006568ab4c5ca2309ceb36fa553e390b4aa9c0c7>

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

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