Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4624158ybv; Mon, 10 Feb 2020 23:59:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwVke/uKPXEZKeZDSquU1dvrmBLKHtja5yhM6Lc444VgnzouO8P+x28Car0lcXmqNrn0Dkh X-Received: by 2002:a9d:2c2a:: with SMTP id f39mr4167112otb.301.1581407967250; Mon, 10 Feb 2020 23:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581407967; cv=none; d=google.com; s=arc-20160816; b=OZYFJrEz3811KHykzoLLJAghWlKBWQNyD0awrcgUDXTlFNPXH3MWG4Bf0FfOgcIPQN QAe4HUcz6H9dah7dEFHFmC9UITZ1U7wKQxkwgRu3fYUm14c1wm06r11QNVSw04SWRiVn TURWnW9LffndoKcH8CIRG+Q2W23TWheuNCbiDrAAdzLWJvmNLYTbaisuISExnnGPfTHz 5ALliXJlXMpAM4n+uTefjw2P2fA1NP4mmSV1yq9P+HfiYtebsvZwmUTO9VWY2/TCObIy ELAPlrF5NO0aywscY2s4GNIbNFP89K7Qh7QW6AbXxdEywqpwl/n94Hh5yyedA2t12yJT eRvw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1xwr64UV9VKg+sHvBjEA7Eu36dUv9exVUomu8ZIrlE0=; b=0+cDLMZssvvJWgy+VqJ5/jSfNGbDm6BLHxPx9YdSuS0TDUfp50QpnzO1agZenZILla GfmsEg71KGoN8F2tP3+P8XT5JiN7jYBwOAd+SlRMtYNReJeT/jYbrve0grb0HbJU1dlb P/VnZWCuW6qMjiRpyikkjfHob35QoARXwwKc0UNV20MUchnnOa+pcTSasNc+2LKOzzLO YupMXmleN0JqgUK6tmsrMUTpHUFgAWG/QLYRAWUgiJQBiAmNVGEuUSJG16Wn60cyKf82 RGgDMnrn+Lrdo8nmjF+6pm2nDGECMmS3/EBenakKR9T4WYNJddzLT4GP6mtzosEM702I siQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DYimQr9D; 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 25si1418728oiz.230.2020.02.10.23.59.15; Mon, 10 Feb 2020 23:59:27 -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=DYimQr9D; 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 S1727597AbgBKHvt (ORCPT + 99 others); Tue, 11 Feb 2020 02:51:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:42412 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727384AbgBKHvs (ORCPT ); Tue, 11 Feb 2020 02:51:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581407507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1xwr64UV9VKg+sHvBjEA7Eu36dUv9exVUomu8ZIrlE0=; b=DYimQr9Db0Q72sUy2LtSF8kt5XZyWf3nNuHNENtUWSKANMkgSc94JcamHabhunlJ64eVZD vjFgOSMoTgbKyo1MqJtGibQJRYoGdcmVfsm6ILzAWIqDPzfhvShv+iaUeQtqrPGOj2Kn5F 1Rdf43wgneL3LFjP1PF8KjpY9BBc4ME= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-178-p8hRxa60Pz2c7ZvQleE9Mw-1; Tue, 11 Feb 2020 02:51:44 -0500 X-MC-Unique: p8hRxa60Pz2c7ZvQleE9Mw-1 Received: by mail-wr1-f70.google.com with SMTP id o9so5850726wrw.14 for ; Mon, 10 Feb 2020 23:51:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1xwr64UV9VKg+sHvBjEA7Eu36dUv9exVUomu8ZIrlE0=; b=kn1UM7zAHEZXRQYXXTsw0GJNSfVqfOSEgkwn+bIt8cAfZ7rPWSbnHJl8XB5U7LEkCw /HeEg2T0i/xmEfDgBEnW3qVkB7iUvYNUayynzK5+ycak0m65gDkd39+SBU6+vmDzzMGF J95R2ZkYye6WgMImX3J96AvjnSyTxgup2sHZ5cmDsBjqFCr3/t7v45y/zypn5ZrXzcIE LrMgOuxl659HV4G0/U1dWZ06+fNK9FTviqaD4joJV5R3oM7iAkIjjSXfPQ8FWTVDOXxk 7wmjzTHnrVuSt1/VfURE1ZbnUiXSr2SteDC0qC5ogCQ3iEUsJJ96QBJYU3UudRZaJvjJ 0IYg== X-Gm-Message-State: APjAAAVadtWxDmymd62GcN+9xeaiug8/rSfvq3L6tbsLESvpZxPRzh9c KBYXxXFeXzAVt+nxihaLyUXxyX6lWaTDXOa1Sq4u0FgXX6vqrf+G3gNJtj7rJVNqHNi0jPU1Hbb rDwha5TJjdkIvPjrQHifFJqHW X-Received: by 2002:a05:600c:2c08:: with SMTP id q8mr4116355wmg.45.1581407503169; Mon, 10 Feb 2020 23:51:43 -0800 (PST) X-Received: by 2002:a05:600c:2c08:: with SMTP id q8mr4116311wmg.45.1581407502685; Mon, 10 Feb 2020 23:51:42 -0800 (PST) Received: from ?IPv6:2a01:cb14:58d:8400:ecf6:58e2:9c06:a308? ([2a01:cb14:58d:8400:ecf6:58e2:9c06:a308]) by smtp.gmail.com with ESMTPSA id g15sm4216078wro.65.2020.02.10.23.51.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Feb 2020 23:51:41 -0800 (PST) Subject: Re: [PATCH 1/3] objtool: Fail the kernel build on fatal errors To: Josh Poimboeuf , x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Peter Zijlstra References: From: Julien Thierry Message-ID: Date: Tue, 11 Feb 2020 07:51:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/10/20 6:32 PM, Josh Poimboeuf wrote: > 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 Reviewed-by: Julien Thierry > --- > 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); > > - /* 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; > } > -- Julien Thierry