CVE-2026-23077: mm/vma: fix anon_vma UAF on mremap() faulted, unfaulted merge

Published Feb 4, 2026
·
Updated

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

mm/vma: fix anonvma UAF on mremap() faulted, unfaulted merge

Patch series "mm/vma: fix anonvma UAF on mremap() faulted, unfaulted merge", v2.

Commit 879bca0a2c4f ("mm/vma: fix incorrectly disallowed anonymous VMA merges") introduced the ability to merge previously unavailable VMA merge scenarios.

However, it is handling merges incorrectly when it comes to mremap() of a faulted VMA adjacent to an unfaulted VMA. The issues arise in three cases:

1. Previous VMA unfaulted:

copied -----| v |-----------|.............| | unfaulted |(faulted VMA)| |-----------|.............| prev

2. Next VMA unfaulted:

copied -----| v |.............|-----------| |(faulted VMA)| unfaulted | |.............|-----------| next

3. Both adjacent VMAs unfaulted:

copied -----| v |-----------|.............|-----------| | unfaulted |(faulted VMA)| unfaulted | |-----------|.............|-----------| prev next

This series fixes each of these cases, and introduces self tests to assert that the issues are corrected.

I also test a further case which was already handled, to assert that my changes continues to correctly handle it:

4. prev unfaulted, next faulted:

copied -----| v |-----------|.............|-----------| | unfaulted |(faulted VMA)| faulted | |-----------|.............|-----------| prev next

This bug was discovered via a syzbot report, linked to in the first patch in the series, I confirmed that this series fixes the bug.

I also discovered that we are failing to check that the faulted VMA was not forked when merging a copied VMA in cases 1-3 above, an issue this series also addresses.

I also added self tests to assert that this is resolved (and confirmed that the tests failed prior to this).

I also cleaned up vmaexpand() as part of this work, renamed vmahaduncowedparents() to vmaisforkchild() as the previous name was unduly confusing, and simplified the comments around this function.

This patch (of 4):

Commit 879bca0a2c4f ("mm/vma: fix incorrectly disallowed anonymous VMA merges") introduced the ability to merge previously unavailable VMA merge scenarios.

The key piece of logic introduced was the ability to merge a faulted VMA immediately next to an unfaulted VMA, which relies upon dupanonvma() to correctly handle anonvma state.

In the case of the merge of an existing VMA (that is changing properties of a VMA and then merging if those properties are shared by adjacent VMAs), dupanonvma() is invoked correctly.

However in the case of the merge of a new VMA, a corner case peculiar to mremap() was missed.

The issue is that vmaexpand() only performs dupanonvma() if the target (the VMA that will ultimately become the merged VMA): is not the next VMA, i.e. the one that appears after the range in which the new VMA is to be established.

A key insight here is that in all other cases other than mremap(), a new VMA merge either expands an existing VMA, meaning that the target VMA will be that VMA, or would have anonvma be NULL.

Specifically:

mmapregion() - no anonvma in place, initial mapping. dobrkflags() - expanding an existing VMA. vmamergeextend() - expanding an existing VMA. relocatevmadown() - no anonvma in place, initial mapping.

In addition, we are in the unique situation of needing to duplicate anonvma state from a VMA that is neither the previous or next VMA being merged with.

dupanonvma() deals exclusively with the target=unfaulted, src=faulted case. This leaves four possibilities, in each case where the copied VMA is faulted:

1. Previous VMA unfaulted:

copied -----| ---truncated---

Affected Software

7 affected components
Linux Linux kernel
Linux Linux kernel>=6.16<6.18.8
Linux Linux kernel=6.19-rc1
Linux Linux kernel=6.19-rc2
Linux Linux kernel=6.19-rc3
Linux Linux kernel=6.19-rc4
Linux Linux kernel=6.19-rc5

Event History

Feb 4, 2026
CVE Published
via MITRE·04:08 PM
Data Sourced
via MITRE·04:08 PM
DescriptionSeverity
Data Sourced
via NVD·05:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-23077?

CVE-2026-23077 has been classified with a high severity level due to its potential impact on the Linux kernel.

2

How do I fix CVE-2026-23077?

To address CVE-2026-23077, you should apply the latest patches available for the Linux kernel that include the fix.

3

What are the consequences of exploiting CVE-2026-23077?

Exploiting CVE-2026-23077 may lead to a use-after-free vulnerability, which can result in system crashes or arbitrary code execution.

4

Which versions of the Linux kernel are affected by CVE-2026-23077?

CVE-2026-23077 affects various versions of the Linux kernel prior to the patch release that resolves this vulnerability.

5

Is CVE-2026-23077 a remote code execution vulnerability?

Yes, CVE-2026-23077 can potentially lead to remote code execution if exploited successfully.

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