Thread (115 messages) 115 messages, 12 authors, 2023-03-01

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

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2023-02-22 00:10:35
Also in: linux-arch, linux-doc, linux-mm, lkml

On Tue, 2023-02-21 at 09:31 +0100, David Hildenbrand wrote:
quoted
quoted
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@intel.com/ (local)
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help