Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp586906pxb; Wed, 3 Mar 2021 10:07:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdrGsLg7CsurNVo6vKS6T9R3wS6WGXWvz49B0orlHDKM80hCEEBd1+msEaILSux+7wNUvR X-Received: by 2002:a05:6402:5255:: with SMTP id t21mr527724edd.91.1614794837597; Wed, 03 Mar 2021 10:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614794837; cv=none; d=google.com; s=arc-20160816; b=l2FBV9r1lUif7JZXsDwE4Z4PVpRMZKupWeDyfxbxfMBlqu/JrW6I0KQUr2ul7oe8/i 7O28r2lHEDziCgkareny3irUdi43LWfQYMiPAgB0MWltzGm1H7jy6SkGi+tqYicKNiAu jG3DJBT1+1Nw1D8ftHfo1tBFjpoI7JXiYLBKF+Q7BlVsEMYpfhjpxtu0iub8Kr1NxnzP OzXzS13zrd8kG0enroSCDosLRKTOoELQRXS2nsfOorud9cLb566z66cAlqh7KAkkXfNf Whih806ybdPd07XbZJ5y6OrYgHEuv9emyGvy9xEKFm2w+QgJEWmMbFnifu/TsQ6atgzs LRCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9C1fU0uWkLLGVJbkKUEou9OOYCljnFKZWf9eI85f8F4=; b=CSYy973tc5VJqJrTMNrbeqjon8Wk8RjANA3MKdY7/9m0kRbG/xb4BS4ibZGS1ka+En ReaJ0TjfXfW6dI+kSkdtbYWE50aXEmBkspGj63CEuGnJnxUIgqE2hiLiMWcJ78WRwY8A WNEnLWhX0vkUop/xT+Sdrkc/Z3XxDT4+Ahg8ncQ80dnnrNj7w/Wc5cajB/yN4com0UH7 65iT0/BVeiRCeEoGvCDh15fqdSKu4lAw3xuKbNljuTHqVFp7tg0odjgYBh7YiUa1qMU0 kXUVXybtjfnyHn+8ygWNvr6jb9oqg1LUXYavlRT4ELfGyn7n6NgcF9X5hxkk50reQ8MY NJyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IPNYyNsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si15410680eja.499.2021.03.03.10.06.40; Wed, 03 Mar 2021 10:07:17 -0800 (PST) Received-SPF: pass (google.com: 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IPNYyNsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345522AbhCBBB2 (ORCPT + 99 others); Mon, 1 Mar 2021 20:01:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:57862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240505AbhCASvl (ORCPT ); Mon, 1 Mar 2021 13:51:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5289B651D9; Mon, 1 Mar 2021 17:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619063; bh=uP7mQNgwM7Rbwp/Ix+ydTucyo811l6od4IsmZCIrln8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPNYyNspdgriYo5/WQXLeZ60Zb8tbyf+f3x/8+i3I7QQmncBDJOZVXRXVAcVaFlVF gHwF6Nhyx6Jt2pi5+eZ1VRRN9wFeq+w8dle4Rwh+VWw26X/QUNnvy29eWOxqmxcrlT ztgU/N1SBBasHAdhVzY5xWpzB8ogTVJfF4uQSGtQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Poimboeuf , Sasha Levin Subject: [PATCH 5.10 318/663] objtool: Fix error handling for STD/CLD warnings Date: Mon, 1 Mar 2021 17:09:26 +0100 Message-Id: <20210301161157.586030420@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf [ Upstream commit 6f567c9300a5ebd7b18c26dda1c8d6ffbdd0debd ] Actually return an error (and display a backtrace, if requested) for directional bit warnings. Fixes: 2f0f9e9ad7b3 ("objtool: Add Direction Flag validation") Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/dc70f2adbc72f09526f7cab5b6feb8bf7f6c5ad4.1611263461.git.jpoimboe@redhat.com Signed-off-by: Sasha Levin --- tools/objtool/check.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4bd30315eb62b..2e154f00ccec2 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2592,15 +2592,19 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, break; case INSN_STD: - if (state.df) + if (state.df) { WARN_FUNC("recursive STD", sec, insn->offset); + return 1; + } state.df = true; break; case INSN_CLD: - if (!state.df && func) + if (!state.df && func) { WARN_FUNC("redundant CLD", sec, insn->offset); + return 1; + } state.df = false; break; -- 2.27.0