Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4055835pxv; Mon, 26 Jul 2021 20:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8MFU7T2J0myBM4eviEyTYlSBwmDFCUzxZf7Xa4cYZyZ3IWqDSnuvS11pA0kLtDCMPuIl/ X-Received: by 2002:a92:b105:: with SMTP id t5mr86764ilh.70.1627355100807; Mon, 26 Jul 2021 20:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627355100; cv=none; d=google.com; s=arc-20160816; b=r/N6CuGg3MbKhkWB4fD60RSHMnNHJ5u6q8FWaEaQITIuJ6Se2N7PNOt6dPgHhnU6rP Yigbp7zwhuKBxFgp6DyT/st5nUa+W8R3lFduBy2kvLOqNbwO73pTGJ0QbYDxoarc8a/R 3pv/xpM8Lr86mwoS6e/fycAfzeK08FUz5VBIk1OIeZoUdcRpt4PUGks4myhKc9jLRawK 3XToGylMvAmnr5LaG3gdFKDt9TMpFHY4oiiaEyMl+9sSZvRi5a/mnrZ13SFgHAjBoetL STOS2HHu++sZ4mUcxbzg6or333Mpl20Z2LipQemgd+Q9vCDmRQDxU0j4m/LANNNucLe5 zJQw== 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=VxK8v2ZYVmBxS+wJGf/gDi3pJNZOSLD4fOKdOjOsblY=; b=ztMWkSp6k9Cw2d6EFP9aL6l2+boh9FEAdjGD60vmCRRvBBLB2d3e/66KYTn44qX+gO V7QIdtsDx53L0opBQbQFUFkz1ElLl1GtTlwFiq7ecar6sUd4y02YZMe/0i8CgRRv7uvz 3yg+kIXf+qlDmuTGeacQ2WSViIJpIbHD9e89/1xeMQyWefP2GzqzqaENov34jVrP7piJ hmRk/qV61hBp2zd3cVWrdfuUgzCoLt/KGwDWAFIagWWIKStTBnnnjZjOiwDfI1J+U6at yAexS6T88QwHa4o/YlpnFkulmTipD/fkc+fiO8o4OOGrmbyDTQRA2CoUdV9/Scj7SHVM 2AWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vr6cMg1i; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si1852420iow.19.2021.07.26.20.04.39; Mon, 26 Jul 2021 20:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@kernel.org header.s=k20201202 header.b=Vr6cMg1i; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S234506AbhG0CYJ (ORCPT + 99 others); Mon, 26 Jul 2021 22:24:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:43162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234410AbhG0CYI (ORCPT ); Mon, 26 Jul 2021 22:24:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 918AE60F37; Tue, 27 Jul 2021 03:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627355076; bh=NoNG3HMOoFeriKHuTX27SrspK+aiELmkIyT/xa1pg0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vr6cMg1ii8OiAHffWs0zpPUodH3YMHRGkx2JxfoPafdAVo/IrNXa1yuUeoyl0x3Fg DNduHObK6Digzik63bYtw831teVRZx3rCttdsO8cnyDp7aYf1OIoY4Qv4G/Y6GepCh ewOdixo20NCtjSDHATTw1WcCr9UfF7O+IQGcbW/wV+gU2A7UgI0EC3wiXAjO34J2Tk 6rEGdDScF+037Oz9NpQqKVfzfr9DtKhxiiioDrXhb5zAUuJzVt8oydQsHFB2Aifu6a bgS7ILG+ALeHx0lgP1aMEKkBKpYC4SH5DyVIsJAHCC98Prx6oeDKva910y8rzj3Wk9 hxpYtDrwyyMKw== Date: Tue, 27 Jul 2021 06:04:33 +0300 From: Jarkko Sakkinen To: Ahmad Fatoum Cc: James Morris , "Serge E. Hallyn" , James Bottomley , Mimi Zohar , Sumit Garg , David Howells , Herbert Xu , "David S. Miller" , kernel@pengutronix.de, Andreas Rammhold , David Gstir , Richard Weinberger , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org Subject: Re: [PATCH v2] KEYS: trusted: fix use as module when CONFIG_TCG_TPM=m Message-ID: <20210727030433.3dwod2elwtdkhwsc@kernel.org> References: <20210721160258.7024-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210721160258.7024-1-a.fatoum@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 21, 2021 at 06:02:59PM +0200, Ahmad Fatoum wrote: > Since commit 5d0682be3189 ("KEYS: trusted: Add generic trusted keys > framework"), trusted.ko built with CONFIG_TCG_TPM=CONFIG_TRUSTED_KEYS=m > will not register the TPM trusted key type at runtime. > > This is because, after that rework, CONFIG_DEPENDENCY of the TPM > and TEE backends were checked with #ifdef, but that's only true > when they're built-in. > > Fix this by introducing two new boolean Kconfig symbols: > TRUSTED_KEYS_TPM and TRUSTED_KEYS_TEE with the appropriate > dependencies and use them to check which backends are available. > > This also has a positive effect on user experience: > > - It's now possible to use TEE trusted keys without CONFIG_TCG_TPM > - It's now possible to enable CONFIG_TCG_TPM, but exclude TPM from > available trust sources > - TEE=m && TRUSTED_KEYS=y no longer leads to TEE support > being silently dropped > > Any code depending on the TPM trusted key backend or symbols exported > by it will now need to explicitly state that it > > depends on TRUSTED_KEYS && TRUSTED_KEYS_TPM > > The latter to ensure the dependency is built and the former to ensure > it's reachable for module builds. This currently only affects > CONFIG_ASYMMETRIC_TPM_KEY_SUBTYPE, so it's fixed up here as well. > > Reported-by: Andreas Rammhold > Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") > Signed-off-by: Ahmad Fatoum Is it absolutely need to do all this *just* to fix the bug? For a pure bug fix the most essential thing is to be able the backport it to stable kernels. I don't really care at all about extra niceties ("it's now possible stuff). This looks like a bug fix and improvements bundle into a single patch. /Jarkko