{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139657","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.946Z","datePublished":"2026-11-30T13:36:46.794Z","dateUpdated":"2026-12-01T05:43:02.584Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-01T05:43:02.584Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()\n\nThe !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare\nget_page() reference for each page regardless of foll_flags:\n\tif (pages[i])\n\t\tget_page(pages[i]);\n\nThis is reached from pin_user_pages*() with FOLL_PIN set.\nunpin_user_page() is shared between MMU and NOMMU configurations and\nunconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts\nGUP_PIN_COUNTING_BIAS (1024) from the folio refcount.\n\nThis means that pin adds 1, and then unpin will subtract 1024.\n\nIf a user maps a page (refcount 1), registers it 1023 times as an\nio_uring fixed buffer (1023 pin_user_pages calls -> refcount 1024), then\nunregisters: the first unpin_user_page subtracts 1024, refcount hits 0,\nthe page is freed and returned to the buddy allocator.  The remaining\n1022 unpins write into whatever was reallocated, and the user's VMA\nstill maps the freed page (NOMMU has no MMU to invalidate it).\nReallocating the page for an io_uring pbuf_ring then lets userspace\ncorrupt the new owner's data through the stale mapping.\n\nUse try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1\nfor FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are\nsymmetric. Keep supporting the traditional behavior where users specify\na pages array but don't set FOLL_GET.\n\nWhile at it, don't return NULL pointers in the page array,\nas this is really not expected for GUP users; instead, just fail and return\n-EFAULT.\n\n[ david: support traditional behavior with no FOLL_GET, extend\n  description ]"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Reached by io_uring_register(IORING_REGISTER_BUFFERS) → io_sqe_buffer_register() → io_pin_pages() → pin_user_pages_fast() → gup_fast_fallback() → __gup_longterm_locked() → the NOMMU __get_user_pages_locked() the fix patched. The pinned page and the iovecs are the caller's own memory, and no remote protocol supplies them.\nAC:L - On CONFIG_MMU=n (forced by CPU_V7M and RISCV_M_MODE), do_mmap_private() gives anonymous memory as order-0 alloc_pages_exact() pages with refcount 1. 1023 iovecs on one page raise it to 1024 (+1 each via get_page), and replacing one slot with IORING_REGISTER_BUFFERS_UPDATE unpins it by 1024 to zero. That is deterministic and fits the 8 MiB RLIMIT_MEMLOCK.\nPR:L - io_uring_setup()/io_uring_register() need no capability (io_uring_disabled defaults to 0). Without CAP_IPC_LOCK, io_buffer_account_pin() only charges 1023 order-0 pages against the user's RLIMIT_MEMLOCK, so any local unprivileged user qualifies.\nUI:N - The attacker maps, registers and replaces buffers in their own process. No other user mounts, opens or runs anything.\nS:U - The freed page comes back from the kernel's own buddy allocator and goes to kernel owners within the same authority. No hypervisor or IOMMU boundary is crossed.\nC:H - After the free, the other 1022 slots keep imu->bvec pointing at the page. IORING_OP_WRITE_FIXED via io_import_reg_buf() copies whatever kernel object reallocated it out to an attacker-readable file, an unbounded page-sized read.\nI:H - IORING_OP_READ_FIXED writes attacker file data into the reallocated page through those stale bvecs. Each remaining unpin_user_folio() subtracts 1024 from the new owner's refcount, and free_page_series() at munmap drops another ref. That lets the attacker free kernel-owned pages early, a page-level UAF write primitive.\nA:H - The refcount underflow on reallocated pages and the double free via free_page_series() corrupt buddy-allocator state and oops or panic the kernel. Even benign pinned I/O (io_uring fixed buffers, O_DIRECT bio_release_pages) drives the refcount negative and leaks the page permanently."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/gup.c"],"versions":[{"version":"3faa52c03f440d1b9ddef18c4f189f4790d52d7e","lessThan":"d557cd126601a73a8756b0b18e1aadfb702df67b","status":"affected","versionType":"git"},{"version":"3faa52c03f440d1b9ddef18c4f189f4790d52d7e","lessThan":"47f5b21856845382e6e0f4b74e6f93165e1f49bc","status":"affected","versionType":"git"},{"version":"3faa52c03f440d1b9ddef18c4f189f4790d52d7e","lessThan":"4dc46f3c9a44bd1a6ab41d7626abb0992283afb4","status":"affected","versionType":"git"},{"version":"3faa52c03f440d1b9ddef18c4f189f4790d52d7e","lessThan":"da01399b90a73cd00b502f7903fa5acbfac4a103","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/gup.c"],"versions":[{"version":"5.7","status":"affected"},{"version":"0","lessThan":"5.7","status":"unaffected","versionType":"semver"},{"version":"6.12.120","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.65","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.7","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/d557cd126601a73a8756b0b18e1aadfb702df67b"},{"url":"https://git.kernel.org/stable/c/47f5b21856845382e6e0f4b74e6f93165e1f49bc"},{"url":"https://git.kernel.org/stable/c/4dc46f3c9a44bd1a6ab41d7626abb0992283afb4"},{"url":"https://git.kernel.org/stable/c/da01399b90a73cd00b502f7903fa5acbfac4a103"}],"title":"mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()","x_generator":{"engine":"bippy-1.2.0"}}}}