Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp435181ybg; Wed, 3 Jun 2020 04:47:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztcbWPH/AYnJz4itijgJEJa6VlHEtr7SbDCWHhcwTw5jJrWzvDBH2Es/0w6ajO++maudN6 X-Received: by 2002:a50:ee01:: with SMTP id g1mr6162566eds.44.1591184869023; Wed, 03 Jun 2020 04:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591184869; cv=none; d=google.com; s=arc-20160816; b=ZbVjNOSsgNTOhzd2fOHI8QF6vfhv5cmHpKgfobyt6U64rl55cuI80IqUowuwGJGxcY dGzLeCUxI6nRyAiN4Dz1PZILse3fvlQb9WwD4m3SaBIqUlc8FInW5HbGujvRO1HHuwyn iVJJ1giaF4HAWauVPk6PNIpf/J/WM+8ZJ+0bQ9Fpt1UkJtAJg8+EYX76HBaaOVPzWPEZ vqR6pF4iKE9WqL3VKh5Yp+Tx53luriVzNMozhARpoBsCcZl8LwNenAWMktW0SOwDtYPc SgISIrcNzbBSMXbeIpQ1fE6mIwp92UMdDDv+vjneNBGOgPfvP4ww2LdaG5jP82wctRI9 BXkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=R6lEVGZYGJxxHN7lE3eo9NqLzCsnQCicun988jWmqf0=; b=RcjthzgX6lJBY4PPlRzwTawbGCB8hxsW3gjZyBQN1roRkdMV6b0aztucPB8pZQFlDu asWINx3p+6SqfTX96LbZd0FVP5qwSm/ypt23FpAa4rRgJdvSwJ6ctaymDo+ahK3cfFDo lGxih8SxL5cFRGEsAcirFtWliUXaoXuL5CTgo/JlnPqRXCZ9w59JLL2ro3brYgtQWk8T XY9X8fUWQEetFJ8rF+qZiErHF4mLdTJNxnVkPSg/YPnQpT2x3u1pymd4Q2LS6hhEDgas LjI6EPKS5/tABczvByAlenURox4/JZjHXtyiInpI3Zemqmr8SStXat0ttJYSaj2ZtLuc hbaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CcT9D9lZ; 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 a9si1026071eju.26.2020.06.03.04.47.26; Wed, 03 Jun 2020 04:47:48 -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=CcT9D9lZ; 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 S1725995AbgFCLpf (ORCPT + 99 others); Wed, 3 Jun 2020 07:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgFCLpe (ORCPT ); Wed, 3 Jun 2020 07:45:34 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C83C08C5C2 for ; Wed, 3 Jun 2020 04:45:33 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id c21so1115843lfb.3 for ; Wed, 03 Jun 2020 04:45:33 -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=R6lEVGZYGJxxHN7lE3eo9NqLzCsnQCicun988jWmqf0=; b=CcT9D9lZNg/SMdu0oTdh0D/2xb8iHgHFyH7fmH90WYrNn/U+znPsNUWsM5AsKxoBUC vVFKe4LUjup9xTgkizKTwyQ0mp3tl+y8Welh9N/GllG4VLXKlxXHjSr9F6k+N7aS+Mdu brRhX1nAh2aZFrsppZeJGN+BzJyK3Lq86tRW/+cuA0RgpK9vhrG7icHwQdZTE/6WgEzE i9QfGI97QzeIy4v9j5Ft+ogMFQd85zLlT19K8GDYCEQMP+XrX3bHBWhIxegbA2Ze1qk9 Tp4ZMNmBt1B0C5WbcpAKgxOqrlvbotQ7CtwkSesdW9/OtKZup/VpnJtb/cWiuTEdTFjl 3sow== 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=R6lEVGZYGJxxHN7lE3eo9NqLzCsnQCicun988jWmqf0=; b=NLMEQW6fgWZiBaBkUPjWGgmcAw0HiMbArR9/mh87fKdpwWM8gKDheRY2Q2hqvD/eMW ReMzuKHieFq4OnNEML4KLy6/V5smVimaCTcNoheNhpFCMy6Wh3jxeC4cU4rlzJKRvIQ+ fy0zAW1W5Vy+GgW6P/zlwNt4i43giwOEPvZu0Kk1HsuAXQtCysA/aJcocaBeM6UalPR4 FRVrVxPttovLtu4sUTk2Wbf1bmiIVTfHy2+EH6wiTY3/AgqXrEGokMD8GHar0JYIUMZF WAA9/N+pQ7ec21aEGb5NoFZPAuR+AX47OlpsNZZj2Kp8ftjlu9EZSlvQT8f7vRh/YoAd QMZA== X-Gm-Message-State: AOAM531AySVfySJu59mPSccT8YvZ5/cJMH+5oOLM24EewqRQFr5F1Zvh aJsO9HRUvnqVWaFDnSsSSU/ll3NgwLK8OwToodQwvw== X-Received: by 2002:ac2:44bb:: with SMTP id c27mr2301161lfm.59.1591184732251; Wed, 03 Jun 2020 04:45:32 -0700 (PDT) MIME-Version: 1.0 References: <1591107505-6030-1-git-send-email-sumit.garg@linaro.org> <1591108981.4253.17.camel@linux.ibm.com> In-Reply-To: From: Sumit Garg Date: Wed, 3 Jun 2020 17:15:20 +0530 Message-ID: Subject: Re: [PATCH v5 0/4] Introduce TEE based Trusted Keys support To: Luke Hinds , Jarkko Sakkinen Cc: James Bottomley , Mimi Zohar , David Howells , Jens Wiklander , Jonathan Corbet , James Morris , "Serge E. Hallyn" , Casey Schaufler , Janne Karhunen , Daniel Thompson , Markus Wamser , "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, "tee-dev @ lists . linaro . org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Jun 2020 at 14:20, Luke Hinds wrote: > > > > On Wed, Jun 3, 2020 at 9:08 AM Sumit Garg wrote: >> >> On Tue, 2 Jun 2020 at 20:14, James Bottomley wrote: >> > >> > On Tue, 2020-06-02 at 19:48 +0530, Sumit Garg wrote: >> > > Add support for TEE based trusted keys where TEE provides the >> > > functionality to seal and unseal trusted keys using hardware unique >> > > key. Also, this is an alternative in case platform doesn't possess a >> > > TPM device. >> > >> > So here's a meta problem: in the case when the platform possesses both >> > TEE and TPM what should it do? >> >> IMO, trust source (either a TPM or a TEE) should be unique and >> carefully chosen as per platform security policy corresponding to a >> particular threat model. >> >> And moreover TEEs have been mostly used in the embedded world where >> having a hardware TPM is cumbersome given constraints regarding BoM >> cost and hardware resources. >> >> > Things like this: >> > >> > > --- a/security/keys/trusted-keys/trusted_core.c >> > > +++ b/security/keys/trusted-keys/trusted_core.c >> > > @@ -25,6 +25,8 @@ >> > > >> > > #if defined(CONFIG_TRUSTED_TPM) >> > > static struct trusted_key_ops *trusted_key_ops = >> > > &tpm_trusted_key_ops; >> > > +#elif defined(CONFIG_TRUSTED_TEE) >> > > +static struct trusted_key_ops *trusted_key_ops = >> > > &tee_trusted_key_ops; >> > > #else >> > >> > Say it's either/or at a Kconfig level: so if you select both TEE and >> > TPM based trusted keys at compile time, we intall the TPM ops and >> > ignore the TEE ops, is that right? Surely this should be runtime >> > selectable based on what the platform has ... >> >> This dynamic selection was already part of v4 patch-set but after >> objection from Jarrko here [1], I switched to compile time mode >> instead. >> >> [1] https://lkml.org/lkml/2020/6/2/139 > > > Unless I have misunderstood, my concerns about compile time are that distributors will be cornered into releasing kernels with an opinionated selection of either TEE or TPM and any users needing the non default will need to compile their own kernel. > I echo with your concerns. Jarrko, If it's fine with you then I can switch back to dynamic approach again in the next version. -Sumit >> >> >> > perhaps it should even be >> > selectable per key? >> > >> > Once it is runtime selectable, what should be selected in the both >> > case? Or should we allow the user to decide, if so, how? >> > >> > when you pipe a trusted key, I think the subtype (TEE or TPM) should be >> > part of the piped information, so it loads again seamlessly. This >> > would actually be fixed by something like the ASN.1 scheme I'm trying >> > to upstream, at least for TPM keys, but do TEE keys have a recognized >> > ASN.1 format? >> > >> >> I guess this is something which we can refine later if there are real >> platforms that have a particular security requirement to support both >> TPM and a TEE. >> >> -Sumit >> >> > James >> > >> >