# CVE-2025-40009: fs/proc/task\_mmu: check p-\>vec\_buf for NULL

> 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.27% (percentile 13, 2026-11-28)
- **Published:** 2025-10-20T15:26:55.208Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< ca988dcdc6683ecd9de5f525ce469588a9141c21; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< a2cb8818a3d915cd33a1e8b2babc1bb0c34862c3; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< 28aa29986dde79e8466bc87569141291053833f5
- Anyone running Linux 6.7

## Description

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

fs/proc/task\_mmu: check p-\>vec\_buf for NULL

When the PAGEMAP\_SCAN ioctl is invoked with vec\_len = 0 reaches
pagemap\_scan\_backout\_range(), kernel panics with null-ptr-deref:

\[   44.936808\] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 \[\#1\] SMP DEBUG\_PAGEALLOC KASAN NOPTI
\[   44.937797\] KASAN: null-ptr-deref in range \[0x0000000000000000-0x0000000000000007\]
\[   44.938391\] CPU: 1 UID: 0 PID: 2480 Comm: reproducer Not tainted 6.17.0-rc6 \#22 PREEMPT(none)
\[   44.939062\] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
\[   44.939935\] RIP: 0010:pagemap\_scan\_thp\_entry.isra.0+0x741/0xa80

\<snip registers, unreliable trace\>

\[   44.946828\] Call Trace:
\[   44.947030\]  \<TASK\>
\[   44.949219\]  pagemap\_scan\_pmd\_entry+0xec/0xfa0
\[   44.952593\]  walk\_pmd\_range.isra.0+0x302/0x910
\[   44.954069\]  walk\_pud\_range.isra.0+0x419/0x790
\[   44.954427\]  walk\_p4d\_range+0x41e/0x620
\[   44.954743\]  walk\_pgd\_range+0x31e/0x630
\[   44.955057\]  \_\_walk\_page\_range+0x160/0x670
\[   44.956883\]  walk\_page\_range\_mm+0x408/0x980
\[   44.958677\]  walk\_page\_range+0x66/0x90
\[   44.958984\]  do\_pagemap\_scan+0x28d/0x9c0
\[   44.961833\]  do\_pagemap\_cmd+0x59/0x80
\[   44.962484\]  \_\_x64\_sys\_ioctl+0x18d/0x210
\[   44.962804\]  do\_syscall\_64+0x5b/0x290
\[   44.963111\]  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e

vec\_len = 0 in pagemap\_scan\_init\_bounce\_buffer() means no buffers are
allocated and p-\>vec\_buf remains set to NULL.

This breaks an assumption made later in pagemap\_scan\_backout\_range(), that
page\_region is always allocated for p-\>vec\_buf\_index.

Fix it by explicitly checking p-\>vec\_buf for NULL before dereferencing.

Other sites that might run into same deref-issue are already (directly or
transitively) protected by checking p-\>vec\_buf.

Note:
From PAGEMAP\_SCAN man page, it seems vec\_len = 0 is valid when no output
is requested and it's only the side effects caller is interested in,
hence it passes check in pagemap\_scan\_get\_args().

This issue was found by syzkaller.

## Affected and fixed versions

- Linux: \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< ca988dcdc6683ecd9de5f525ce469588a9141c21; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< a2cb8818a3d915cd33a1e8b2babc1bb0c34862c3; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< 28aa29986dde79e8466bc87569141291053833f5 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-40009.md
Affected: Linux >= 52526ca7fdb905a768a93f8faa418e9b988fc34b, < ca988dcdc6683ecd9de5f525ce469588a9141c21; >= 52526ca7fdb905a768a93f8faa418e9b988fc34b, < a2cb8818a3d915cd33a1e8b2babc1bb0c34862c3; >= 52526ca7fdb905a768a93f8faa418e9b988fc34b, < 28aa29986dde79e8466bc87569141291053833f5; Linux 6.7
Fixed in: Linux 28aa29986dde79e8466bc87569141291053833f5

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

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< ca988dcdc6683ecd9de5f525ce469588a9141c21; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< a2cb8818a3d915cd33a1e8b2babc1bb0c34862c3; \>= 52526ca7fdb905a768a93f8faa418e9b988fc34b, \< 28aa29986dde79e8466bc87569141291053833f5; Linux 6.7.

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

Yes. Fixed in Linux 28aa29986dde79e8466bc87569141291053833f5. Upgrade Linux to 28aa29986dde79e8466bc87569141291053833f5 or later.

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

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/ca988dcdc6683ecd9de5f525ce469588a9141c21>
- other: <https://git.kernel.org/stable/c/a2cb8818a3d915cd33a1e8b2babc1bb0c34862c3>
- other: <https://git.kernel.org/stable/c/28aa29986dde79e8466bc87569141291053833f5>

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

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