[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CVS3Y8LWVFMR.1W6LHHUUSHWB6@suppilovahvero>
Date: Mon, 25 Sep 2023 18:36:22 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "David Gstir" <david@...ma-star.at>,
"Mimi Zohar" <zohar@...ux.ibm.com>,
"James Bottomley" <jejb@...ux.ibm.com>,
"Herbert Xu" <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Cc: "Shawn Guo" <shawnguo@...nel.org>,
"Jonathan Corbet" <corbet@....net>,
"Sascha Hauer" <s.hauer@...gutronix.de>,
"Pengutronix Kernel Team" <kernel@...gutronix.de>,
"Fabio Estevam" <festevam@...il.com>,
"NXP Linux Team" <linux-imx@....com>,
"Ahmad Fatoum" <a.fatoum@...gutronix.de>,
"sigma star Kernel Team" <upstream+dcp@...ma-star.at>,
"David Howells" <dhowells@...hat.com>,
"Li Yang" <leoyang.li@....com>, "Paul Moore" <paul@...l-moore.com>,
"James Morris" <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
"Randy Dunlap" <rdunlap@...radead.org>,
"Catalin Marinas" <catalin.marinas@....com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
"Tejun Heo" <tj@...nel.org>,
"Steven Rostedt (Google)" <rostedt@...dmis.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-integrity@...r.kernel.org>, <keyrings@...r.kernel.org>,
<linux-crypto@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linuxppc-dev@...ts.ozlabs.org>,
<linux-security-module@...r.kernel.org>,
"Richard Weinberger" <richard@....at>,
"David Oberhollenzer" <david.oberhollenzer@...ma-star.at>
Subject: Re: [PATCH v3 3/3] doc: trusted-encrypted: add DCP as new trust
source
On Mon Sep 18, 2023 at 5:18 PM EEST, David Gstir wrote:
> Update the documentation for trusted and encrypted KEYS with DCP as new
> trust source:
>
> - Describe security properties of DCP trust source
> - Describe key usage
> - Document blob format
>
> Co-developed-by: Richard Weinberger <richard@....at>
> Signed-off-by: Richard Weinberger <richard@....at>
> Co-developed-by: David Oberhollenzer <david.oberhollenzer@...ma-star.at>
> Signed-off-by: David Oberhollenzer <david.oberhollenzer@...ma-star.at>
> Signed-off-by: David Gstir <david@...ma-star.at>
> ---
> .../security/keys/trusted-encrypted.rst | 85 +++++++++++++++++++
> 1 file changed, 85 insertions(+)
>
> diff --git a/Documentation/security/keys/trusted-encrypted.rst b/Documentation/security/keys/trusted-encrypted.rst
> index 9bc9db8ec651..4452070afbe9 100644
> --- a/Documentation/security/keys/trusted-encrypted.rst
> +++ b/Documentation/security/keys/trusted-encrypted.rst
> @@ -42,6 +42,14 @@ safe.
> randomly generated and fused into each SoC at manufacturing time.
> Otherwise, a common fixed test key is used instead.
>
> + (4) DCP (Data Co-Processor: crypto accelerator of various i.MX SoCs)
> +
> + Rooted to a one-time programmable key (OTP) that is generally burnt
> + in the on-chip fuses and is accessible to the DCP encryption engine only.
> + DCP provides two keys that can be used as root of trust: the OTP key
> + and the UNIQUE key. Default is to use the UNIQUE key, but selecting
> + the OTP key can be done via a module parameter (dcp_use_otp_key).
> +
> * Execution isolation
>
> (1) TPM
> @@ -57,6 +65,12 @@ safe.
>
> Fixed set of operations running in isolated execution environment.
>
> + (4) DCP
> +
> + Fixed set of cryptographic operations running in isolated execution
> + environment. Only basic blob key encryption is executed there.
> + The actual key sealing/unsealing is done on main processor/kernel space.
> +
> * Optional binding to platform integrity state
>
> (1) TPM
> @@ -79,6 +93,11 @@ safe.
> Relies on the High Assurance Boot (HAB) mechanism of NXP SoCs
> for platform integrity.
>
> + (4) DCP
> +
> + Relies on Secure/Trusted boot process (called HAB by vendor) for
> + platform integrity.
> +
> * Interfaces and APIs
>
> (1) TPM
> @@ -94,6 +113,11 @@ safe.
>
> Interface is specific to silicon vendor.
>
> + (4) DCP
> +
> + Vendor-specific API that is implemented as part of the DCP crypto driver in
> + ``drivers/crypto/mxs-dcp.c``.
> +
> * Threat model
>
> The strength and appropriateness of a particular trust source for a given
> @@ -129,6 +153,13 @@ selected trust source:
> CAAM HWRNG, enable CRYPTO_DEV_FSL_CAAM_RNG_API and ensure the device
> is probed.
>
> + * DCP (Data Co-Processor: crypto accelerator of various i.MX SoCs)
> +
> + The DCP hardware device itself does not provide a dedicated RNG interface,
> + so the kernel default RNG is used. SoCs with DCP like the i.MX6ULL do have
> + a dedicated hardware RNG that is independent from DCP which can be enabled
> + to back the kernel RNG.
> +
> 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.
>
> @@ -231,6 +262,19 @@ Usage::
> CAAM-specific format. The key length for new keys is always in bytes.
> Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
>
> +Trusted Keys usage: DCP
> +-----------------------
> +
> +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 format
> +specific to this DCP key-blob implementation. The key length for new keys is
> +always in bytes. Trusted Keys can be 32 - 128 bytes (256 - 1024 bits).
> +
> Encrypted Keys usage
> --------------------
>
> @@ -426,3 +470,44 @@ string length.
> privkey is the binary representation of TPM2B_PUBLIC excluding the
> initial TPM2B header which can be reconstructed from the ASN.1 octed
> string length.
> +
> +DCP Blob Format
> +---------------
> +
> +The Data Co-Processor (DCP) provides hardware-bound AES keys using its
> +AES encryption engine only. It does not provide direct key sealing/unsealing.
> +To make DCP hardware encryption keys usable as trust source, we define
> +our own custom format that uses a hardware-bound key to secure the sealing
> +key stored in the key blob.
> +
> +Whenever a new trusted key using DCP is generated, we generate a random 128-bit
> +blob encryption key (BEK) and 128-bit nonce. The BEK and nonce are used to
> +encrypt the trusted key payload using AES-128-GCM.
"When a new trusted key using DCP is created, a random 128-bit
blob encryption key (BEK) and 128-bit nonce are generated."
... or along the lines.
BR, Jarkko
Powered by blists - more mailing lists