Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3095037iog; Mon, 27 Jun 2022 09:02:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uChQLsyF28qM5aPAR/jtK29687yIzO51O8TQOMpwLTJOK/S4hNZv1TKzjmH/DYS4a+5xW0 X-Received: by 2002:a63:3409:0:b0:40c:9736:287 with SMTP id b9-20020a633409000000b0040c97360287mr13478243pga.14.1656345750983; Mon, 27 Jun 2022 09:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656345750; cv=none; d=google.com; s=arc-20160816; b=wPLQqcXiDgvOlGIluDMUvpxrhkWYPsyy86oUVdwBNgu2Vf39IaW7GVNq6u4N8RsTOT cGeq1YdgfO0h+liv++wKiQjPECcI4NzxpirRJUnnDhu5++zQhHG94tfZ0pKKW8YZzYAV 5lx5AYxD5/KTK2UZk7jdYcP72j0UHwknRMG89waUBqpLDkhkQZvoaMJzSr349rHvRw8p Yh5FjhjCXqn5f99t5e/ekShi8jB33y+IRZhHR9TPyCU9ir/5+bzHy9EQu5KBECqzd5Il MoHsYESBxZ+sPhBioPbNOEj41y7oi9RZ69wqviJweANntgl46SbaKklen5DYxTxS44Yc EfaA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0M1pQcOKied9vqnWW/vxW+YZhV9nZDUGj0eSUFDJbwg=; b=qVzwpJJ6PLqbYf7aie72KITah5S6upFAmKPQzTma+g39sn0rSpS3VT/ExR7LMzIdOt Vtc8GX2G8asIcm2jbciFYhY5XZopC0perKmtBb1pGNtgMVzOLm+Bho0rILWHFpzZxS63 DmP0uaPW9x9EQJNiFuofe/o8pYg12crr6GZnNm6nP61sAYjDAHideMuU+RngjjizBDmz s2QYdK67f+Cw2dGQA02UATDauVilQ/PVImcbwhbsDATTwooiSjOU//t6OniCL25Sep1i sEybc1OCbSAzjEoQP9YEcrhB95+2kd4kBeU9K4Uh+v7DW0H9RqHKinPDh8ITcPP6V/Vc kE9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cv61qlgr; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a638842000000b0040d6ea07ccbsi14995889pgd.42.2022.06.27.09.02.13; Mon, 27 Jun 2022 09:02:30 -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=@chromium.org header.s=google header.b=Cv61qlgr; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238775AbiF0Pfy (ORCPT + 99 others); Mon, 27 Jun 2022 11:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238567AbiF0Pfk (ORCPT ); Mon, 27 Jun 2022 11:35:40 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7CB31A829 for ; Mon, 27 Jun 2022 08:35:37 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id c205so9358842pfc.7 for ; Mon, 27 Jun 2022 08:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0M1pQcOKied9vqnWW/vxW+YZhV9nZDUGj0eSUFDJbwg=; b=Cv61qlgrIl9Hv9WvUrykcJQWqfl6bT/dGI9EfXEXeQMObQcjF8qFPkJ4lxEIMKZQM+ Tdw34lCxt44f5k2/Z7ulr6Lvy6lknHiv+9DdCmdMfimmwemlRrIpnNtY3WNnOhzWLM56 9ocMgnjpRORfrpUiHF2ZQh+9fKbVOvnIBjg5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0M1pQcOKied9vqnWW/vxW+YZhV9nZDUGj0eSUFDJbwg=; b=PW/eOQutXafJEKh4pgDL5QFWG9AhoLDMdZ98nPsl6/iuyYuT8TJiuhzNi8iiOgqHxd i/INqI+xAxZLWUFs0ke2kK3lAF7gjA/oPyExYF6TvhDrxYyphOGBlU/KlxtKai3Lc/1b 2UItXjNxlhqdeaozo3ZYxm7K3aza3p1hjq+S6KGlvsCxhlhpuzE09tO+sg8i8Q5MAgtW ycVxRnlVU7WMQ8K6ywzhYZ2i2+Ws9ckoZvUcHkJlxn1J11N0U7OZOwFsuBVzmlBs8kAJ LtxgAdAxqKuLgfoHKyRs4mZj1Lb1P+f+Z8uZ0IBY4GVmLIvdqWGFMmdYXeiG+WO/yiwY iyrA== X-Gm-Message-State: AJIora9u4O+q3nhEkQ2o04LOTTyXXkAlyXGuTJbdbtUXKJlx9RSXrTTH nERURTx2jPuBPPTPWF4690t77g== X-Received: by 2002:a63:8f56:0:b0:40c:9877:9f51 with SMTP id r22-20020a638f56000000b0040c98779f51mr13147028pgn.206.1656344137416; Mon, 27 Jun 2022 08:35:37 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:f31c:687c:3a61:62c5]) by smtp.gmail.com with UTF8SMTPSA id cd21-20020a056a00421500b0051b32c2a5a7sm7434309pfb.138.2022.06.27.08.35.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 08:35:37 -0700 (PDT) From: Matthias Kaehlcke To: Alasdair Kergon , Mike Snitzer , Kees Cook , James Morris , "Serge E . Hallyn" Cc: linux-security-module@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu , Milan Broz , dm-devel@redhat.com, Douglas Anderson , linux-kernel@vger.kernel.org, Matthias Kaehlcke Subject: [PATCH v7 3/3] dm: verity-loadpin: Use CONFIG_SECURITY_LOADPIN_VERITY for conditional compilation Date: Mon, 27 Jun 2022 08:35:26 -0700 Message-Id: <20220627083512.v7.3.I5aca2dcc3b06de4bf53696cd21329dce8272b8aa@changeid> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220627153526.3750341-1-mka@chromium.org> References: <20220627153526.3750341-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 The verity glue for LoadPin is only needed when CONFIG_SECURITY_LOADPIN_VERITY is set, use this option for conditional compilation instead of the combo of CONFIG_DM_VERITY and CONFIG_SECURITY_LOADPIN. Signed-off-by: Matthias Kaehlcke Acked-by: Kees Cook --- Changes in v7: - none Changes in v6: - none Changes in v5: - added 'Acked-by' tag from Kees Changes in v4: - none Changes in v3: - none Changes in v2: - none drivers/md/Makefile | 7 +------ include/linux/dm-verity-loadpin.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/md/Makefile b/drivers/md/Makefile index 71771901c823..a96441752ec7 100644 --- a/drivers/md/Makefile +++ b/drivers/md/Makefile @@ -83,6 +83,7 @@ obj-$(CONFIG_DM_LOG_WRITES) += dm-log-writes.o obj-$(CONFIG_DM_INTEGRITY) += dm-integrity.o obj-$(CONFIG_DM_ZONED) += dm-zoned.o obj-$(CONFIG_DM_WRITECACHE) += dm-writecache.o +obj-$(CONFIG_SECURITY_LOADPIN_VERITY) += dm-verity-loadpin.o ifeq ($(CONFIG_DM_INIT),y) dm-mod-objs += dm-init.o @@ -108,12 +109,6 @@ ifeq ($(CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG),y) dm-verity-objs += dm-verity-verify-sig.o endif -ifeq ($(CONFIG_DM_VERITY),y) -ifeq ($(CONFIG_SECURITY_LOADPIN),y) -dm-verity-objs += dm-verity-loadpin.o -endif -endif - ifeq ($(CONFIG_DM_AUDIT),y) dm-mod-objs += dm-audit.o endif diff --git a/include/linux/dm-verity-loadpin.h b/include/linux/dm-verity-loadpin.h index fb695ecaa5d5..552b817ab102 100644 --- a/include/linux/dm-verity-loadpin.h +++ b/include/linux/dm-verity-loadpin.h @@ -15,7 +15,7 @@ struct dm_verity_loadpin_trusted_root_digest { u8 data[]; }; -#if IS_ENABLED(CONFIG_SECURITY_LOADPIN) && IS_BUILTIN(CONFIG_DM_VERITY) +#if IS_ENABLED(CONFIG_SECURITY_LOADPIN_VERITY) bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev); #else static inline bool dm_verity_loadpin_is_bdev_trusted(struct block_device *bdev) -- 2.37.0.rc0.161.g10f37bed90-goog