CVE-2026-139657: mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()

Published Nov 30, 2026
·
Updated

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

mm/gup: honour FOLLPIN in NOMMU getuserpageslocked()

The !CONFIGMMU implementation of getuserpageslocked() takes a bare getpage() reference for each page regardless of follflags: if (pages[i]) getpage(pages[i]);

This is reached from pinuserpages() with FOLLPIN set. unpinuserpage() is shared between MMU and NOMMU configurations and unconditionally calls gupputfolio(..., FOLLPIN), which subtracts GUPPINCOUNTINGBIAS (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 iouring fixed buffer (1023 pinuserpages calls -> refcount 1024), then unregisters: the first unpinuserpage 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 iouring pbufring then lets userspace corrupt the new owner's data through the stale mapping.

Use trygrabfolio() which adds GUPPINCOUNTINGBIAS for FOLLPIN and 1 for FOLLGET, mirroring the CONFIGMMU path so pin and unpin are symmetric. Keep supporting the traditional behavior where users specify a pages array but don't set FOLLGET.

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 FOLLGET, extend description ]

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:36 PM
Data Sourced
via MITRE·01:36 PM
Description

Frequently Asked Questions

1

Which systems are exposed to this issue?

The affected path is the !CONFIG_MMU implementation of __get_user_pages_locked(), so exposure is limited to Linux kernel builds without MMU support. The described exploitation sequence also uses io_uring fixed-buffer registration and an io_uring pbuf_ring allocation.

2

What conditions are needed to trigger the memory corruption?

A user needs to map a page, register it 1023 times as an io_uring fixed buffer, and then unregister those buffers. After the first unpin frees the page, reallocating it for an io_uring pbuf_ring can allow writes through the still-mapped stale page to corrupt the new owner's data.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203