Re: [PATCH v6 22/41] mm/mmap: Add shadow stack pages to memory accounting

From: Edgecombe, Rick P
Date: Tue Feb 21 2023 - 19:10:35 EST


On Tue, 2023-02-21 at 09:31 +0100, David Hildenbrand wrote:
> > > Why not modify is_stack_mapping() ?
> >
> > It kind of sticks out a little in this conditional, but
> > is_stack_mapping() has this comment:
> > /*
> > * Stack area - automatically grows in one direction
> > *
> > * VM_GROWSUP / VM_GROWSDOWN VMAs are always private anonymous:
> > * do_mmap() forbids all other combinations.
> > */
> >
> > Shadow stack don't grow, so it doesn't quite fit. There used to be
> > an
> > is_shadow_stack_mapping(), but it was removed because all that was
> > needed (for the time being) was the simple bitwise AND:
> >
> >
https://lore.kernel.org/lkml/804adbac-61e6-0fd2-f726-5735fb290199@xxxxxxxxx/
>
> As there is only a single user of is_stack_mapping(), I'd simply
> have
> adjusted the doc of is_stack_mapping() to include shadow stacks.

Ok, I'll update the comment and add it there.