Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3442092pxv; Sun, 18 Jul 2021 23:30:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDjZ2SifPEeGKIpM/kzOz+hvSpd//IeQP9xu+ERah31HchnbJyYC7j+OdCzUK75XzP1nN6 X-Received: by 2002:a05:6402:1118:: with SMTP id u24mr32680424edv.229.1626676228754; Sun, 18 Jul 2021 23:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626676228; cv=none; d=google.com; s=arc-20160816; b=why+5Y+T4LHSZ3yTTVz720mE5Sw6BuWHDC6ovPbihEKfdDyhTw14xyjGhyFkNV9m9o Y5AfjI13QY/nHhdvuvEMiswktybrJOHagqIHqpCInsFT/lQy+jL1QT8Hzv2lin2LFYjO Sd8vtCs7HzskYoA+VnGdtoxrvFLj3eA0j5tEOJZbFRHHdHB6V5SA1vtKbzdncIy+O5Mv qb9X2g4pbJa85EBiNEf1zNBEXLu/BDeRI4yHEyToQLWDIeByqZtgfn0PIQT5vfYUk9wx pzdXokN4JOsIgGPLTD79njAdDPTywVY04xksegix5b8jM3jNjYgpIeWiJSKSVkScm1bw Bh6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3lPCqQljJf2IbScxAFf1031HOfRkixI8y+inmwaEQLU=; b=BZ6OUAKRnVLGjL+DRsIKFNvTH+1p5qasNxG6yarCLmJpUjmIrhhiSaYYFsD5P2Im5Q h0X2Zz5GJBhWIlewpp1nydNGWFjIX00C+yCXrkKM+7XYlu/XJseo+CGfWQWSjxLEjeyi JPYW3Ev83ammiyjeS4Vj+L4HpV30dDCSB9+gXPXkGLvUW8+BDJEaRXumuXmYbX1jJv7T KzYGfxVLDw+UdiC91tuWXfEcldk0Uer45Xjc+MgW4erUR5clA3UenwGVZH5tEy09FHFK mz5UkxX4KbX7bS6SjiTtiE0JBtDJ8rNZOQoFh8zrWk/9TlU4OD0nCNZncidWbqEZsfXQ 5NZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z2jvnSeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm13si17252818ejc.590.2021.07.18.23.30.04; Sun, 18 Jul 2021 23:30:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z2jvnSeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234253AbhGSG36 (ORCPT + 99 others); Mon, 19 Jul 2021 02:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233632AbhGSG35 (ORCPT ); Mon, 19 Jul 2021 02:29:57 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ADBFC061767 for ; Sun, 18 Jul 2021 23:26:58 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id x25so28263950lfu.13 for ; Sun, 18 Jul 2021 23:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3lPCqQljJf2IbScxAFf1031HOfRkixI8y+inmwaEQLU=; b=z2jvnSeXzDI9LPibiAzjKQbSIyzToX8RVGLxm1q6JUMlUH1kl0pL+3wgTp6oW882g1 xyogIuA7XaCw1fRG5z7RhOMgH7biVV5AJlOQdCUiWu3H+tGYqv9Tt7WoqluESFL1MZMM OHBSr0ZQ02dme41z/gRxG57q+hi8wfHMVnKtqMsq3xhqnqG/s2gfePY6gNoS7TLPCo6k tke5hJgz9GFURVOKSr8GxysmbIi3gC/Mv9BHcGYzVkYS5BQUlGSei4TOQO5jBnXilObb DdjvuG4IVAo/JDgW2wnUXhK6joE88nG97kREx8s15jqnx1MJVFWv4ljjNeTnvwnZfN6v zioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3lPCqQljJf2IbScxAFf1031HOfRkixI8y+inmwaEQLU=; b=NLXWS8sf2HVG2nnguAr5O8FtVGvuxEYWhvMwppk6cuNnEdqibMEtFpoJLGUNio41Us ZIKZwvz0mqbzFwog1p/hpyJ1tOa9kiieu3UoTaPBlSnYfQSkzau5ElA3kcSNAzt34ZqH z5kmXf6Atd8VQwrdtSH+Dkf0NZUW3ylXi2qbCkPEvMSAKRNDbbtdVt6dltJhsdqRRhz7 7W2IcufQNguYthPrzlteALlKSL3VPuDT9+QYPfcHfl0fC0/ctd7v0L6fljT1Q4wHNfdS JPXPqAth5xL3kxXBgV/WPepmYDV/lJtz9XpRrQhCCohlC0tGMxWNy8Ql04MWKQ2IyYz+ xq9g== X-Gm-Message-State: AOAM533Bnj4XRg+TtSOPwIGiqNevKpAlxGCQXRgM2e4tLdyE0kcI6z6c cc4qWW+1fV71336onLbj4BWmhWLVig3m3UZptYqBPA== X-Received: by 2002:a19:c757:: with SMTP id x84mr17381730lff.302.1626676016627; Sun, 18 Jul 2021 23:26:56 -0700 (PDT) MIME-Version: 1.0 References: <20210716081722.4130161-1-andreas@rammhold.de> In-Reply-To: <20210716081722.4130161-1-andreas@rammhold.de> From: Sumit Garg Date: Mon, 19 Jul 2021 11:56:45 +0530 Message-ID: Subject: Re: [PATCH] KEYS: trusted: Fix trusted key backends when building as module To: Andreas Rammhold Cc: James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , James Morris , "Serge E . Hallyn" , linux-integrity , "open list:ASYMMETRIC KEYS" , "open list:SECURITY SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 16 Jul 2021 at 13:54, Andreas Rammhold wrote: > > Before this commit the kernel could end up with no trusted key sources > even thought both of the currently supported backends (tpm & tee) were s/thought/though/ > compoiled as modules. This manifested in the trusted key type not being s/compoiled/compiled/ > registered at all. > > When checking if a CONFIG_=E2=80=A6 preprocessor variable is defined we o= nly > test for the builtin (=3Dy) case and not the module (=3Dm) case. By using > the IS_ENABLE(=E2=80=A6) macro we to test for both cases. > s/to/do/ > Signed-off-by: Andreas Rammhold > --- > security/keys/trusted-keys/trusted_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Apart from minor nits above, add a corresponding fixes tag. With that: Reviewed-by: Sumit Garg -Sumit > diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/tr= usted-keys/trusted_core.c > index d5c891d8d353..fd640614b168 100644 > --- a/security/keys/trusted-keys/trusted_core.c > +++ b/security/keys/trusted-keys/trusted_core.c > @@ -27,10 +27,10 @@ module_param_named(source, trusted_key_source, charp,= 0); > MODULE_PARM_DESC(source, "Select trusted keys source (tpm or tee)"); > > static const struct trusted_key_source trusted_key_sources[] =3D { > -#if defined(CONFIG_TCG_TPM) > +#if IS_ENABLED(CONFIG_TCG_TPM) > { "tpm", &trusted_key_tpm_ops }, > #endif > -#if defined(CONFIG_TEE) > +#if IS_ENABLED(CONFIG_TEE) > { "tee", &trusted_key_tee_ops }, > #endif > }; > -- > 2.32.0 >