Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4011843ybv; Mon, 10 Feb 2020 10:33:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyWtJQlqHenNTP85M9fi6/CpMhLeC4wjQmGHtFTPwElf5GOhnRU4qBzQpOkUg2Zeon+YY1o X-Received: by 2002:a9d:6446:: with SMTP id m6mr1986955otl.122.1581359630047; Mon, 10 Feb 2020 10:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581359630; cv=none; d=google.com; s=arc-20160816; b=sxeUwywDvICJvTfmL1t291HVRtZd6KOugu35/7I80bdGRXsO6aDKfdYyeVqgRt9nCq bpmp4NH8j83uK9L3L9IyzQZ8G9cd/swMAxpUXRWNH0NhFGEgcINTHnV0dPyI1tDQPBRv qo9hJE5NtdkX7w/ykSnrtAZjyWzJ581DfRQUgL7IcJ27nRginSdbHddeN2L7xs8RO/6M 1O26pnXz98odDj9DzemhBJCKrITpyfaGO63RsMqFvTo7nHyTlqXaZHXrXf56izbO3JGx BHA4GdjbKmh6cp0M9UjcAtfr0pslwTjLTQ2sOdnuxA8kuLDTVz5S4pBh4+139uUGx4IB BpUA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/GXPd2YWBJrZzDlO3gX8t/00XYvRj8m5L7xKKx+UXkw=; b=cCOY2DKpvJu/ZbckgmxsfrTYvyCFIRcRfL40r+E1l/bLMYIpgLZHtOCIS8ctwlFfsV I4t3bZ97Rzpl7Em/Okg7Ai5UL22O6foh3YTgQRLwfooVK+6o0aO1R81FsXUo/2S01ZL5 do3j43aKJiza08wo4TBiCmz2AjdW4coTqVpJ8oH0UuE0bkriflum3SHXtxaVv6Ab3Mry 6hNQvHuNLyZQwHzDIvv74jiLzTickYRnMKkkZfINHe+UQbLHYkP3DS+lV0YMmUakEOrg Nr1DHXpIK0QtnJRdAYGo9y+xVyV2TMUrCtllUAx37OWSy56qB4GSkEsPekXTGIAf5weH 8vlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="g/fdp3Ur"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si463740oij.78.2020.02.10.10.33.38; Mon, 10 Feb 2020 10:33:50 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="g/fdp3Ur"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727710AbgBJSd0 (ORCPT + 99 others); Mon, 10 Feb 2020 13:33:26 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49402 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727669AbgBJSdY (ORCPT ); Mon, 10 Feb 2020 13:33:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581359603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/GXPd2YWBJrZzDlO3gX8t/00XYvRj8m5L7xKKx+UXkw=; b=g/fdp3Ur0yp5SU5XOch99BS3D8gZXGxoamb0d+pdxWL9cEzsJhPWmKC2dJQidFnhPZga26 LoG7RXUQGhvahYp9OZscGLZf0T+mmcyexCEXnpfxOFHkYMlMv+6TGfQr3IwNy+Zs1mrI8M HpEKoN/Dr3FjvnKQ2q5taLavjQwdgs8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-MJbc5WepOlqXZG9zSBn10Q-1; Mon, 10 Feb 2020 13:33:19 -0500 X-MC-Unique: MJbc5WepOlqXZG9zSBn10Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9E51100550E; Mon, 10 Feb 2020 18:33:18 +0000 (UTC) Received: from treble.redhat.com (ovpn-122-45.rdu2.redhat.com [10.10.122.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E70A10013A7; Mon, 10 Feb 2020 18:33:17 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Julien Thierry , Peter Zijlstra Subject: [PATCH 1/3] objtool: Fail the kernel build on fatal errors Date: Mon, 10 Feb 2020 12:32:38 -0600 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When objtool encounters a fatal error, it usually means the binary is corrupt or otherwise broken in some way. Up until now, such errors were just treated as warnings which didn't fail the kernel build. However, objtool is now stable enough that if a fatal error is discovered, it most likely means something is seriously wrong and it should fail the kernel build. Note that this doesn't apply to "normal" objtool warnings; only fatal ones. Suggested-by: Borislav Petkov Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index b6da413bcbd6..61d2d1877fd2 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2509,8 +2509,14 @@ int check(const char *_objname, bool orc) out: cleanup(&file); =20 - /* ignore warnings for now until we get all the code cleaned up */ - if (ret || warnings) - return 0; + if (ret < 0) { + /* + * Fatal error. The binary is corrupt or otherwise broken in + * some way, or objtool itself is broken. Fail the kernel + * build. + */ + return ret; + } + return 0; } --=20 2.21.1