Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-28 Thread Andy Lutomirski
> On Aug 28, 2018, at 4:33 AM, Andrey Ryabinin wrote: > > > > On 08/28/2018 01:38 PM, Jann Horn wrote: > >>> >>> >>> Why this has to be done in the rewind_stack_do_exit()? >>> Are there any problems with calling the kasan_unpoison_task_stack(current) >>> from oops_end(), before the rewin

Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-28 Thread Jann Horn
On Tue, Aug 28, 2018 at 1:33 PM Andrey Ryabinin wrote: > On 08/28/2018 01:38 PM, Jann Horn wrote: > >> Why this has to be done in the rewind_stack_do_exit()? > >> Are there any problems with calling the kasan_unpoison_task_stack(current) > >> from oops_end(), before the rewind_stack_do_exit()? >

Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-28 Thread Andrey Ryabinin
On 08/28/2018 01:38 PM, Jann Horn wrote: >> >> >> Why this has to be done in the rewind_stack_do_exit()? >> Are there any problems with calling the kasan_unpoison_task_stack(current) >> from oops_end(), before the rewind_stack_do_exit()? > > Ooh, good point! I didn't see that KASAN instrument

Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-28 Thread Jann Horn
On Tue, Aug 28, 2018 at 11:04 AM Andrey Ryabinin wrote: > > On 08/25/2018 02:58 AM, Jann Horn wrote: > > Reset the KASAN shadow state of the task stack when rewinding RSP. > > Without this, a kernel oops will leave parts of the stack poisoned, and > > code running under do_exit() can trip over suc

Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-28 Thread Andrey Ryabinin
On 08/25/2018 02:58 AM, Jann Horn wrote: > Reset the KASAN shadow state of the task stack when rewinding RSP. > Without this, a kernel oops will leave parts of the stack poisoned, and > code running under do_exit() can trip over such poisoned regions and cause > nonsensical false-positive KASAN rep

Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-24 Thread Dmitry Vyukov
On Fri, Aug 24, 2018 at 4:58 PM, Jann Horn wrote: > Reset the KASAN shadow state of the task stack when rewinding RSP. > Without this, a kernel oops will leave parts of the stack poisoned, and > code running under do_exit() can trip over such poisoned regions and cause > nonsensical false-positive

[PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()

2018-08-24 Thread Jann Horn
Reset the KASAN shadow state of the task stack when rewinding RSP. Without this, a kernel oops will leave parts of the stack poisoned, and code running under do_exit() can trip over such poisoned regions and cause nonsensical false-positive KASAN reports about stack-out-of-bounds bugs. This patch