From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbbGXLCv (ORCPT ); Fri, 24 Jul 2015 07:02:51 -0400 Received: from mail.skyhub.de ([78.46.96.112]:48333 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbbGXLCt (ORCPT ); Fri, 24 Jul 2015 07:02:49 -0400 Date: Fri, 24 Jul 2015 13:02:43 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , linux-kernel@vger.kernel.org, Brian Gerst , Steven Rostedt , Willy Tarreau , Thomas Gleixner , Peter Zijlstra , Linus Torvalds Subject: Re: [PATCH 3/3] x86/entry/64: Move #BP from IST to the IRQ stack Message-ID: <20150724110243.GA20411@nazgul.tnic> References: <881f70d2156267e8f9cd901ce0f66b6cd029a44c.1437690860.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <881f70d2156267e8f9cd901ce0f66b6cd029a44c.1437690860.git.luto@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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. --