mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	kasan-dev@googlegroups.com,
	Alexander Potapenko <glider@google.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] x86/entry/64: wipe KASAN stack shadow in rewind_stack_do_exit()
Date: Tue, 28 Aug 2018 14:33:48 +0300	[thread overview]
Message-ID: <daba9c5b-b5c6-beaa-ca96-81cf6af760b9@virtuozzo.com> (raw)
In-Reply-To: <CAG48ez1zYqx8-1We3JkDBmYREksUMoUe7VBeAOv2JH98gVWcKw@mail.gmail.com>



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.



  reply	other threads:[~2018-08-28 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 23:58 Jann Horn
2018-08-25  0:13 ` Dmitry Vyukov
2018-08-28  9:04 ` Andrey Ryabinin
2018-08-28 10:38   ` Jann Horn
2018-08-28 11:33     ` Andrey Ryabinin [this message]
2018-08-28 12:53       ` Jann Horn
2018-08-28 19:57       ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daba9c5b-b5c6-beaa-ca96-81cf6af760b9@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=jannh@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®