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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8501AC43217 for ; Wed, 4 May 2022 04:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344517AbiEDEUf (ORCPT ); Wed, 4 May 2022 00:20:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344519AbiEDEUc (ORCPT ); Wed, 4 May 2022 00:20:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 857C61F632; Tue, 3 May 2022 21:16:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 255AE61A71; Wed, 4 May 2022 04:16:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03405C385A5; Wed, 4 May 2022 04:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651637813; bh=kuLEziF1RBwT7frZNU3CgmC3ZYuUArL6BjwI7VssVcU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mX6chb6cqJWKfxIy+ImvfapILLIsi07JxyNr3R2RM+0iI34p5GUqvRFrTBPmXQHd0 vbCZ7srmv22qLBxzzKFiyCFjTfTdRr/cFINMCigIHP3t3bHCKloHRvaRw9qza/wwcD MTPPrVkmRd0dZg8S2BO8SrE9TdFCoVY3t1kyw9d1SJl11s0TPudFrq2plK/mgwbYTI yOrgAzt6TNuZ7cEMBCLoBuTUCfNv5Mib63k1ZFogsDq9TPSCro4+iEf2hqC4+3TsHb tq+j9eJW8mUOSXkEKtHg2nyvSc4sLmJ2qwDhYMt8G1HD/05kXexL1C9RQAMTF9oMhx 0AsKcvMUKgjhg== Date: Wed, 4 May 2022 07:15:28 +0300 From: Jarkko Sakkinen To: Ahmad Fatoum Cc: Jonathan Corbet , David Howells , James Bottomley , Mimi Zohar , kernel@pengutronix.de, Pankaj Gupta , James Morris , "Serge E. Hallyn" , Horia =?utf-8?Q?Geant=C4=83?= , Herbert Xu , "David S. Miller" , Eric Biggers , Jan Luebbe , David Gstir , Richard Weinberger , Franck LENORMAND , Matthias Schiffer , Sumit Garg , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v8 5/6] doc: trusted-encrypted: describe new CAAM trust source Message-ID: References: <20220428140145.870527-1-a.fatoum@pengutronix.de> <20220428140145.870527-6-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220428140145.870527-6-a.fatoum@pengutronix.de> Precedence: bulk List-ID: On Thu, Apr 28, 2022 at 04:01:44PM +0200, Ahmad Fatoum wrote: > Update documentation for trusted key use with the Cryptographic > Acceleration and Assurance Module (CAAM), an IP on NXP SoCs. > > Reviewed-by: Pankaj Gupta > Signed-off-by: Ahmad Fatoum > --- > v7 -> v8: > - add Pankaj's Reviewed-by > v6 -> v7: > - docs update split off as new Patch (Jarkko) > - fixed typo in "Trusted Keys usage: CAAM" section > > To: Jonathan Corbet > To: David Howells > To: Jarkko Sakkinen > To: James Bottomley > To: Mimi Zohar > Cc: James Morris > Cc: "Serge E. Hallyn" > Cc: "Horia Geantă" > Cc: Pankaj Gupta > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Eric Biggers > Cc: Jan Luebbe > Cc: David Gstir > Cc: Richard Weinberger > Cc: Franck LENORMAND > Cc: Matthias Schiffer > Cc: Sumit Garg > Cc: keyrings@vger.kernel.org > Cc: linux-crypto@vger.kernel.org > Cc: linux-doc@vger.kernel.org > Cc: linux-integrity@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-security-module@vger.kernel.org > --- > .../security/keys/trusted-encrypted.rst | 40 ++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > > diff --git a/Documentation/security/keys/trusted-encrypted.rst b/Documentation/security/keys/trusted-encrypted.rst > index 2fe6fd1a2bbd..0bfb4c339748 100644 > --- a/Documentation/security/keys/trusted-encrypted.rst > +++ b/Documentation/security/keys/trusted-encrypted.rst > @@ -35,6 +35,13 @@ safe. > Rooted to Hardware Unique Key (HUK) which is generally burnt in on-chip > fuses and is accessible to TEE only. > > + (3) CAAM (Cryptographic Acceleration and Assurance Module: IP on NXP SoCs) > + > + When High Assurance Boot (HAB) is enabled and the CAAM is in secure > + mode, trust is rooted to the OTPMK, a never-disclosed 256-bit key > + randomly generated and fused into each SoC at manufacturing time. > + Otherwise, a common fixed test key is used instead. > + > * Execution isolation > > (1) TPM > @@ -46,6 +53,10 @@ safe. > Customizable set of operations running in isolated execution > environment verified via Secure/Trusted boot process. > > + (3) CAAM > + > + Fixed set of operations running in isolated execution environment. > + > * Optional binding to platform integrity state > > (1) TPM > @@ -63,6 +74,11 @@ safe. > Relies on Secure/Trusted boot process for platform integrity. It can > be extended with TEE based measured boot process. > > + (3) CAAM > + > + Relies on the High Assurance Boot (HAB) mechanism of NXP SoCs > + for platform integrity. > + > * Interfaces and APIs > > (1) TPM > @@ -74,10 +90,13 @@ safe. > TEEs have well-documented, standardized client interface and APIs. For > more details refer to ``Documentation/staging/tee.rst``. > > + (3) CAAM > + > + Interface is specific to silicon vendor. > > * Threat model > > - The strength and appropriateness of a particular TPM or TEE for a given > + The strength and appropriateness of a particular trust source for a given > purpose must be assessed when using them to protect security-relevant data. > > > @@ -104,6 +123,12 @@ selected trust source: > from platform specific hardware RNG or a software based Fortuna CSPRNG > which can be seeded via multiple entropy sources. > > + * CAAM: Kernel RNG > + > + The normal kernel random number generator is used. To seed it from the > + CAAM HWRNG, enable CRYPTO_DEV_FSL_CAAM_RNG_API and ensure the device > + is probed. > + > Users may override this by specifying ``trusted.rng=kernel`` on the kernel > command-line to override the used RNG with the kernel's random number pool. > > @@ -193,6 +218,19 @@ Usage:: > specific to TEE device implementation. The key length for new keys is always > in bytes. Trusted Keys can be 32 - 128 bytes (256 - 1024 bits). > > +Trusted Keys usage: CAAM > +------------------------ > + > +Usage:: > + > + keyctl add trusted name "new keylen" ring > + keyctl add trusted name "load hex_blob" ring > + keyctl print keyid > + > +"keyctl print" returns an ASCII hex copy of the sealed key, which is in a > +CAAM-specific format. The key length for new keys is always in bytes. > +Trusted Keys can be 32 - 128 bytes (256 - 1024 bits). > + > Encrypted Keys usage > -------------------- > > -- > 2.30.2 > Reviewed-by: Jarkko Sakkinen BR, Jarkko