CVE-2026-138866: mm/execmem: free ROX cache chunks only when they span an entire vm area

Published Nov 30, 2026
·
Updated

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

mm/execmem: free ROX cache chunks only when they span an entire vm area

Patch series "mm/execmem: fixes and cleanups for the ROX cache".

Sashiko review of the ROX cache refill path asked what happens when the PMDSIZE allocation fails there. Pulling that thread uncovered a bit more than the fallback.

Patch 1 fixes a real bug, although rare bug: execmemcacheclean() can free a chunk that is still partially in use, because a PMD sized and PMD aligned free range in the middle of a larger chunk looks exactly like a chunk that nobody uses.

Patch 2 handles maple tree allocation failures in the cache. They are unlikely, but silently dropping an area from the tree is not a great way to deal with them.

Patch 3 deals with the fallback that started all this. The cache exists to keep the direct map free of unnecessary splits, and the fallback happily filled it with base page mapped areas that could never be freed from the cache again. Ask vmalloc for a huge mapping or nothing, and serve whatever does not fit outside the cache.

Patches 4 and 5 convert the ROX cache to scope based cleanup.

The series was tested on x86 with module load/unload cycles, with PTDUMP confirming that the cache is using 2M mappings, and with nohugevmalloc to exercise the uncached fallback.

This patch (of 5):

When execmem refills the ROX cache, it vmalloc()s multiples of PMDSIZE aligned to PMDSIZE. For every such allocation vmalloc creates a vm area.

The first part of the vmalloc()ed chunk is returned to the allocation that triggered the cache refill and the remaining part is added to the cache and handed out for subsequent allocations with execmemalloc().

When only the first part is freed, the entire vm area remains in the ROX cache and can be handed out again.

In the case when the first allocation is larger than PMDSIZE and the second allocation from the freed first part of the chunk is exactly PMDSIZE, execmemcacheclean() will free the entire chunk while part of it is still in use.

For example:

/ vmalloc(4M), return p0 to the caller add [p0 + 3M, p0 + 4M) to the cache / p0 = execmemalloc(3M);

/ return p0 + 3M from the cache to the caller / p1 = execmemalloc(1M);

/ put [p0, p0 + 3M) back into the cache / execmemfree(p0);

/ return p0 from the cache to the caller / p2 = execmemalloc(2M);

/ return p0 + 2M from the cache to the caller / p3 = execmemalloc(1M);

/ bah! execmemcacheclean() frees the entire 4M chunk / execmemfree(p2);

Make sure that the ranges that execmemcacheclean() frees cover the entire vm area.

Affected Software

5 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.13.0<6.18.63
6.18.63
linux/kernel>=6.19.0<7.3.4
7.3.4
debian/linux<7.3.4-1
7.3.4-1
debian/linux
7.3.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.63
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.4
  3. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.4-1
  4. Upgrade

    Upgrade Linux kernel to a version that resolves this vulnerability.

    Patch mm/execmem: free ROX cache chunks only when they span an entire vm area

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description
Data Sourced
via OSV·01:25 PM
DescriptionAffected Software
Data Sourced
via NVD·02:17 PM
Description

Frequently Asked Questions

1

What allocation pattern can trigger the incorrect free?

The problem occurs when a PMD-sized, PMD-aligned free range lies in the middle of a larger ROX cache chunk. The cleanup logic can mistake that range for an entirely unused chunk and free it while part of the chunk remains in use.

2

Is this limited to the PMD-size allocation failure fallback?

No. Investigation of the PMD-size allocation failure fallback uncovered the issue, but the described incorrect-free condition is a separate, rare bug. The patch series also addresses maple tree allocation failures and prevents caching base-page-mapped fallback areas that cannot later be freed from the cache.

3

Which fixed Linux kernel versions contain the remediation?

The provided information does not identify affected or fixed kernel version numbers. It provides stable-tree commit references for the changes.

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