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


Groups > linux.kernel > #1191724

Re: [PATCH 3/3] x86/entry/64: Move #BP from IST to the IRQ stack

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] x86/entry/64: Move #BP from IST to the IRQ stack
Date 2015-07-24 13:10 +0200
Message-ID <pPJ1w-3Ya-29@gated-at.bofh.it> (permalink)
References <pPxjH-3z4-1@gated-at.bofh.it> <pPxjH-3z4-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 23, 2015 at 03:37:48PM -0700, Andy Lutomirski wrote:
> There's nothing IST-worthy about #BP/int3.  We don't allow kprobes
> in the small handful of places in the kernel that run at CPL0 with
> an invalid stack, and 32-bit kernels have used normal interrupt
> gates for #BP forever.
> 
> Furthermore, we don't allow kprobes in places that have usergs while
> in kernel mode, so "paranoid" is also unnecessary.
> 
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
>  arch/x86/entry/entry_64.S |  2 +-
>  arch/x86/kernel/traps.c   | 26 +++++++++++++-------------
>  2 files changed, 14 insertions(+), 14 deletions(-)

...

> @@ -494,7 +494,15 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
>  	if (poke_int3_handler(regs))
>  		return;
>  
> +	/*
> +	 * Use ist_enter despite the fact that we don't use an IST stack.
> +	 * We can be called from a kprobe in non-CONTEXT_KERNEL kernel
> +	 * mode or even during context tracking state changes.
> +	 *
> +	 * This means that we can't schedule.  That's okay.
> +	 */
>  	ist_enter(regs);

A good sign that this "ist_enter" name needs to be changed. Otherwise,
this call site will confuse people.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH 0/3] x86_64: Make int3 non-magical Andy Lutomirski <luto@kernel.org> - 2015-07-24 00:40 +0200
  [PATCH 3/3] x86/entry/64: Move #BP from IST to the IRQ stack Andy Lutomirski <luto@kernel.org> - 2015-07-24 00:40 +0200
    Re: [PATCH 3/3] x86/entry/64: Move #BP from IST to the IRQ stack Borislav Petkov <bp@alien8.de> - 2015-07-24 13:10 +0200
  [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Andy Lutomirski <luto@kernel.org> - 2015-07-24 00:40 +0200
    Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then  NMI-safe Borislav Petkov <bp@alien8.de> - 2015-07-24 12:30 +0200
      Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then  NMI-safe Borislav Petkov <bp@alien8.de> - 2015-07-25 06:20 +0200
        Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Andy Lutomirski <luto@amacapital.net> - 2015-07-25 06:30 +0200
          Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then  NMI-safe Borislav Petkov <bp@alien8.de> - 2015-07-25 06:40 +0200
            Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Andy Lutomirski <luto@amacapital.net> - 2015-07-25 07:00 +0200
              Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Linus Torvalds <torvalds@linux-foundation.org> - 2015-07-25 20:00 +0200
                Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Andy Lutomirski <luto@amacapital.net> - 2015-07-25 20:10 +0200
                Re: [PATCH 1/3] x86/entry/64: Refactor IRQ stacks and make then NMI-safe Linus Torvalds <torvalds@linux-foundation.org> - 2015-07-25 20:20 +0200
  [PATCH 2/3] x86/entry/64: Teach idtentry to use the IRQ stack Andy Lutomirski <luto@kernel.org> - 2015-07-24 00:40 +0200
  Re: [PATCH 0/3] x86_64: Make int3 non-magical Andy Lutomirski <luto@amacapital.net> - 2015-07-24 00:40 +0200

csiph-web