From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6489C433E0 for ; Wed, 3 Jun 2020 08:08:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1D3020810 for ; Wed, 3 Jun 2020 08:08:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="em6VoVH3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbgFCIIC (ORCPT ); Wed, 3 Jun 2020 04:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbgFCIH6 (ORCPT ); Wed, 3 Jun 2020 04:07:58 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03125C03E96E for ; Wed, 3 Jun 2020 01:07:57 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id m18so1547968ljo.5 for ; Wed, 03 Jun 2020 01:07:57 -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=qm1Fufz0OVB6tfCS+0Zsp1jGFDeHl0Qe2Wk3cNVFIjE=; b=em6VoVH3kTta5GgGnR4yxb0C9pC1Go/C30Wl2dHtASemgL3MKbw20qcTF6Xp/bqged RqOiCSv36QuACxRruwObvBTcwUk07Vmv1pRD7jpaD80GjeML6wGVdnohnXhDpk4O6+vj CYcJiJHrTqBZ0vrJitGDSVZcpdMJoTTeyYXQ6IKOQcGDkoR5aMwVFg1dMeW+q79MUbvm UM03uTMHvxOc+IDw/fvKIk3IgDSfh7K96pi/PSu+HgDag/sDDXiL0MFQeFJsr7+wOAHd jiR0M0thaeIfsT1hu5gedkVkCI75yMeGExpSo9+ia+XoHXJRolqp+4yzG5CkerIzUioR nkaw== 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=qm1Fufz0OVB6tfCS+0Zsp1jGFDeHl0Qe2Wk3cNVFIjE=; b=SVAdztEw9cfFFjaoisO/fOu00d1YBJQU/uov/7QRjk7rTbYO+EwEz1X3LOhTOkh0yn CkhigQxYs7v96i0JPUXxByLylJ2mYdR9Reyh/i4LJPW+N8sVcaZ9AkhSP/wfDp+4kpn6 mIZ/fFX1041g6oNFdiWLTUJ5x5jW10FlBDaLTW0EBDqPa7EE9A5E7Iz9yMOtapCIsf6w ZWNmk3Xl6UPRjkINMwgS0qKusxDZMF67DsKdTd9/zngeU1CMUzGwtqon8H2L9kxTqaE9 4lqFvlY8mOUh2nnrF20/GCPBC8yBiymL81tFfQJdsXPAsXRYBZIv4f41/6rPLao6BL1r J73w== X-Gm-Message-State: AOAM530+I6SGDE1MMGBUupj4S71t7PiCu2yO4sRSAtN69OoP/IQ0nlrh T+N1hn4Gch3gTQcUdc/JPOXzaZ0ONpbeyjn+HlgPog== X-Google-Smtp-Source: ABdhPJxcPvpE6Kivg7poyIQDKjTdaR1zLLkk4Fmt5UIvp5/hGBWWhPNMg87+/+CuxmPgVa3FetzyOOjx5sQTccuyCM0= X-Received: by 2002:a05:651c:1103:: with SMTP id d3mr1553238ljo.110.1591171676264; Wed, 03 Jun 2020 01:07:56 -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: <1591108981.4253.17.camel@linux.ibm.com> From: Sumit Garg Date: Wed, 3 Jun 2020 13:37:44 +0530 Message-ID: Subject: Re: [PATCH v5 0/4] Introduce TEE based Trusted Keys support To: James Bottomley Cc: Jarkko Sakkinen , Mimi Zohar , dhowells@redhat.com, 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 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 > 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 >