CVE-2026-139785: mm/vma: avoid losing atomic VMA flags when setting sticky VMA flags

Published Nov 30, 2026
·
Updated

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

mm/vma: avoid losing atomic VMA flags when setting sticky VMA flags

vmamergeexistingrange() merges an existing VMA (middle) when its attributes have changed to match those of one or both adjacent VMAs.

Sticky flags are propagated if they are set in any of the merged VMAs. They are initialised from vmg->vmaflags, which is assumed to contain middle's sticky flags when the function is invoked.

However, the VMA write lock is not held for middle when they are first populated, so concurrent updates to atomic VMA flags may occur, which will be lost upon merge.

This can result in fork failing to propagate guard region markers and (if file-backed) THP collapse discarding them.

Resolve this by propagating the sticky flags after middle is locked.

Make life easier by factoring this into propagatestickyflags(), which treats vmg->vmaflags as its base (in case any sticky flags are set there), updating it as sticky flags are accumulated from merged VMAs.

Also update vmaexpand() to use propagatestickyflags() so all merge paths utilise it.

propagatestickyflags() also asserts that the VMA write lock is held for the VMA whose sticky flags are being read, with a comment explaining why.

Another means by which atomic VMA flags can fail to be observed is when the merge is finalised in commitmerge().

rmap locks are dropped in vmacomplete() before the sticky flags are written, meaning an rmap walker can observe the VMA without sticky flags set, which can also result in retractpagetables() discarding guard markers.

Resolve this by assigning the sticky flags before dropping rmap locks, factored into commitstickyflags() with a write assert on the VMA being written to.

Also remove the vmasetflagsmask() invocation at the end of vmamergeexistingrange() as this was introduced by commit 64212ba02e66 ("mm: implement sticky VMA flags") to propagate sticky flags, which is now redundant with the introduction of commitstickyflags().

The vmasetflagsmask() invocation at the end of vmaexpand() setting sticky flags only is also removed for the same reason.

Also update vmamergeexistingrange()'s comment to reflect the fact that vmg->vmaflags gets updated.

Finally, update the userland VMA tests to reflect a previously missed const-ification in vmaassertwritelocked() which would otherwise cause a warning when building them.

Affected Software

3 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.18.37<6.18.65
6.18.65
linux/kernel>=6.19.0<7.3.6
7.3.6

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.65
  2. Upgrade

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

    Fixed in 7.3.6

Event History

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

Frequently Asked Questions

1

Under what conditions can the issue occur?

It can occur when an existing middle VMA is merged because its attributes changed to match adjacent VMAs, while atomic VMA flags are updated concurrently before the middle VMA write lock is held.

2

What observable effects can result from lost VMA flags?

A fork can fail to propagate guard-region markers. For file-backed mappings, THP collapse can discard those markers.

3

What does the resolved change do to prevent the loss?

It propagates sticky flags only after the middle VMA is write-locked, preserving concurrently updated atomic VMA flags. The same propagation helper is used for VMA expansion so all merge paths use the corrected handling.

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