# CVE-2026-139657: mm/gup: honour FOLL\_PIN in NOMMU \_\_get\_user\_pages\_locked()

- **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)
- **Published:** 2026-11-30T13:36:46.794Z
- **Modified:** 2026-12-01T06:17:47.293Z

## Who should check

- Anyone running Linux \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< d557cd126601a73a8756b0b18e1aadfb702df67b; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 47f5b21856845382e6e0f4b74e6f93165e1f49bc; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< da01399b90a73cd00b502f7903fa5acbfac4a103
- Anyone running Linux 5.7

## Description

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

mm/gup: honour FOLL\_PIN in NOMMU \_\_get\_user\_pages\_locked()

The !CONFIG\_MMU implementation of \_\_get\_user\_pages\_locked() takes a bare
get\_page() reference for each page regardless of foll\_flags:
	if (pages\[i\])
		get\_page(pages\[i\]);

This is reached from pin\_user\_pages\*() with FOLL\_PIN set.
unpin\_user\_page() is shared between MMU and NOMMU configurations and
unconditionally calls gup\_put\_folio(..., FOLL\_PIN), which subtracts
GUP\_PIN\_COUNTING\_BIAS (1024) from the folio refcount.

This means that pin adds 1, and then unpin will subtract 1024.

If a user maps a page (refcount 1), registers it 1023 times as an
io\_uring fixed buffer (1023 pin\_user\_pages calls -\> refcount 1024), then
unregisters: the first unpin\_user\_page subtracts 1024, refcount hits 0,
the page is freed and returned to the buddy allocator.  The remaining
1022 unpins write into whatever was reallocated, and the user's VMA
still maps the freed page (NOMMU has no MMU to invalidate it).
Reallocating the page for an io\_uring pbuf\_ring then lets userspace
corrupt the new owner's data through the stale mapping.

Use try\_grab\_folio() which adds GUP\_PIN\_COUNTING\_BIAS for FOLL\_PIN and 1
for FOLL\_GET, mirroring the CONFIG\_MMU path so pin and unpin are
symmetric. Keep supporting the traditional behavior where users specify
a pages array but don't set FOLL\_GET.

While at it, don't return NULL pointers in the page array,
as this is really not expected for GUP users; instead, just fail and return
-EFAULT.

\[ david: support traditional behavior with no FOLL\_GET, extend
  description \]

## Affected and fixed versions

- Linux: \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< d557cd126601a73a8756b0b18e1aadfb702df67b; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 47f5b21856845382e6e0f4b74e6f93165e1f49bc; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< da01399b90a73cd00b502f7903fa5acbfac4a103 (cvelist)
- Linux: 5.7 (cvelist)

## Technologies

Linux kernel

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-139657.md
Affected: Linux >= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, < d557cd126601a73a8756b0b18e1aadfb702df67b; >= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, < 47f5b21856845382e6e0f4b74e6f93165e1f49bc; >= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, < 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4; >= 3faa52c03f440d1b9ddef18…
Fixed in: Linux 47f5b21856845382e6e0f4b74e6f93165e1f49bc, Linux 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4

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-2026-139657 being exploited?

There is no confirmed exploitation: CVE-2026-139657 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-139657?

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

### Which versions are affected by CVE-2026-139657?

Linux \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< d557cd126601a73a8756b0b18e1aadfb702df67b; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 47f5b21856845382e6e0f4b74e6f93165e1f49bc; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4; \>= 3faa52c03f440d1b9ddef18c4f189f4790d52d7e, \< da01399b90a73cd00b502f7903fa5acbfac4a103; Linux 5.7.

### Is there a fix for CVE-2026-139657?

Yes. Fixed in Linux 47f5b21856845382e6e0f4b74e6f93165e1f49bc, Linux 4dc46f3c9a44bd1a6ab41d7626abb0992283afb4. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-139657?

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/d557cd126601a73a8756b0b18e1aadfb702df67b>
- other: <https://git.kernel.org/stable/c/47f5b21856845382e6e0f4b74e6f93165e1f49bc>
- other: <https://git.kernel.org/stable/c/4dc46f3c9a44bd1a6ab41d7626abb0992283afb4>
- other: <https://git.kernel.org/stable/c/da01399b90a73cd00b502f7903fa5acbfac4a103>

## 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-2026-139657>

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