Received: by 10.223.185.116 with SMTP id b49csp1082825wrg; Wed, 21 Feb 2018 11:48:42 -0800 (PST) X-Google-Smtp-Source: AH8x2275USWUCBBx3bt7RDGBj+lK8Tnyogpu1zNpsnllambkvvyuE852Rc7ya86oQNzkN25E2sz1 X-Received: by 10.99.185.7 with SMTP id z7mr3684810pge.123.1519242522161; Wed, 21 Feb 2018 11:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519242522; cv=none; d=google.com; s=arc-20160816; b=WkYrpefguvoldGu7kJyRlMW8DvP0a7TK2q24ra1NsWPBlhjAq80/5cOUmR7i6lgL/K e67u8byORVjc9niqY4ktWgpLpYpejNH4zRYSpkmxE2yD0crazUFCC54SHz8Y/xX5VrZY EfPbc75U+0TWu+u5IrOhBRxvOYen9vTBmPCTGsW7zMnQbUv/ZxF7N90ocawPBgIDuddc ePBp3NPD7KPEMPInNxbXruvc9BF6haj4lmNBzOBNNmzNxh3jLK4i7DRHktYSRznMktdn R+ZekXNJ/toOpOYsVkei4LFX3GlzBxoSIHHGCqxIrJVtKZbtgIdNDpmi1n0ildeFHTYZ KZcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/IBkwYmJfStbHh8cH0jgZHhJiVYv1CsEojAJesq14Q0=; b=o7Dz0YMtYAGY/PidUp6ZYpcwV+ZYoEqoE/6kVUH8v2Wl2gxmEpfc5So5Ff/18xqypu ZF7o4s6TkVeU6DOlMw+0qFxloD+vgOrfXr0qmeCvdicM3AQN76iTLVPfqz4D2qOMAXCn z2e1LS65ltmEXZcZHR0KKSF4+9BTK6/3lRUX9yoQwMf+LL4Z2YuEAREA+OjSdwwiY3Jf FqDJybTCWsh8yrUowJGXFsDQg8EjM79ntJ7wY01lVrLT1deBjrQGxNtnwUsPaM3wrcW9 Sris0cacbc6l3ebgCQsFVCDTX2HWjBvmZ8ePorRmC8E/aaQVXxDnH0rmSIISYrdBFLBn HpWA== ARC-Authentication-Results: i=1; mx.google.com; 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 r2si6829060pgv.485.2018.02.21.11.48.26; Wed, 21 Feb 2018 11:48:42 -0800 (PST) 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; 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 S936974AbeBUNgv (ORCPT + 99 others); Wed, 21 Feb 2018 08:36:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42732 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965365AbeBUNJE (ORCPT ); Wed, 21 Feb 2018 08:09:04 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8B14811A7; Wed, 21 Feb 2018 13:09:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Josh Poimboeuf , "Peter Zijlstra (Intel)" , Andy Lutomirski , Arjan van de Ven , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Thomas Gleixner , kbuild test robot , Ingo Molnar Subject: [PATCH 4.15 077/163] x86/debug, objtool: Annotate WARN()-related UD2 as reachable Date: Wed, 21 Feb 2018 13:48:26 +0100 Message-Id: <20180221124534.710771370@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Poimboeuf commit 2b5db66862b95532cb6cca8165ae6eb73633cf85 upstream. By default, objtool assumes that a UD2 is a dead end. This is mainly because GCC 7+ sometimes inserts a UD2 when it detects a divide-by-zero condition. Now that WARN() is moving back to UD2, annotate the code after it as reachable so objtool can follow the code flow. Reported-by: Borislav Petkov Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Arjan van de Ven Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: kbuild test robot Link: http://lkml.kernel.org/r/0e483379275a42626ba8898117f918e1bf661e40.1518130694.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/bug.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -77,7 +77,11 @@ do { \ unreachable(); \ } while (0) -#define __WARN_FLAGS(flags) _BUG_FLAGS(ASM_UD0, BUGFLAG_WARNING|(flags)) +#define __WARN_FLAGS(flags) \ +do { \ + _BUG_FLAGS(ASM_UD0, BUGFLAG_WARNING|(flags)); \ + annotate_reachable(); \ +} while (0) #include