Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp310546ybg; Wed, 3 Jun 2020 01:10:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCYBYedeTl+lBkFIKaAAr3yp320OUVXNYIuvOe/hJG8Pk/0ZSHFvmb/vML25B3B0M0Kgos X-Received: by 2002:a17:906:4944:: with SMTP id f4mr26529731ejt.3.1591171846194; Wed, 03 Jun 2020 01:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591171846; cv=none; d=google.com; s=arc-20160816; b=aCvW7C+ByFaxnuE0u9DmOScUNALVrZxL+q+3ZweQ2pIH82s/sRThT62DaJg5lv1GZD L0cjmlhgrqYNOJ/YiPXqIMANz8hWwzEs6ZX8D05EgLP0VnJ1ycKkCP741S2hkl3RTulr QtB2GZ09DVZmeCSqZre02MAULhZc9KYvGF/t+iWloW2oTZfL0exJV6PGh8uliCG+hldj UhvUlMxzhccZyVdQZULyLDmofMGZBqY/irDqJ4YqAr9Al454bbfRtZpq7Pwg6RIK/3VX MOwDvKL6OoovXVTXRD8nTM5jTYotMJC1pMfi6PrBcgZ/sdeF0v6t5rL/1Nj3sp1qU3L9 dwHQ== 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=qm1Fufz0OVB6tfCS+0Zsp1jGFDeHl0Qe2Wk3cNVFIjE=; b=QH6jGszw57SVmdeRVudaPSry5FHWbIKHXVb2eVC+nffIXDT6SAlR1AM4cJaL2tckjx 200fdwcHFd9JAAVoME1BU3NhfjgAQPLSSLJzdQA2y/prSQiZzi7+N5MNHnNZhWRXbn9k QichXZvbL++tkI73nhoY4B9LXT5Rw1+5b1S8Ev6Kobs48LHSaQmp2qWbtvaN6xwfUhR2 QawF7NBKhbHHUUpaVB8S8SBkaZs7QBakDTRYMzZiX6Ndps5+cozB1at3avQq3eXQLMql m38KJUL27CMRBQMnO2QPIdA2Arbq1914z1zi1JC7e10qgr7ebURiAEocmCQw6Zao4Tlm Eb2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=em6VoVH3; 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 do10si952293ejc.671.2020.06.03.01.10.22; Wed, 03 Jun 2020 01:10:46 -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=em6VoVH3; 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 S1726266AbgFCIIA (ORCPT + 99 others); Wed, 3 Jun 2020 04:08:00 -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-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 >