Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436531

Re: [PATCH v4 11/29] x86/dumpstack: When OOPSing, rewind the stack before do_exit

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH v4 11/29] x86/dumpstack: When OOPSing, rewind the stack before do_exit
Date 2016-07-04 20:50 +0200
Message-ID <rRh6q-Fs-9@gated-at.bofh.it> (permalink)
References <rOqfT-8f8-5@gated-at.bofh.it> <rOqfT-8f8-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Jun 26, 2016 at 02:55:33PM -0700, Andy Lutomirski wrote:
> If we call do_exit with a clean stack, we greatly reduce the risk of

Nits:	    do_exit()

> recursive oopses due to stack overflow in do_exit, and we allow

s/ in do_exit//

> do_exit to work even if we OOPS from an IST stack.  The latter gives

Append "()" to the function names.

> us a much better chance of surviving long enough after we detect a
> stack overflow to write out our logs.
> 
> I intentionally separated this from the preceding patch that
> disables do_exit-on-OOPS on IST stacks.  This way, if we need to
> revert this patch, we still end up in an acceptable state wrt stack
> overflow handling.
> 
> Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---

...

> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index 352f022cfd5b..0d05f113805e 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -226,6 +226,8 @@ unsigned long oops_begin(void)
>  EXPORT_SYMBOL_GPL(oops_begin);
>  NOKPROBE_SYMBOL(oops_begin);
>  
> +extern void __noreturn rewind_stack_do_exit(int signr);

You don't need the "extern" here.

> +
>  void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
>  {
>  	if (regs && kexec_should_crash(current))
-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 11/29] x86/dumpstack: When OOPSing, rewind the stack before do_exit Andy Lutomirski <luto@kernel.org> - 2016-06-27 00:00 +0200
  Re: [PATCH v4 11/29] x86/dumpstack: When OOPSing, rewind the stack  before do_exit Borislav Petkov <bp@alien8.de> - 2016-07-04 20:50 +0200

csiph-web