Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-25 Thread Tycho Andersen
On Fri, Sep 23, 2016 at 08:34:43PM +0200, Jann Horn wrote: > On Fri, Sep 23, 2016 at 11:28:26AM -0700, Kees Cook wrote: > > Does CRIU use this? I wouldn't expect so, since they're using ptrace, > > IIUC, to freeze/restore. > > As far as I can tell: > > parse_pid_stat() parses them into a struct

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-25 Thread Tycho Andersen
On Fri, Sep 23, 2016 at 08:34:43PM +0200, Jann Horn wrote: > On Fri, Sep 23, 2016 at 11:28:26AM -0700, Kees Cook wrote: > > Does CRIU use this? I wouldn't expect so, since they're using ptrace, > > IIUC, to freeze/restore. > > As far as I can tell: > > parse_pid_stat() parses them into a struct

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Jann Horn
On Fri, Sep 23, 2016 at 11:28:26AM -0700, Kees Cook wrote: > On Fri, Sep 23, 2016 at 12:43 AM, Jann Horn wrote: > > On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: > >> On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > >> > On Tue, Sep 13, 2016

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Jann Horn
On Fri, Sep 23, 2016 at 11:28:26AM -0700, Kees Cook wrote: > On Fri, Sep 23, 2016 at 12:43 AM, Jann Horn wrote: > > On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: > >> On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > >> > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Kees Cook
On Fri, Sep 23, 2016 at 12:43 AM, Jann Horn wrote: > On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: >> On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: >> > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >> >> This will prevent

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Kees Cook
On Fri, Sep 23, 2016 at 12:43 AM, Jann Horn wrote: > On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: >> On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: >> > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >> >> This will prevent a crash if get_wchan() runs

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Jann Horn
On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: > On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: > >> This will prevent a crash if get_wchan() runs after the task stack > >> is freed. > > > >

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-23 Thread Jann Horn
On Thu, Sep 22, 2016 at 03:44:37PM -0700, Andy Lutomirski wrote: > On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: > >> This will prevent a crash if get_wchan() runs after the task stack > >> is freed. > > > > I think I found

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-22 Thread Andy Lutomirski
On Thu, Sep 22, 2016 at 3:44 PM, Andy Lutomirski wrote: > On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: >> On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >>> This will prevent a crash if get_wchan() runs after the task stack >>> is

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-22 Thread Andy Lutomirski
On Thu, Sep 22, 2016 at 3:44 PM, Andy Lutomirski wrote: > On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: >> On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >>> This will prevent a crash if get_wchan() runs after the task stack >>> is freed. >> >> I think I found some more

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-22 Thread Andy Lutomirski
On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >> This will prevent a crash if get_wchan() runs after the task stack >> is freed. > > I think I found some more stuff. Have a look at KSTK_EIP() and KSTK_ESP(), I

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-22 Thread Andy Lutomirski
On Fri, Sep 16, 2016 at 7:00 PM, Jann Horn wrote: > On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: >> This will prevent a crash if get_wchan() runs after the task stack >> is freed. > > I think I found some more stuff. Have a look at KSTK_EIP() and KSTK_ESP(), I > think > they

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-16 Thread Jann Horn
On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: > This will prevent a crash if get_wchan() runs after the task stack > is freed. I think I found some more stuff. Have a look at KSTK_EIP() and KSTK_ESP(), I think they read from the saved userspace registers area at the top of the

Re: [PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-16 Thread Jann Horn
On Tue, Sep 13, 2016 at 02:29:29PM -0700, Andy Lutomirski wrote: > This will prevent a crash if get_wchan() runs after the task stack > is freed. I think I found some more stuff. Have a look at KSTK_EIP() and KSTK_ESP(), I think they read from the saved userspace registers area at the top of the

[PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-13 Thread Andy Lutomirski
This will prevent a crash if get_wchan() runs after the task stack is freed. Signed-off-by: Andy Lutomirski --- arch/x86/kernel/process.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/process.c

[PATCH 09/12] x86/process: Pin the target stack in get_wchan()

2016-09-13 Thread Andy Lutomirski
This will prevent a crash if get_wchan() runs after the task stack is freed. Signed-off-by: Andy Lutomirski --- arch/x86/kernel/process.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index