From patchwork Mon Apr 18 21:15:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 12817403 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EBC5C4167D for ; Tue, 19 Apr 2022 06:10:50 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-320-eu8UM1HWPkCSSLdl_-IPkQ-1; Tue, 19 Apr 2022 02:10:45 -0400 X-MC-Unique: eu8UM1HWPkCSSLdl_-IPkQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F1273C01DBC; Tue, 19 Apr 2022 06:10:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C2F2C53521; Tue, 19 Apr 2022 06:10:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BDBEB194EBB4; Tue, 19 Apr 2022 06:10:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 30B441947BBB for ; Mon, 18 Apr 2022 21:16:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 161AB454D64; Mon, 18 Apr 2022 21:16:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1213B440ABF for ; Mon, 18 Apr 2022 21:16:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F03751C05B11 for ; Mon, 18 Apr 2022 21:16:18 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-182-m0dUR48GNLurq4H8kSt0Gg-1; Mon, 18 Apr 2022 17:16:13 -0400 X-MC-Unique: m0dUR48GNLurq4H8kSt0Gg-1 Received: by mail-pl1-f169.google.com with SMTP id d15so13329804pll.10 for ; Mon, 18 Apr 2022 14:16:12 -0700 (PDT) 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=qm/BmS5rZykflggAWLelmGp8fWeLhZCgEzC+nt/A6s4=; b=kn3wmdizeeJQEpDrA66nLMNtgbtJuPYjCRAX36jz9hedt0hpHryDZjUv2m+LehPTo3 B0f8YHyIsmFYa83EbrUJgxXsdGFeoyDWUZaSYHdvxB36JC87BWedGMlxqv254LuFXJ5e 2wpERYNOuPzsfwTp2gGiw4k62wa41WWtZUA+1PytC+g1848CUAojoref7aEgdldP5bpL hg/LxB42XLxPiaEl0Sx9Z5wXVIekQgnw5iilZF/47JlSEsJ2+rlmCd4XpZ3jHCtibFS+ SWLcx5RMxpl3g6YeCTYp1ZRolIsH32ETq/v6pP8YymDkKshtQNYTQD0hhT+8k7/IZvEr 9hFQ== X-Gm-Message-State: AOAM530UutIuQ6yiX6siwjpaiPHh8xoWNtBK6Zv8djn6RsVZLo4iVfBh Gebn45x5J3w3LMLLJdJDujoQvw== X-Google-Smtp-Source: ABdhPJwvT6hPqXjTca3Xc2+bb0JBOY7ovGiOak9BOvmgcSEBCUg/Tyd1ChxcMzkWocvs0mSZVqmGYw== X-Received: by 2002:a17:90b:4b01:b0:1d2:abf5:c83f with SMTP id lx1-20020a17090b4b0100b001d2abf5c83fmr4999347pjb.93.1650316571711; Mon, 18 Apr 2022 14:16:11 -0700 (PDT) Received: from localhost ([2620:15c:202:201:6b32:a0a5:ec32:c287]) by smtp.gmail.com with UTF8SMTPSA id d16-20020a17090a02d000b001cba39c88fcsm1487068pjd.0.2022.04.18.14.16.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Apr 2022 14:16:11 -0700 (PDT) From: Matthias Kaehlcke To: Alasdair Kergon , Mike Snitzer , Kees Cook , James Morris , "Serge E . Hallyn" Date: Mon, 18 Apr 2022 14:15:59 -0700 Message-Id: <20220418141545.3.I5aca2dcc3b06de4bf53696cd21329dce8272b8aa@changeid> In-Reply-To: <20220418211559.3832724-1-mka@chromium.org> References: <20220418211559.3832724-1-mka@chromium.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mailman-Approved-At: Tue, 19 Apr 2022 06:10:27 +0000 Subject: [dm-devel] [PATCH 3/3] dm: verity-loadpin: Use CONFIG_SECURITY_LOADPIN_VERITY for conditional compilation X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dm-devel@redhat.com, linux-kernel@vger.kernel.org, Douglas Anderson , linux-raid@vger.kernel.org, Song Liu , linux-security-module@vger.kernel.org, Matthias Kaehlcke Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 --- 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 e12cd004d375..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 @@ -100,12 +101,6 @@ ifeq ($(CONFIG_IMA),y) dm-mod-objs += dm-ima.o endif -ifeq ($(CONFIG_DM_VERITY),y) -ifeq ($(CONFIG_SECURITY_LOADPIN),y) -dm-mod-objs += dm-verity-loadpin.o -endif -endif - ifeq ($(CONFIG_DM_VERITY_FEC),y) dm-verity-objs += dm-verity-fec.o endif diff --git a/include/linux/dm-verity-loadpin.h b/include/linux/dm-verity-loadpin.h index 12a86911d05a..be63ac76f98d 100644 --- a/include/linux/dm-verity-loadpin.h +++ b/include/linux/dm-verity-loadpin.h @@ -13,7 +13,7 @@ struct trusted_root_digest { struct list_head node; }; -#if IS_ENABLED(CONFIG_SECURITY_LOADPIN) && IS_BUILTIN(CONFIG_DM_VERITY) +#if IS_ENABLED(CONFIG_SECURITY_LOADPIN_VERITY) void dm_verity_loadpin_set_trusted_root_digests(struct list_head *digests); bool dm_verity_loadpin_is_md_trusted(struct mapped_device *md); #else