[lkml]   [2017]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] mm: larger stack guard gap, between vmas
On Wed, Jul 05, 2017 at 04:51:06PM -0700, Linus Torvalds wrote:
> On Wed, Jul 5, 2017 at 4:35 PM, Ben Hutchings <> wrote:
> >>
> >> And I think your second patch breaks that "use a really large value to
> >> approximate infinity" case that definitely has existed as a pattern.
> >
> > Right. Well that seems to leave us with remembering the MAP_FIXED flag
> > and using that as the condition to ignore the previous mapping.
> I'm not particularly happy about having a MAP_FIXED special case, but
> yeah, I'm not seeing a lot of alternatives.

We can possibly refine it like this :
- use PROT_NONE as a mark for the end of the stack and consider the
application doing this knows exactly what it's doing ;

- use other MAP_FIXED as a limit for a shorter gap (ie 4kB), considering
that 1) it used to work like this for many years, and 2) if an application
is forcing a MAP_FIXED just below the stack and at the same time uses
large alloca() or VLA it's definitely bogus and looking for unfixable
trouble. Not allowing this means we break existing applications anyway.


 \ /
  Last update: 2017-07-06 10:25    [W:0.136 / U:0.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site