Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Pedro Falcato <pfalcato@suse.de>,
	David Hildenbrand <david@kernel.org>,
	Jann Horn <jannh@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Kees Cook <kees@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ollie Wild <aaw@google.com>, Adrian Bunk <bunk@stusta.de>,
	Xu Xin <xu.xin@linux.dev>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Mike Rapoport <rppt@kernel.org>, Michal Hocko <mhocko@suse.com>,
	Hugh Dickins <hughd@google.com>, Joey Gouly <joey.gouly@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-mm@kvack.org, Chris Mason <mason@kernel.org>,
	Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH 6/7] mm/mremap: respect guard gaps on in-place expansion
Date: Sun, 22 Nov 2026 19:03:33 +0100	[thread overview]
Message-ID: <43a1524c-a0d7-48e4-8bfb-3912b97fd197@gmail.com> (raw)
In-Reply-To: <20261121-some-more-ai-fixes-v1-6-236e925d9b64@kernel.org>

On 11/21/26 5:02 PM, Lorenzo Stoakes (ARM) wrote:
> From: Chris Mason <mason@kernel.org>
> 
> Growing a mapping in place can let it use up the guard gap below a
> stack, so that the stack can't grow any further, or overflows into the
> mapping instead of faulting.
> 
> A mapping has to stay out of the gap of the next VMA unless the caller
> fixed its address. But vma_expandable() only checks that the new range
> doesn't intersect the next VMA, and it passes MAP_FIXED to
> get_unmapped_area(), which skips the gap check there.
> 
> Fix the issue by stopping in-place growth at the start of the gap.
> 
> Growing a mapping into or within the gap of a stack or shadow stack now
> fails with ENOMEM without MREMAP_MAYMOVE, or if the mapping can't be
> moved.
> 
> Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
> Signed-off-by: Chris Mason <mason@kernel.org>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

LGTM:

Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>

-- 
cheers,
jose a. p-a


  parent reply	other threads:[~2026-11-22 18:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 16:02 [PATCH 0/7] mm: reworked AI-generated VMA and mremap fixes Lorenzo Stoakes (ARM)
2026-11-21 16:02 ` [PATCH 1/7] mm/vma: error out on invalid bounds in unmapped_area_topdown() Lorenzo Stoakes (ARM)
2026-11-22  3:20   ` Suren Baghdasaryan
2026-11-22 15:55   ` Gregory Price (Meta)
2026-11-22 18:03   ` Jose A. Perez de Azpillaga
2026-11-21 16:02 ` [PATCH 2/7] mm/vma: lock VMAs before taking mm_all_locks_mutex Lorenzo Stoakes (ARM)
2026-11-22  3:23   ` Suren Baghdasaryan
2026-11-22 15:53   ` Gregory Price (Meta)
2026-11-22 18:03   ` Jose A. Perez de Azpillaga
2026-11-21 16:02 ` [PATCH 3/7] mm/ksm: only interrupt unmerging on a fatal signal Lorenzo Stoakes (ARM)
2026-11-22  3:27   ` Suren Baghdasaryan
2026-11-22 15:54   ` David Hildenbrand (Arm)
2026-11-22 15:56   ` Gregory Price (Meta)
2026-11-21 16:02 ` [PATCH 4/7] mm/vma: fix uncharge after failed stack relocation Lorenzo Stoakes (ARM)
2026-11-22  3:34   ` Suren Baghdasaryan
2026-11-22 15:50   ` Gregory Price (Meta)
2026-11-22 16:04   ` sashiko-bot
2026-11-21 16:02 ` [PATCH 5/7] mm/mremap: apply the mmap() offset limits on expansion Lorenzo Stoakes (ARM)
2026-11-22  3:37   ` Suren Baghdasaryan
2026-11-22 15:50   ` Gregory Price (Meta)
2026-11-22 18:03   ` Jose A. Perez de Azpillaga
2026-11-21 16:02 ` [PATCH 6/7] mm/mremap: respect guard gaps on in-place expansion Lorenzo Stoakes (ARM)
2026-11-22  3:41   ` Suren Baghdasaryan
2026-11-22 15:49   ` Gregory Price (Meta)
2026-11-22 18:03   ` Jose A. Perez de Azpillaga [this message]
2026-11-21 16:02 ` [PATCH 7/7] mm/vma: make brk mappings non-executable under MDWE Lorenzo Stoakes (ARM)
2026-11-22  3:46   ` Suren Baghdasaryan
2026-11-22 15:48   ` Gregory Price (Meta)
2026-11-22 18:03   ` Jose A. Perez de Azpillaga
2026-11-22 15:55 ` (subset) [PATCH 0/7] mm: reworked AI-generated VMA and mremap fixes David Hildenbrand
2026-11-22 15:57 ` Gregory Price (Meta)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43a1524c-a0d7-48e4-8bfb-3912b97fd197@gmail.com \
    --to=azpijr@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=aaw@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=catalin.marinas@arm.com \
    --cc=chengming.zhou@linux.dev \
    --cc=david@kernel.org \
    --cc=hughd@google.com \
    --cc=jannh@google.com \
    --cc=joey.gouly@arm.com \
    --cc=josef@toxicpanda.com \
    --cc=kees@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mason@kernel.org \
    --cc=mhocko@suse.com \
    --cc=pfalcato@suse.de \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=willy@infradead.org \
    --cc=xu.xin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox