Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3667161iob; Sat, 7 May 2022 11:19:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyumIXiZ6+8ccdDLDDAXWMW+vLYif+uZ8ZqUfkY82G7/+88kmWGrpcufuj0aTM8hPNQMfJQ X-Received: by 2002:a63:7c4e:0:b0:380:8ae9:c975 with SMTP id l14-20020a637c4e000000b003808ae9c975mr7324694pgn.25.1651947578611; Sat, 07 May 2022 11:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651947578; cv=none; d=google.com; s=arc-20160816; b=PbKMVsSIzng1h6uFPXJhFKm1VVOsy5cG2dhs/hZthbVuJlc5CV5R+opMxHVv9jvZ1U 7Yj8W1cfqRnNT1pKsyNvVq6kionEQv+5v61+jSQVzjHnb5whqY3dg72z9zwZHOoSoWs9 Cky4a7KWAOkttIgkk4F37icVHIAZRkzZ29M54RO5R/fEcfd7Up8z2pG6OYRWYe0WZzNj +oJKlsph1RQSOz2tgVPR2nb7zuxYtEb/3B3uhcsVqWMhQAcA4UkZLFleSo4G0Hsf4Mh/ GmqQbzqpOxamZMcJloT0xBAWqkoZmm+iQieX1U3ifE32XpDNQIuPxfxlUc/sNCHjwiqS mNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8gr8exrUU0SDeNOhaRljdlxbPbyFb2zACastDxxZVqk=; b=Felay0fwc3Fu5GsNf7VC+ENJUaQTJai0f+E7H8i5odz6+YS8AuFV8ffySHKDLpvDip UmAoEhOsoJYuYfD6M1HR39pgVmQcVCegSwx3rhNGEzsA5HfKBmjRpQ/8FUzzg0TcjCXd C/Te6+dSCqV3b0m6IyYs1V/pduHCCGQ56Ak1zBMxWZs4LM8kQLpagRhqNYku2SMu/stF LDxqdkwIGW7+T8ZAwZt9KE38UHqLW1P0jO0ImTCrjRQNxY0cJ7XicJugn5s4xrh43XPM iwmOsc6y6dHuYpRzHDs9qSJKHYSl3QmYUWkSWKyHV1/ETsOwvG8GfQGkhX87Ai7kAcXG z2cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 71-20020a63024a000000b003c26048ca0bsi8198680pgc.860.2022.05.07.11.19.23; Sat, 07 May 2022 11:19:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236610AbiEFGad (ORCPT + 99 others); Fri, 6 May 2022 02:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240841AbiEFGaa (ORCPT ); Fri, 6 May 2022 02:30:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E40B6620D for ; Thu, 5 May 2022 23:26:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmrPo-0005o9-Mg; Fri, 06 May 2022 08:26:12 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nmrPh-000edT-Pz; Fri, 06 May 2022 08:26:04 +0200 Received: from afa by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nmrPf-004Tw4-Kn; Fri, 06 May 2022 08:26:03 +0200 From: Ahmad Fatoum To: Jonathan Corbet , David Howells , Jarkko Sakkinen , James Bottomley , Mimi Zohar Cc: kernel@pengutronix.de, Pankaj Gupta , Ahmad Fatoum , James Morris , "Serge E. Hallyn" , =?UTF-8?q?Horia=20Geant=C4=83?= , Herbert Xu , "David S. Miller" , Eric Biggers , Jan Luebbe , David Gstir , Richard Weinberger , Franck LENORMAND , Matthias Schiffer , Michael Walle , 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: [PATCH v9 6/7] doc: trusted-encrypted: describe new CAAM trust source Date: Fri, 6 May 2022 08:25:52 +0200 Message-Id: <20220506062553.1068296-7-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220506062553.1068296-1-a.fatoum@pengutronix.de> References: <20220506062553.1068296-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Update documentation for trusted key use with the Cryptographic Acceleration and Assurance Module (CAAM), an IP on NXP SoCs. Reviewed-by: Pankaj Gupta Reviewed-by: Jarkko Sakkinen Signed-off-by: Ahmad Fatoum --- v8 -> v9: - add Jarkko's Reviewed-by 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: Michael Walle 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