Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4692283pxu; Tue, 13 Oct 2020 05:05:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV+NG7569SScFwAwvRU+rZXttwOT38nt4We6c9QuldzfoDTCqGegonq07PT5g1uHwNw5OV X-Received: by 2002:a05:6402:b0e:: with SMTP id bm14mr19604437edb.19.1602590721682; Tue, 13 Oct 2020 05:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602590721; cv=none; d=google.com; s=arc-20160816; b=jej0GVcEh3iKxgN2qNc4OEu4tsoM54C9hNr5yTlMrZyq/+87c90VdknarqNMkmW8aB 6huG0okPRW7kt6/C4erP3SgTfu1Mnaul0YY23TfflGaHiTAqunD7YrP9APZNE1QhfsVG DPQRBk2CvrSXKm6zdwDMAlfZnS8mK0Wpt/9PkLafYLLDsvLEPjws3hyT7ugFplR3KQiq A3k9v5HDtQslhJYeTdZhfNMN8P3VKpYGqSGdNDNWnNITlcerIYEpJeXk8oCu+A7+Xl73 vhOCK/4GUyVkeCVzs8x751GCkjV40FzlM1jZy75Aw2wBNvjOCEPx2VhgljrREBMRnlUu +cBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=E3qSt/yVefPSRQYiEWS9diKrWOAd37+h5epZFLrelMw=; b=0t322btg495PWvVrRxIZ7DMu2tAi9fktoeKvQKOA3mHFKeKqnIoeQK142Lt/7d/TwT ksfi5jeHpoa3InQqr+CUJupjy3OQ1eS35yTJDEbW4MpMVOFHATWKFHrh6o+FDW5NoukW aCIDZoAkX4XADPZo8oCNRoqkP3zJBRJPM/SiN6sv5qmlkNnz1sMgz/ncp40CIGq/g3yb mJ9bP4HarNIF65zfoaqBydpGyRwpoxvpnJvp3Vz7Faq1RkCLvQXdKw0EU3M/nm5ZG1B8 cOAkj3qqH/RQdixGxBh0YL9//RaD+zCMyfDsJUZNenn8A/1UrjCRC2NZoToUTS3moG3Q iG+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YCb/GMyA"; 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 n4si14758833ejk.692.2020.10.13.05.04.58; Tue, 13 Oct 2020 05:05:21 -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="YCb/GMyA"; 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 S2387857AbgJMKxw (ORCPT + 99 others); Tue, 13 Oct 2020 06:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730075AbgJMKxv (ORCPT ); Tue, 13 Oct 2020 06:53:51 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B90B1C0613D0 for ; Tue, 13 Oct 2020 03:53:48 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id z2so2733522lfr.1 for ; Tue, 13 Oct 2020 03:53:48 -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; bh=E3qSt/yVefPSRQYiEWS9diKrWOAd37+h5epZFLrelMw=; b=YCb/GMyA9TZ+1dfkpQLjYelV1j6wc9qgpJOffjV8Rvg2PN0QUCKn50OpBGUPidJn5y wOK0GAzzSZ207end9icoCQvF8u6zU23d4R4zb/Ci+kKWOVOmQVjZeNEpWtfIOITK/yb8 fKvQSOK40GE9PjYdm/m2MZJu+VxJqS1QF8l2B8VyiW6deFUckcomnDQQzxKwn85vdnTk ITNWaiSkUka+WfnKtpgVW8ZaEb0lz+t6usNyV7oRDGEZCLQtnEoaVUocVDlxFNfZzKlR xLHxQzixocS/FnicsAkcSS+NqNFq4ZbEPedg0JEZLrlaKYzq2N4fbDctOzevd2FaLvWH CXSQ== 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; bh=E3qSt/yVefPSRQYiEWS9diKrWOAd37+h5epZFLrelMw=; b=aSb7dgaLLajcatXoiKJaaJ/NFibhaNWnrWhFCzRj9l/0FCHoPhyoAChG74jinmHUWc mluYb7qREHGJH1D0Iy7JXikqyomX5/EbxnIbXxaPXAeBoAnRdefg88niw7Y110+kZcKd qzNIuMCrbNeha03+keC1FfkLc+fHuBH0yFUa2iaaBu/0H20WB4hfzOP1ZbutKUE0I1md 1U2UjCgANPGzKTbFZLyXv41cSyBJNDKcRG6wtvqBp8LK7362eSdNTryluHhKWDJIuFDL 9fro7ewy4gseF7OfSOoaSB2PiKeuVa46thNIj2EXLy8hAfliCe0yMt5Yq4cC9HSRdKfE eXcw== X-Gm-Message-State: AOAM531Ibx6YkvbyeWQW+ByJ4RM65lveHKKBpvcWVZvd07QDovFepnM4 8DIFkB80vFlYuft2reBK3IdLzstdWmw5rXk4r03iUg== X-Received: by 2002:ac2:50d0:: with SMTP id h16mr995095lfm.445.1602586427139; Tue, 13 Oct 2020 03:53:47 -0700 (PDT) MIME-Version: 1.0 References: <1602065268-26017-1-git-send-email-sumit.garg@linaro.org> <1602065268-26017-2-git-send-email-sumit.garg@linaro.org> <20201013014304.GC41176@linux.intel.com> In-Reply-To: <20201013014304.GC41176@linux.intel.com> From: Sumit Garg Date: Tue, 13 Oct 2020 16:23:36 +0530 Message-ID: Subject: Re: [PATCH v7 1/4] KEYS: trusted: Add generic trusted keys framework To: Jarkko Sakkinen Cc: Mimi Zohar , James Bottomley , David Howells , Jens Wiklander , Jonathan Corbet , James Morris , "Serge E. Hallyn" , Casey Schaufler , Janne Karhunen , Daniel Thompson , Markus Wamser , Luke Hinds , "open list:ASYMMETRIC KEYS" , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Linux Doc Mailing List , Linux Kernel Mailing List , linux-arm-kernel , op-tee@lists.trustedfirmware.org, Josh Poimboeuf Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Oct 2020 at 07:13, Jarkko Sakkinen wrote: > > On Wed, Oct 07, 2020 at 03:37:45PM +0530, Sumit Garg wrote: > > Current trusted keys framework is tightly coupled to use TPM device as > > an underlying implementation which makes it difficult for implementations > > like Trusted Execution Environment (TEE) etc. to provide trusted keys > > support in case platform doesn't posses a TPM device. > > > > Add a generic trusted keys framework where underlying implementations > > can be easily plugged in. Create struct trusted_key_ops to achieve this, > > which contains necessary functions of a backend. > > > > Also, add a module parameter in order to select a particular trust source > > in case a platform support multiple trust sources. > > > > Suggested-by: Jarkko Sakkinen > > Signed-off-by: Sumit Garg > > This is exactly kind of place where I think static_call() should be > taken into use, which is a v5.10 feature [1]. For background and > context, I'd read [2]. This looks like an interesting feature. But I am not sure about the real benefits that it will provide in case of trusted keys. If we are looking at it performance wise then I think the gain will be negligible when compared with slow TPM communication interface (eg. SPI, I2C) or when compared with context switching involved in TEE. Also, it requires arch specific support too which currently seems to be limited to x86 only. > > The other thing that I see that does not make much else than additional > complexity, is trusted_tpm.ko. We can do with one trusted.ko. > Current implementation only builds a single trusted.ko module. There isn't any trusted_tpm.ko. -Sumit > I'd also *guess* that the static_call() mechanism does not work accross > module boundaries. > > [1] https://lore.kernel.org/lkml/20201012155542.GA3557765@gmail.com/ > [2] https://lwn.net/Articles/815908/ > > /Jarkko