linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] mm: Avoid sharing high VMA flag bits
@ 2025-05-07 13:09 Florent Revest
  2025-05-07 13:09 ` [PATCH v2 1/4] mm: fix VM_UFFD_MINOR == VM_SHADOW_STACK on USERFAULTFD=y && ARM64_GCS=y Florent Revest
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Florent Revest @ 2025-05-07 13:09 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-mm
  Cc: catalin.marinas, will, tglx, mingo, bp, dave.hansen, x86, hpa,
	akpm, broonie, thiago.bauermann, jackmanb, Florent Revest

While staring at include/linux/mm.h, I was wondering why VM_UFFD_MINOR and
VM_SHADOW_STACK share the same bit on arm64. I think I gained enough confidence
now to call it a bug.

The first patch of this series is a straightforward attempt at fixing this
specific bug by changing the bit used by VM_UFFD_MINOR. I cc-ed stable on that
one and I expect it to not be all too controversial.

The rest of the series however is a more zealous refactoring and likely to be
more contentious... :) Since this bug looks like a near miss which could have
been quite severe in terms of security, I think it's worth trying to simplify
the high VMA flag bits code. I tried to consolidate around the current usage of
VM_HIGH_ARCH_* macros but I'm not sure if this is the preferred approach here. I
really don't feel strongly about those refactorings so this is more of a
platform for discussion for people with more mm background, I'll be more than
happy to respin a v2!

This series applies on v6.15-rc5.

v1 -> v2:
- Fixed a couple of typos in patch 4
- Added Mark Brown's Reviewed-by tag

Florent Revest (4):
  mm: fix VM_UFFD_MINOR == VM_SHADOW_STACK on USERFAULTFD=y &&
    ARM64_GCS=y
  mm: remove CONFIG_ARCH_USES_HIGH_VMA_FLAGS
  mm: use VM_HIGH_ARCH_* macros consistently
  mm: consolidate VM_HIGH_ARCH_* macros into parametric macros

 arch/arm64/Kconfig   |  3 ---
 arch/powerpc/Kconfig |  1 -
 arch/x86/Kconfig     |  2 --
 include/linux/mm.h   | 51 ++++++++++++++++----------------------------
 mm/Kconfig           |  2 --
 5 files changed, 18 insertions(+), 41 deletions(-)

-- 
2.49.0.987.g0cc8ee98dc-goog



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-07 22:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-07 13:09 [PATCH v2 0/4] mm: Avoid sharing high VMA flag bits Florent Revest
2025-05-07 13:09 ` [PATCH v2 1/4] mm: fix VM_UFFD_MINOR == VM_SHADOW_STACK on USERFAULTFD=y && ARM64_GCS=y Florent Revest
2025-05-07 13:09 ` [PATCH v2 2/4] mm: remove CONFIG_ARCH_USES_HIGH_VMA_FLAGS Florent Revest
2025-05-07 13:09 ` [PATCH v2 3/4] mm: use VM_HIGH_ARCH_* macros consistently Florent Revest
2025-05-07 13:10 ` [PATCH v2 4/4] mm: consolidate VM_HIGH_ARCH_* macros into parametric macros Florent Revest
2025-05-07 22:51 ` [PATCH v2 0/4] mm: Avoid sharing high VMA flag bits Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox