CVE-2025-39776: mm/debug_vm_pgtable: clear page table entries at destroy_args()

Published Sep 11, 2025
·
Updated

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

mm/debugvmpgtable: clear page table entries at destroyargs()

The mm/debugvmpagetable test allocates manually page table entries for the tests it runs, using also its manually allocated mmstruct. That in itself is ok, but when it exits, at destroyargs() it fails to clear those entries with the clear functions.

The problem is that leaves stale entries. If another process allocates an mmstruct with a pgd at the same address, it may end up running into the stale entry. This is happening in practice on a debug kernel with CONFIGDEBUGVMPGTABLE=y, for example this is the output with some extra debugging I added (it prints a warning trace if pgtablesbytes goes negative, in addition to the warning at checkmm() function):

[ 2.539353] debugvmpgtable: [getrandomvaddr ]: randomvaddr is 0x7ea247140000 [ 2.539366] kmemcache info [ 2.539374] kmemcachep 0x000000002ce82385 - freelist 0x0000000000000000 - offset 0x508 [ 2.539447] debugvmpgtable: [initargs ]: args->mm is 0x000000002267cc9e (...) [ 2.552800] WARNING: CPU: 5 PID: 116 at include/linux/mm.h:2841 freepudrange+0x8bc/0x8d0 [ 2.552816] Modules linked in: [ 2.552843] CPU: 5 UID: 0 PID: 116 Comm: modprobe Not tainted 6.12.0-105.debugvm2.el10.ppc64le+debug #1 VOLUNTARY [ 2.552859] Hardware name: IBM,9009-41A POWER9 (architected) 0x4e0202 0xf000005 of:IBM,FW910.00 (VL910062) hv:phyp pSeries [ 2.552872] NIP: c0000000007eef3c LR: c0000000007eef30 CTR: c0000000003d8c90 [ 2.552885] REGS: c0000000622e73b0 TRAP: 0700 Not tainted (6.12.0-105.debugvm2.el10.ppc64le+debug) [ 2.552899] MSR: 800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> CR: 24002822 XER: 0000000a [ 2.552954] CFAR: c0000000008f03f0 IRQMASK: 0 [ 2.552954] GPR00: c0000000007eef30 c0000000622e7650 c000000002b1ac00 0000000000000001 [ 2.552954] GPR04: 0000000000000008 0000000000000000 c0000000007eef30 ffffffffffffffff [ 2.552954] GPR08: 00000000ffff00f5 0000000000000001 0000000000000048 0000000000004000 [ 2.552954] GPR12: 00000003fa440000 c000000017ffa300 c0000000051d9f80 ffffffffffffffdb [ 2.552954] GPR16: 0000000000000000 0000000000000008 000000000000000a 60000000000000e0 [ 2.552954] GPR20: 4080000000000000 c0000000113af038 00007fffcf130000 0000700000000000 [ 2.552954] GPR24: c000000062a6a000 0000000000000001 8000000062a68000 0000000000000001 [ 2.552954] GPR28: 000000000000000a c000000062ebc600 0000000000002000 c000000062ebc760 [ 2.553170] NIP [c0000000007eef3c] freepudrange+0x8bc/0x8d0 [ 2.553185] LR [c0000000007eef30] freepudrange+0x8b0/0x8d0 [ 2.553199] Call Trace: [ 2.553207] [c0000000622e7650] [c0000000007eef30] freepudrange+0x8b0/0x8d0 (unreliable) [ 2.553229] [c0000000622e7750] [c0000000007f40b4] freepgdrange+0x284/0x3b0 [ 2.553248] [c0000000622e7800] [c0000000007f4630] freepgtables+0x450/0x570 [ 2.553274] [c0000000622e78e0] [c0000000008161c0] exitmmap+0x250/0x650 [ 2.553292] [c0000000622e7a30] [c0000000001b95b8] mmput+0x98/0x290 [ 2.558344] [c0000000622e7a80] [c0000000001d1018] exitmm+0x118/0x1b0 [ 2.558361] [c0000000622e7ac0] [c0000000001d141c] doexit+0x2ec/0x870 [ 2.558376] [c0000000622e7b60] [c0000000001d1ca8] dogroupexit+0x88/0x150 [ 2.558391] [c0000000622e7bb0] [c0000000001d1db8] sysexitgroup+0x48/0x50 [ 2.558407] [c0000000622e7be0] [c00000000003d810] systemcallexception+0x1e0/0x4c0 [ 2.558423] [c0000000622e7e50] [c00000000000d05c] systemcallvectoredcommon+0x15c/0x2ec (...) [ 2.558892] ---[ end trace 0000000000000000 ]--- [ 2.559022] BUG: Bad rss-counter state mm:000000002267cc9e type:MMANONPAGES val:1 [ 2.559037] BUG: non-zero pgtablesbytes on freeing mm: -6144

Here the modprobe process ended up with an allocated mmstruct from the mmstruct slab that was used before by the debugvmpgtable test. That is not a problem, since the mmstru ---truncated---

Affected Software

11 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.96.2-2
Linux Linux kernel>=5.15<5.15.190
Linux Linux kernel>=5.16<6.1.149
Linux Linux kernel>=6.2<6.6.103
Linux Linux kernel>=6.7<6.12.44
Linux Linux kernel>=6.13<6.16.4
Linux Linux kernel=6.17-rc1
Linux Linux kernel=6.17-rc2
Debian Debian Linux=11.0
Microsoft cbl2 kernel 5.15.186.1-1

Event History

Sep 11, 2025
CVE Published
via MITRE·04:56 PM
Data Sourced
via MITRE·04:56 PM
DescriptionSeverity
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 13, 2025
Data Sourced
via Microsoft·01:04 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-39776?

CVE-2025-39776 is classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-39776?

To fix CVE-2025-39776, you should update to the latest stable version of the Linux kernel that contains the patched code.

3

What impact does CVE-2025-39776 have on affected systems?

CVE-2025-39776 may lead to potential memory corruption issues due to improper handling of page table entries.

4

Which versions of the Linux kernel are affected by CVE-2025-39776?

CVE-2025-39776 affects specific versions of the Linux kernel; it is recommended to check the kernel release notes for details.

5

Is CVE-2025-39776 actively being exploited?

As of now, there is no public knowledge indicating that CVE-2025-39776 is being actively exploited in the wild.

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