Re: [RFC] mlock/stack guard interaction fixup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Sunday, August 22, 2010 - 11:21 am

On Sun, Aug 22, 2010 at 10:25 AM, Greg KH <gregkh@suse.de> wrote:

They're all "required" (#2 needs #1, and #3 is a fix for something
that can happen in the same circumstances that #2 makes any
difference).

Although you do need to have some really odd things going on for any
of them to make any difference. Notably, you need to do mlock or
mprotect on the stack segment, which no sane program does.

That said, the change from

    start += PAGE_SIZE;

to

    addr += PAGE_SIZE;

in __mlock_vma_pages_range() (in #3) is a bugfix even for the normal
mlockall() case. Not that anybody will realistically care about that
either: the failure case just doesn't really realistically ever matter
(it expands the stack which the code tries to avoid, and possibly
forgets to mlock the bottom of the stack).

So I wouldn't call them high priority. Ian is doing something _really_
odd. Doing hypercalls from user space on stuff that is on the stack,
rather than just copying it to some stable area is dodgy. And I
guarantee that doing the crazy mlock dance is slower than the copy, so
it's complex, fragile, _and_ slow.

                            Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Fri Aug 20, 4:59 pm)
Re: [RFC] mlock/stack guard interaction fixup, Mike Snitzer, (Fri Aug 20, 5:20 pm)
Re: [RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Fri Aug 20, 5:54 pm)
Re: [RFC] mlock/stack guard interaction fixup, Ian Campbell, (Sat Aug 21, 4:56 am)
Re: [RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Sat Aug 21, 8:48 am)
Re: [RFC] mlock/stack guard interaction fixup, Sam Ravnborg, (Sat Aug 21, 9:08 am)
Re: [RFC] mlock/stack guard interaction fixup, Ian Campbell, (Sat Aug 21, 11:57 pm)
Re: [RFC] mlock/stack guard interaction fixup, Ian Campbell, (Sun Aug 22, 12:33 am)
Re: [RFC] mlock/stack guard interaction fixup, Ian Campbell, (Sun Aug 22, 2:55 am)
Re: [RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Sun Aug 22, 9:43 am)
Re: [RFC] mlock/stack guard interaction fixup, Greg KH, (Sun Aug 22, 10:25 am)
Re: [RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Sun Aug 22, 11:21 am)
Re: [RFC] mlock/stack guard interaction fixup, Greg KH, (Sun Aug 22, 12:04 pm)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 2:00 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 2:22 am)
Re: [RFC] mlock/stack guard interaction fixup, ijackson, (Mon Aug 23, 8:42 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 9:25 am)
Re: [RFC] mlock/stack guard interaction fixup, Tony Luck, (Mon Aug 23, 9:34 am)
Re: [RFC] mlock/stack guard interaction fixup, Ian Jackson, (Mon Aug 23, 10:18 am)
Re: [RFC] mlock/stack guard interaction fixup, Linus Torvalds, (Mon Aug 23, 10:34 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 10:40 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 10:53 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 10:59 am)
Re: [RFC] mlock/stack guard interaction fixup, Darren Hart, (Mon Aug 23, 11:43 am)
Re: [RFC] mlock/stack guard interaction fixup, Jeremy Fitzhardinge, (Mon Aug 23, 11:50 am)
Re: [RFC] mlock/stack guard interaction fixup, Jeremy Fitzhardinge, (Mon Aug 23, 11:53 am)
Re: [RFC] mlock/stack guard interaction fixup, Ian Campbell, (Mon Aug 23, 12:03 pm)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 12:07 pm)
Re: [RFC] mlock/stack guard interaction fixup, Jeremy Fitzhardinge, (Mon Aug 23, 12:23 pm)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Mon Aug 23, 12:26 pm)
Re: [RFC] mlock/stack guard interaction fixup, Jeremy Fitzhardinge, (Mon Aug 23, 12:54 pm)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Tue Aug 24, 12:08 am)
Re: [RFC] mlock/stack guard interaction fixup, Peter Zijlstra, (Tue Aug 24, 12:20 am)