CVE-2026-63950: mm/rmap: initialize nr_pages to 1 at loop start in try_to_unmap_one

Published Jul 19, 2026
·
Updated

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

mm/rmap: initialize nrpages to 1 at loop start in trytounmapone

Initialize nrpages to 1 at the start of each loop iteration, like folioreferencedone() does.

Without this, nrpages computed by a previous foliounmapptebatch() call can be reused on a later iteration that does not run foliounmapptebatch() again.

mmap a 64K large folio with MAPANONYMOUS | MAPDROPPABLE, then call madvise(MADVFREE), then make the last page device-exclusive via HMMDMIRROREXCLUSIVE.

Trigger node reclaim through sysfs. Now, in trytounmapone(), we will first clear the first 15 out of 16 entries mapping the lazyfree folio. This will set nrpages to 15. In the next pvmw walk, this nrpages gets reused on a device-exclusive pte, thus potentially corrupting folio refcount/mapcount.

At the moment, I have a userspace program which can make the kernel spit out a trace, but the blow up is in folioreferencedone(), because there are existing bugs in the interaction between device-private and rmap (which too I am investigating). I did a one liner kernel change to avoid going into folioreferencedone(), and the kernel blows up at folioremovermapptes in trytounmapone which is what I wanted.

Note that the bug is there not since file folio batching but lazyfree folio batching, since device-exclusive only works for anonymous folios.

Userspace visible effect is simply kernel crashing somewhere due to refcount/mapcount corruption.

Affected Software

12 affected componentsFixes available
Linux Kernel
Linux Linux kernel>=6.15<6.18.35
Linux Linux kernel>=6.19<7.0.12
Linux Linux kernel=7.1-rc1
Linux Linux kernel=7.1-rc2
Linux Linux kernel=7.1-rc3
Linux Linux kernel=7.1-rc4
Linux Linux kernel=7.1-rc5
debian/linux<7.0.12-1
7.0.12-1
linux/kernel>=6.15.0<6.18.35
6.18.35
linux/kernel>=6.19.0<7.0.12
7.0.12
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Event History

Jul 19, 2026
CVE Published
via MITRE·02:55 PM
Data Sourced
via MITRE·02:55 PM
DescriptionSeverity
Data Sourced
via OSV·02:55 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:17 PM
RemedyDescriptionSeverityWeaknessAffected Software

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