mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE
In the Linux kernel, the following vulnerability has been resolved: mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE With CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using kmap_local_page(), which requires unmapping in Last-In-First-Out order. The current code maps dst_pte first, then src_pte, but unmaps them in the same order (dst_pte, src_pte), violating the LIFO requirement. This causes the warning in kunmap_local_indexed(): WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c addr \!= __fix_to_virt(FIX_KMAP_BEGIN + idx) Fix this by reversing the unmap order to respect LIFO ordering. This issue follows the same pattern as similar fixes: - commit eca6828403b8 ("crypto: skcipher - fix mismatch between mapping and unmapping order") - commit 8cf57c6df818 ("nilfs2: eliminate staggered calls to kunmap in nilfs_rename") Both of which addressed the same fundamental requirement that kmap_local operations must follow LIFO ordering.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.46, 6.16.6
- CVEs
- CVE-2025-39899
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 22:43 UTC · Revision 1
Source evidence
mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE
core-osv · Original sourcePublished 1 Oct 2025, 07:42 UTC
In the Linux kernel, the following vulnerability has been resolved: mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE With CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using kmap_local_page(), which requires unmapping in Last-In-First-Out order. The current code maps dst_pte first, then src_pte, but unmaps them in the same order (dst_pte, src_pte), violating the LIFO requirement. This causes the warning in kunmap_local_indexed(): WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c addr \!= __fix_to_virt(FIX_KMAP_BEGIN + idx) Fix this by reversing the unmap order to respect LIFO ordering. This issue follows the same pattern as similar fixes: - commit eca6828403b8 ("crypto: skcipher - fix mismatch between mapping and unmapping order") - commit 8cf57c6df818 ("nilfs2: eliminate staggered calls to kunmap in nilfs_rename") Both of which addressed the same fundamental requirement that kmap_local operations must follow LIFO ordering.
osv:CVE-2025-39899
Kernel
Fixed versions: 6.12.46, 6.16.6
Complete source record
{
"id": "cb78d5b6b4457373b6134b13876c6c04b0755f3580561da1a6f650dc96d10eb4",
"url": "https://osv.dev/vulnerability/CVE-2025-39899",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE",
"summary": "In the Linux kernel, the following vulnerability has been resolved: mm/userfaultfd: fix kmap_local LIFO ordering for CONFIG_HIGHPTE With CONFIG_HIGHPTE on 32-bit ARM, move_pages_pte() maps PTE pages using kmap_local_page(), which requires unmapping in Last-In-First-Out order. The current code maps dst_pte first, then src_pte, but unmaps them in the same order (dst_pte, src_pte), violating the LIFO requirement. This causes the warning in kunmap_local_indexed(): WARNING: CPU: 0 PID: 604 at mm/highmem.c:622 kunmap_local_indexed+0x178/0x17c addr \\!= __fix_to_virt(FIX_KMAP_BEGIN + idx) Fix this by reversing the unmap order to respect LIFO ordering. This issue follows the same pattern as similar fixes: - commit eca6828403b8 (\"crypto: skcipher - fix mismatch between mapping and unmapping order\") - commit 8cf57c6df818 (\"nilfs2: eliminate staggered calls to kunmap in nilfs_rename\") Both of which addressed the same fundamental requirement that kmap_local operations must follow LIFO ordering.",
"evidence": "osv:CVE-2025-39899",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.12.46",
"evidence": "/affected/1/ranges"
},
{
"value": "6.16.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2025-39899",
"aliases": [
"CVE-2025-39899"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "adef440691bab824e39c1b17382322d195e1fab0"
},
{
"fixed": "b051f707018967ea8f697d790a1ed8c443f63812"
},
{
"fixed": "bd1ee62759d0bd4d6b909731c076c230ac89d61e"
},
{
"fixed": "9614d8bee66387501f48718fa306e17f2aa3f2f3"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39899.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.8.0"
},
{
"fixed": "6.12.46"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.16.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39899.json"
}
}
],
"modified": "2026-10-28T02:30:23.967068046Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/9614d8bee66387501f48718fa306e17f2aa3f2f3",
"https://git.kernel.org/stable/c/b051f707018967ea8f697d790a1ed8c443f63812",
"https://git.kernel.org/stable/c/bd1ee62759d0bd4d6b909731c076c230ac89d61e",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39899.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-39899",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39899.json"
}
},
"related_cves": [
{
"value": "CVE-2025-39899",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 490646,
"published_at": "2025-10-01T07:42:47.1+00:00"
}