Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp798585iog; Wed, 15 Jun 2022 12:34:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1smE6NykBW0fStBsF1CU6mWmgH15viwnP0nJiBnlc56n7Ynitpi+dk3La1FEbqwliPt4bMU X-Received: by 2002:a17:906:f84:b0:711:eda5:db31 with SMTP id q4-20020a1709060f8400b00711eda5db31mr1185499ejj.397.1655321692961; Wed, 15 Jun 2022 12:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655321692; cv=none; d=google.com; s=arc-20160816; b=QGCf3Uby/ekmydnx7PJ1ePG57HB6GCwOrBMpNd9xJ1pAgknjeaOr6bgU5ZZeyVoVnI s49r5AlJurM4EqxrOur/1U+49cuYJ6GPfVOBHRAicBjpt51gR78ZgwUkvE0USPxF270u Mkj2ln+h94Xk0Wkrb//eP42EY9cWsnDEoTCs/uvkUPXef79gnFparBJRoZufC0i7wbcP uKauV08LO0ChHqoOBWqT1oGUpAnmLKD+udRBpuscIOGiSQknVBTxdv4bjSDlhmx5f9Dr Ildf6jHfElVACOoCaasweXthiehQCFr4nvIJ/mA1yk0hHrC4yiCputhrPr69rkM9S5uQ 4gmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=i5a1MfRN9xqdiagNu5bkg/R57XwtZIb9GOm3NdU8vJg=; b=apRcZt0iWAeimh6+SG4gZmuFFrDZjnehIfFkJxaBVthzZFIpLxHACrMBdXBPcGXl7q uXrkin6jqaUODymT7Tlr7l3OSbws+Mj8/J45p32G6SnXZ8q6jzApxqy8RB7pptxAcGpa 2A+FvcOuKrIzf1iePEsJfZ3VnEGmlJnJOLmUse/BzMmNsQ2f7ojv1IYlUTCBuOwkh12t 9MOwsb073rJqF0zD/kOxQVwZiH2FlCAez1YYF75SudKe2IWSnieWt+OgigVXqKjZXluF wJXi0rHKSoMiDSZT9gz5RFOlY+Ou9uuQ+SNsBG3s8Ec/kGX4v6GSFIw3ucCbRxFPrRzI 9wEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNh5+606; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs11-20020a170906dc8b00b006feb8cc7e2asi17058744ejc.503.2022.06.15.12.34.26; Wed, 15 Jun 2022 12:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNh5+606; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242694AbiFOSso (ORCPT + 99 others); Wed, 15 Jun 2022 14:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350694AbiFOSsj (ORCPT ); Wed, 15 Jun 2022 14:48:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3510A46CA2; Wed, 15 Jun 2022 11:48:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D7048B82147; Wed, 15 Jun 2022 18:48:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E0F2C34115; Wed, 15 Jun 2022 18:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655318914; bh=gFgJoLcVfJvasnO7FW/JzbZ+FTFFcVnpa5JhwcKj5JQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bNh5+606GjmDrqcvI199hr0z0cObdndVk1nkJvJWKRbZ2o3MfbvvxdEabl1fie+LT 7HQe06Ps1CuPB7iRnJZ8Ns/seKG1qowF8wKSNs4U9gBv3bbisERgl17H1BiIKCrp1t hiBYWTjPQFTowbISaEK1rd5ED84h2u06IKFC8OePJoqCJobAxAMdiiY4BnMah2bfnq qBjC95wR078y4VBUAD2uHzaifNigJSgzKaSEK/KIPdQIpLJcFitPdCar3QNOxN4SXT cYFRb+j7py7RM0t+9Sik6/6VGcg4u7YkQjYUhPAYFOkCQeLgvQsd7y2D12AEpxDx9Q 8Qlq85dUW86ZQ== Date: Wed, 15 Jun 2022 21:46:25 +0300 From: Jarkko Sakkinen To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, David Howells , =?utf-8?B?TWlja2Hvv73vv73vv71sIFNhbGHvv73vv73vv71u?= , David Woodhouse , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] certs: fix and refactor CONFIG_SYSTEM_BLACKLIST_HASH_LIST build Message-ID: References: <20220611172233.1494073-1-masahiroy@kernel.org> <20220611172233.1494073-2-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220611172233.1494073-2-masahiroy@kernel.org> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 12, 2022 at 02:22:31AM +0900, Masahiro Yamada wrote: > Commit addf466389d9 ("certs: Check that builtin blacklist hashes are > valid") was applied 8 months after the submission. > > In the meantime, the base code had been removed by commit b8c96a6b466c > ("certs: simplify $(srctree)/ handling and remove config_filename > macro"). > > Fix the Makefile. > > Create a local copy of $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST). It is > included from certs/blacklist_hashes.c and also works as a timestamp. > > Send error messages from check-blacklist-hashes.awk to stderr instead > of stdout. > > Fixes: addf466389d9 ("certs: Check that builtin blacklist hashes are valid") > Signed-off-by: Masahiro Yamada > --- > > certs/.gitignore | 2 +- > certs/Makefile | 20 ++++++++++---------- > certs/blacklist_hashes.c | 2 +- > 3 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/certs/.gitignore b/certs/.gitignore > index 56637aceaf81..cec5465f31c1 100644 > --- a/certs/.gitignore > +++ b/certs/.gitignore > @@ -1,5 +1,5 @@ > # SPDX-License-Identifier: GPL-2.0-only > -/blacklist_hashes_checked > +/blacklist_hash_list > /extract-cert > /x509_certificate_list > /x509_revocation_list > diff --git a/certs/Makefile b/certs/Makefile > index cb1a9da3fc58..a8d628fd5f7b 100644 > --- a/certs/Makefile > +++ b/certs/Makefile > @@ -7,22 +7,22 @@ obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o c > obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o > obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o > ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),) > -quiet_cmd_check_blacklist_hashes = CHECK $(patsubst "%",%,$(2)) > - cmd_check_blacklist_hashes = $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(2); touch $@ > > -$(eval $(call config_filename,SYSTEM_BLACKLIST_HASH_LIST)) > +$(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list > +CFLAGS_blacklist_hashes.o := -I $(obj) > > -$(obj)/blacklist_hashes.o: $(obj)/blacklist_hashes_checked > +quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@ > + cmd_check_and_copy_blacklist_hash_list = \ > + $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ > + cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@ > > -CFLAGS_blacklist_hashes.o += -I$(srctree) > - > -targets += blacklist_hashes_checked > -$(obj)/blacklist_hashes_checked: $(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(SYSTEM_BLACKLIST_HASH_LIST_FILENAME) scripts/check-blacklist-hashes.awk FORCE > - $(call if_changed,check_blacklist_hashes,$(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(CONFIG_SYSTEM_BLACKLIST_HASH_LIST)) > +$(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE > + $(call if_changed,check_and_copy_blacklist_hash_list) > obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o > else > obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o > endif > +targets += blacklist_hash_list > > quiet_cmd_extract_certs = CERT $@ > cmd_extract_certs = $(obj)/extract-cert $(extract-cert-in) $@ > @@ -33,7 +33,7 @@ $(obj)/system_certificates.o: $(obj)/x509_certificate_list > $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE > $(call if_changed,extract_certs) > > -targets += x509_certificate_list blacklist_hashes_checked > +targets += x509_certificate_list > > # If module signing is requested, say by allyesconfig, but a key has not been > # supplied, then one will need to be generated to make sure the build does not > diff --git a/certs/blacklist_hashes.c b/certs/blacklist_hashes.c > index d5961aa3d338..86d66fe11348 100644 > --- a/certs/blacklist_hashes.c > +++ b/certs/blacklist_hashes.c > @@ -2,6 +2,6 @@ > #include "blacklist.h" > > const char __initconst *const blacklist_hashes[] = { > -#include CONFIG_SYSTEM_BLACKLIST_HASH_LIST > +#include "blacklist_hash_list" > , NULL > }; > -- > 2.32.0 > Reviewed-by: Jarkko Sakkinen BR, Jarkko