lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()
From
Date


> On Aug 28, 2018, at 4:33 AM, Andrey Ryabinin <aryabinin@virtuozzo.com> 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()?
>>
>> Ooh, good point! I didn't see that KASAN instrumentation is disabled
>> for dumpstack.c.
>
> It doesn't really matter. This would work with instrumented oops_end() as well.
> kasan_unpoison_task_stack() will unpoison everything including oops_end's stack.
> It would be also ok if kasan_unpoison_task_stack() instrumented, or calling any number of instrumented functions
> in between kasan_unpoison_task_stack() and rewind_stack_do_exit(). As long as we return from these functions before
> the rewind_stack_do_exit(), the stack will be unpoisoned on return.

I think that, if all this is in C, we need rewind_stack_do_exit()’s caller to be uninstrumented. Which it is.

\
 
 \ /
  Last update: 2018-08-28 21:58    [W:0.045 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site