Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp556995ybz; Wed, 15 Apr 2020 13:59:03 -0700 (PDT) X-Google-Smtp-Source: APiQypJNXbF3BGq9Pr5rU4kN9AiLzotl9ZMSfNk9zlvSVD+tZpiNpoSswZAv1XQvWZTwCj5g6Ja2 X-Received: by 2002:a17:906:6c93:: with SMTP id s19mr6596852ejr.135.1586984343499; Wed, 15 Apr 2020 13:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586984343; cv=none; d=google.com; s=arc-20160816; b=GSJy2CMgbw1lV4pR54hQOsqaaPrsgZZozU3A9lbx5Np16YtMxkd5d4q8KvJhen6H+3 rNm0G6yBukDUNrAKaoRc/RllyBIcwFf0R2wZ8EGysWhtDAn0tRixxovEUzz/pyVhL9TR IXoCVd6uvDp8/1ulDkfLE9KFyr9UwsqW4LCpnQT8Otj0MIqHlLYyWinAjrKVUiK2i+mw 1QkhlhOzDf+cGnlw+RXmHKUlRGElTYehulpwgJ6YURYSQck3Cn7F27CfCdVJlmhAAHRw ncXb8Z0S7Xy8zJ5xMQAlg9OXsFL1SkG46qoJcck95LQMH1s6y+OQmtvDCrcCoCntxCxD +Xxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=yxiNJMoZrparSkb3fr/tsiJXT3d7SVAEkM9WSQugoN4=; b=AW5zkQ1vN8m+GtMOaRtmS9Ry60E/wTCQnSt08igru0T8dS8RjFADDALLzqKMFqEJfZ iCUO+O9Kqqfn89u64UOvqBaFe6kY1fpJ8XL466e3tLYZTc5HdRCcIrJ+2G2cdx4HT7gj 1Upq3loybpYf77ozaubMkyxeaiieVlKNB3mzZXLavbSEg3ebNRqn7GAxX/60UI2tFmKC tBpk9F8FYCFnfn+400pJ/WxaT8cWoPzXlCwPrVuub7q2alUa3QOSgUbeVIu820vdXi8Z udxjravWtGHZXEKieIcAHiDIXatMZXnLdJNvetobAv0iFuq0IeDt9YDLB9lVx8Ve5PI0 DaQg== 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 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si5608740edx.62.2020.04.15.13.58.40; Wed, 15 Apr 2020 13:59:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438737AbgDNK4g (ORCPT + 99 others); Tue, 14 Apr 2020 06:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2438400AbgDNKeJ (ORCPT ); Tue, 14 Apr 2020 06:34:09 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4883DC061A10; Tue, 14 Apr 2020 03:34:09 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jOItG-0008SS-BD; Tue, 14 Apr 2020 12:34:02 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id EB3B91C0086; Tue, 14 Apr 2020 12:34:01 +0200 (CEST) Date: Tue, 14 Apr 2020 10:34:01 -0000 From: "tip-bot2 for Josh Poimboeuf" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] objtool: Make BP scratch register warning more robust Cc: "Gustavo A. R. Silva" , Josh Poimboeuf , Borislav Petkov , x86 , LKML In-Reply-To: References: MIME-Version: 1.0 Message-ID: <158686044154.28353.9906241096479989820.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: b296695298d8632d8b703ac25fe70be34a07c0d9 Gitweb: https://git.kernel.org/tip/b296695298d8632d8b703ac25fe70be34a07c0d9 Author: Josh Poimboeuf AuthorDate: Wed, 01 Apr 2020 13:23:29 -05:00 Committer: Borislav Petkov CommitterDate: Tue, 14 Apr 2020 12:24:22 +02:00 objtool: Make BP scratch register warning more robust If func is NULL, a seg fault can result. This is a theoretical issue which was found by Coverity, ID: 1492002 ("Dereference after null check"). Fixes: c705cecc8431 ("objtool: Track original function across branches") Reported-by: Gustavo A. R. Silva Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/afc628693a37acd287e843bcc5c0430263d93c74.1585761021.git.jpoimboe@redhat.com --- tools/objtool/check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index cb2d299..4b170fd 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2005,8 +2005,8 @@ static int validate_return(struct symbol *func, struct instruction *insn, struct } if (state->bp_scratch) { - WARN("%s uses BP as a scratch register", - func->name); + WARN_FUNC("BP used as a scratch register", + insn->sec, insn->offset); return 1; }