CVE-2025-39793
published high CVSS 3.1 · 7.8io_uring/memmap: cast nr_pages to size_t before shifting
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux087f997870a948820ec366701d178f402c6a23a3 to < c6a2706e08b8a1b2d3740161c0977d38e596c1ee · 087f997870a948820ec366701d178f402c6a23a3 to < a69a9b53c54e2d33e2a5b1ea4a9a71fd01c6cf3a · 087f997870a948820ec366701d178f402c6a23a3 to < 33503c083fda048c77903460ac0429e1e2c0e341 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.14 (affected) · 0 to < 6.14 (unaffected · semver) · 6.15.11 through 6.15.* (unaffected · semver) · 6.16.2 through 6.16.* (unaffected · semver) · 6.17 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: io_uring/memmap: cast nr_pages to size_t before shifting If the allocated size exceeds UINT_MAX, then it's necessary to cast the mr->nr_pages value to size_t to prevent it from overflowing. In practice this isn't much of a concern as the required memory size will have been validated upfront, and accounted to the user. And > 4GB sizes will be necessary to make the lack of a cast a problem, which greatly exceeds normal user locked_vm settings that are generally in the kb to mb range. However, if root is used, then accounting isn't done, and then it's possible to hit this issue.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The bug is reached purely through local syscalls — `io_uring_setup()` followed by `io_uring_register(IORING_REGISTER_MEM_REGION)` with an attacker-chosen `io_uring_region_desc.size`. Per kernel guidance, io_uring is a local attack vector. AC:L - This is a deterministic integer truncation fully controlled by the attacker's chosen region size (any value ≥ 4 GB with a small remainder); there is no race, no memory-layout dependency, and no condition outside the attacker's control. The only environmental factor is RLIMIT_MEMLOCK/CAP_IPC_LOCK, which is a target configuration rather than a probabilistic exploitation condition. PR:L - `io_uring_setup` and `IORING_REGISTER_MEM_REGION` require no capability at all under the default `kernel.io_uring_disabled=0`; the only gate is the `RLIMIT_MEMLOCK` counter check, which no actual memory allocation must satisfy since the allocation itself is truncated. On the many real deployments where non-root users have memlock unlimited (container runtimes, RDMA/OFED and DPDK hosts, HPC nodes, database service accounts), an ordinary unprivileged local user reaches this directly; with real root (`CAP_IPC_LOCK` in init_user_ns) accounting is skipped entirely. UI:N - The attacker performs the entire sequence — ring setup, region registration, and mmap of the param region — within their own process. No victim action is involved. S:U - The corruption and its consequences are contained within the kernel's own security authority on the same host; no VM, IOMMU, or hypervisor boundary is crossed. C:H - The truncation causes `mr->pages[]` to be populated with `struct page` pointers spanning ~4 GB of unrelated physical memory, which is then `vmap()`ed into the kernel and mmap-able into userspace via `io_region_mmap()`/`vm_insert_pages()`. This yields direct read access to arbitrary physical memory belonging to other processes and the kernel. I:H - The same foreign pages are inserted into a writable user VMA and aliased writable in the kernel vmap, giving an arbitrary physical-memory write primitive (e.g. modifying cached setuid binary text or kernel data), and `insert_page_into_pte_locked()` performs `folio_get()`/rmap accounting on folios the region never owned, corrupting refcounts into a use-after-free. This is straightforwardly leveraged into privilege escalation. A:H - `io_check_coalesce_buffer()` dereferences ~1M out-of-range `struct page` pointers, oopsing whenever the walk crosses unpopulated vmemmap, and the resulting refcount corruption/UAF on in-use pages causes kernel panics. Any local user able to trigger it can crash the machine repeatedly.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 087f997870a948820ec366701d178f402c6a23a3 to < c6a2706e08b8a1b2d3740161c0977d38e596c1ee (affected · git)087f997870a948820ec366701d178f402c6a23a3 to < a69a9b53c54e2d33e2a5b1ea4a9a71fd01c6cf3a (affected · git)087f997870a948820ec366701d178f402c6a23a3 to < 33503c083fda048c77903460ac0429e1e2c0e341 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.14 (affected)0 to < 6.14 (unaffected · semver)6.15.11 through 6.15.* (unaffected · semver)6.16.2 through 6.16.* (unaffected · semver)6.17 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
3Provider assertions
1Linux · cna
io_uring/memmap: cast nr_pages to size_t before shifting
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- a4b729771f67e9db9c54f7cba6c83d3c20aa9e0d48c0cd2d3a461d961ac6c2e2
- Ingested
- 23 Sep 2026, 08:47:06 UTC
- Source record
- Official CVE record