Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3321728imm; Thu, 17 May 2018 07:02:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp9l/BG2kY7BjlVi9eNG8ONku2GODX4m3rQ703MUCsYtaGbfQl1cyFld0Jke/rDnJ/BdKeO X-Received: by 2002:a65:65d5:: with SMTP id y21-v6mr4082695pgv.277.1526565778490; Thu, 17 May 2018 07:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526565778; cv=none; d=google.com; s=arc-20160816; b=fhCGDybianhAgaNnuyaTxZhIhZuh7xJ6Fk5aEK7nNFZjyI4gqNKYJ8aV6f80HcgyIJ xrnQTxF3Ncfni8Hz37nfTluiSweT3z8I4g0Ik3TSRUZwPP8QlSUKw7oOkpndhbQzpTLY KwnTz6qdp0Pc5i4GEc3W+90/5XyFQo/KZbx5J8km1IAqXC/idbXayrfkHjhPk3SxW+FQ ARcC1RJK0qcWZ6KWwIhM9Ms9i9WTHfRcd7r9PAYhENd1SyxWmwUgrP9VdVuGzszB8QZ1 c5NyJgJ2QHIIKgGcHn6vOLk+HmNI/SFMA4C0WpKqpWpBPViq0uJXY903fsoN+MmpU/A6 km5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=dHF67Wpuxr0N1loyaGzIrnEE8TFVI5qx4ZlHBVBJK+4=; b=d2g1mhP5sUMDNjZSpo9n/84RJ8I/Hsp89xzrn2I3BZU3DvC1Crs9M7ahvl2us/DGTT 0R+Rv1xR2+Nu37ckT38XHXeLW19l4+V5hiWkyh6Lrwvlm0SXTGDL/7AzXxGSBTIbIjjE nQBDLtJ7FdHS0JJmnrothG/xFAn0OM8V0+XcvcMYpqylHyLry1pxEYcMHTPacDOdTX4c l0DY8yY9Z2EqFAar/2NC06oQZSENH+mdb/Gvo7kuaemZTQgLeHMpYrO4Ulpn6tLPL4Ng OOsrQsxfKMY10kCFOuQVenAHqwTI8qQycrZ6LsP/AUnyKtGu+5f956XoF/cYc7gh4/pg cVqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Gd47wNK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7-v6si2707176pgu.26.2018.05.17.07.02.16; Thu, 17 May 2018 07:02:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Gd47wNK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbeEQOBj (ORCPT + 99 others); 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dHF67Wpuxr0N1loyaGzIrnEE8TFVI5qx4ZlHBVBJK+4=; b=Gd47wNK5SsCHQBX8fYJj3VTY/ sMMgmJCDZbyqu+VXsR5lJ4QnJUVQWAoZAQH6614f3sIU/88uPiyhGr1iVEjTlWMeXVisZ42hNte4u wzTQx7sPWT4HlGA1MTXEr2FsyfueveJT0b565kW7H7VC+JZy5senJx250X1+nHdNVFpaGgwAMpUDV rPEkKhTGPq1DAl16usnAQZm0h14Vt/w2k4EQ5xqreYokjV3XJMXLqv83wZ4MqsPAJi0ZLNGMRvJr5 sGFrYZkr0RNjzH1j+A64kCbzVXtjlbnyMNneows/Pb9GNZa3G9c5jf5i4GmdXErL+KUnnDPtOaKWa x/ulgY63A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJJT6-0004e7-Qc; Thu, 17 May 2018 14:01:21 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6D8A62029F86E; Thu, 17 May 2018 16:01:18 +0200 (CEST) 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 Precedence: bulk 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)