From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbeEQOBj (ORCPT ); Thu, 17 May 2018 10:01:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40036 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbeEQOBi (ORCPT ); Thu, 17 May 2018 10:01:38 -0400 Date: Thu, 17 May 2018 16:01:18 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Linus Torvalds , Alexey Dobriyan , Peter Anvin , kernel test robot , Ingo Molnar , Thomas Gleixner , Andrew Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , Linux Kernel Mailing List , Peter Anvin , tipbuild@zytor.com, LKP Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3 padding Message-ID: <20180517140118.GT12217@hirez.programming.kicks-ass.net> References: <20180515210757.GA12225@avx2> <20180515214337.GA18021@avx2> <20180515222211.ods5hzne46hozojq@treble> <20180515224354.zmygmsnlqj5lrdbo@treble> <20180516033044.odb74pdgcn5nacwb@treble> <20180517134934.eog2fgoby5azq5a7@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517134934.eog2fgoby5azq5a7@treble> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 08:49:34AM -0500, Josh Poimboeuf wrote: > With the following commit: > > 51bad67ffbce ("x86/asm: Pad assembly functions with INT3 instructions") > > ... asm function alignments are padded with INT3, so it's no longer safe > to fall through to an aligned function. Make sure we catch any such > cases with objtool. > > Note this only adds checking for 64-bit, since objtool doesn't support > x86-32. > > Suggested-by: Thomas Gleixner > Suggested-by: Linus Torvalds > Signed-off-by: Josh Poimboeuf > --- > arch/x86/kernel/head_64.S | 2 -- > tools/objtool/arch.h | 3 ++- > tools/objtool/arch/x86/decode.c | 2 +- > tools/objtool/check.c | 11 ++++++++++- > 4 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S > index 8344dd2f310a..3ed8cec6e765 100644 > --- a/arch/x86/kernel/head_64.S > +++ b/arch/x86/kernel/head_64.S > @@ -285,11 +285,9 @@ ENTRY(early_idt_handler_array) > .endif > pushq $i # 72(%rsp) Vector number > jmp early_idt_handler_common > - UNWIND_HINT_IRET_REGS > i = i + 1 > .fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc > .endr > - UNWIND_HINT_IRET_REGS offset=16 > END(early_idt_handler_array) > > early_idt_handler_common: As noted on IRC; I got slightly confused what this was about. Other than that: Acked-by: Peter Zijlstra (Intel)