CVE-2026-139785

Not scored yetLast modified Nov 30, 2026

Description

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

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

vma_merge_existing_range() 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->vma_flags, 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 propagate_sticky_flags(), which treats vmg->vma_flags as its base (in case any sticky flags are set there), updating it as sticky flags are accumulated from merged VMAs.

Also update vma_expand() to use propagate_sticky_flags() so all merge paths utilise it.

propagate_sticky_flags() 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 commit_merge().

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

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

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

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

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

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

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

VendorProductVersions
LinuxLinux>= b836839c1fd94f9fc7ccdce153844fa26116ccc0, < 671d6e9b404f06c864e08e78123a4d4f84837ac0; >= 49e14dabed7a294427588d4b315f57fbfcab9990, < 54b29a37539f6f6649a135ba55565360dd0ea569; >= 49e14dabed7a294427588d4b315f57fbfcab9990, < c386d799f423685952138cab8d89f0331825bdee; >= 6.18.37, < 6.18.65
LinuxLinux6.19

References

Timeline

Published
Nov 30, 2026
Last modified
Nov 30, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-1397867.0In the Linux kernel, the following vulnerability has been resolved: mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows So fCVE-2026-139787In the Linux kernel, the following vulnerability has been resolved: nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() nvme_tcp_free_ctrCVE-2026-1397887.0In the Linux kernel, the following vulnerability has been resolved: cipso: stop modifying live ip_options_rcu cipso_v4_delopt() operates oCVE-2026-139789In the Linux kernel, the following vulnerability has been resolved: hugetlbfs: enforce F_SEAL_EXEC in setattr F_SEAL_EXEC is enforced by sCVE-2026-139794.3Inappropriate implementation in Paint in Google Chrome prior to 150.0.7871.47 allowed a remote attacker to perform UI spoofing via a craftedCVE-2026-139790In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jCVE-2026-139791In the Linux kernel, the following vulnerability has been resolved: net: Use a dedicated flag to track disabled napi instances Trying to dCVE-2026-1397927.0In the Linux kernel, the following vulnerability has been resolved: ALSA: pcm: Prevent O_APPEND open on OSS streams ALSA PCM core accepts CVE-2026-139793In the Linux kernel, the following vulnerability has been resolved: inet: frags: bound the wmem charge of the socket completing a reassemblCVE-2026-139794In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to fetch ino via ino_of_node() under cache lock In f2fs_writCVE-2026-139795In the Linux kernel, the following vulnerability has been resolved: net: mana: Add support to process throttled EQEs When an event queue nCVE-2026-139796In the Linux kernel, the following vulnerability has been resolved: ocfs2/heartbeat: serialize concurrent writes to a region's dev attribut
CVE-2026-139785: Unscored | Vulnix