Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4052561pxv; Mon, 26 Jul 2021 19:59:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbvi0OtJsrwH9ZmCpSU53IO7lYXoFUXYMT9+xV8wb3va0cdtiVwjevmGz3OreoKL4qt4u4 X-Received: by 2002:a05:6402:1595:: with SMTP id c21mr17776387edv.354.1627354747146; Mon, 26 Jul 2021 19:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627354747; cv=none; d=google.com; s=arc-20160816; b=q85kLuSO6pXbPIHMu+h1hQnqLSCSPtoqvk0vsT75CwVnNXr5j76ZFZOc/4tLsUjm4y u+R+9TZzie6yLBb5Ig16sm2oT32cr0fRTWBSOXS0OkkOe203Jvv9xCSvni1U3iMNIXZ4 GOXZUm0gBxHhIOYCxHR8jTzv3Ka7SsR2+O9OR+GgyxGsEYvrepQ8gV2VsJpsU0/Bqz5I OPB18mmxBhrEJjaQiQjVdQ20bL0lW3pTFUDw+6UEZq5B/Dx8vurfG7bgEPqzHD3G8dH6 EvT7TtYNVsHkl4/nG/8q8aEgUf+2MjDKE4ZC9M4cjqQgew3GCPVSq1t15Ys8Ftf326eV fR4Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=p503MzbhdGvOyp7OzZp035ZOlew6KuG4sFb7K6RJKag=; b=GH0UdB4XVGnH0s6XtBqmfvdt5+BRomFjgGArZ79YUW9gN6XN4hGHRWDnHouzdrwPDb bnmRIiJNukvrXsmhRgzbuE4gRT/jWulq24gHZWAhIweGbE0GYrPSnzo6BzIqmV3Ki6zp ROp9Xw9QSRRg6avVXtqjQZRpMDdz7GRC537KbWcX+69Mrg7sFY8pDzNW3d/5mSGsRhi6 RxDSe4WFHDnc7+tnd+fy6ujaVfZUeW2Bn/ZdblSsMYP3WPFx5dYIzxuYF4k5FsEqJFX7 OrvaW17+gVYO8gw5LIPWQBsmSO2BsdlJgO9I4rRadezoyuEF39DD2xioGOtV06vnCPvp nc+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HpyMORbi; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hd34si592374ejc.145.2021.07.26.19.58.44; Mon, 26 Jul 2021 19:59:07 -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=@kernel.org header.s=k20201202 header.b=HpyMORbi; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbhG0CQt (ORCPT + 99 others); Mon, 26 Jul 2021 22:16:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:41848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbhG0CQs (ORCPT ); Mon, 26 Jul 2021 22:16:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2290760FEE; Tue, 27 Jul 2021 02:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627354636; bh=iQ9FkdbtV/zROAlVG/8PBSjOtj+aTz+AaFmkHdysXtg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HpyMORbiiNmOKjWizE4f0nrPg8XLbuRguHi7r2Yk5/ja5TNBPSSgPkbqK71qEZOM4 aNO08v+UoN6JncvrYwPKxxAGtFuCwXHECUZQE7T6aHzDQMea9VkfyPcE3DY1lsbJ6N J3a+s5FJrfBW1WyrU7T2aPgif3LxpjpXhcaSO6ajPluBGQ9MouJh7febqXdLFJnFJ6 8Js9QWy6f0lvhLw7hUI+g/bj2zxzvXELzHRX7VVw7lZ5Iao7oDuxfIllGIG5w7n/4n 9OFWBhTDivtL+8yv9QBCWonQQTS+6EaBJAXj9JM2mJcXhETM2Q/sDC/vqz3YCI0Tj1 IWNETP86Bw6Jw== Date: Tue, 27 Jul 2021 05:57:14 +0300 From: Jarkko Sakkinen To: Ahmad Fatoum Cc: Andreas Rammhold , James Bottomley , Mimi Zohar , David Howells , James Morris , "Serge E . Hallyn" , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team Subject: Re: [PATCH] KEYS: trusted: Fix trusted key backends when building as module Message-ID: <20210727025714.3zll7spsmo3opont@kernel.org> References: <20210716081722.4130161-1-andreas@rammhold.de> <0a684d56-66d0-184e-4853-9faafa2d243d@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0a684d56-66d0-184e-4853-9faafa2d243d@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 09:10:01AM +0200, Ahmad Fatoum wrote: > Hello Andreas, > > On 16.07.21 10:17, 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 > > compoiled as modules. This manifested in the trusted key type not being > > registered at all. > > I assume (TPM) trusted key module use worked before the TEE rework? If so, > > an appropriate Fixes: Tag would then be in order. > > > When checking if a CONFIG_… preprocessor variable is defined we only > > test for the builtin (=y) case and not the module (=m) case. By using > > the IS_ENABLE(…) macro we to test for both cases. > > It looks to me like you could now provoke a link error if TEE is a module > and built-in trusted key core tries to link against trusted_key_tee_ops. > > One solution for that IS_REACHABLE(). Another is to address the root cause, > which is the inflexible trusted keys Kconfig description: > > - Trusted keys despite TEE support can still only be built when TCG_TPM is enabled > - There is no support to have TEE or TPM enabled without using those for > enabled trusted keys as well > - As you noticed, module build of the backend has issues > > I addressed these three issues in a patch[1], a month ago, but have yet to > receive feedback. Which of the patches is the bug fix? /Jarkko