From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795994603; b=bpPdZxKO+kP4N0FOklMJ5mGFg0mdOg930zIicjPeuEEeK/72RZLG9Ys5O812fGDAZGVW yo+JQ7lHaU1qW8V7Yd+7+iVuRPenMM842eWhCBofSKlwVFc7xELIQUd3mnVgwOuA376HX m5YwQd0gvqi8oJUO/OEs0tYrBtA3m/tH3Vfd0WNYT1tYEbtHJZ/+vLQ65jQumQ3XL4L6d fp7T1xfuhMzam6bYIaw0hXokHXHooPOFwcVuvtIe1jMOVNXLTm4l903cvwK9b1HpSy+aL XmVSH9s0wO93Jg8E2qfSfNoucp9wUXTpcUBYhUiZj/GeMJ7j9RWuIRu94QMjLeFuBQw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795994603; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=J9Rmwxhkk6rL/3Lh/RkutHdOyWa8ipkuO/LfxtnJh24=; b=QzfB0lrYANNxB/ZkPkeFAmw/fQoNSO2CBCPTkHtZCXcI2F1p8J4jKlJZ7FVQuOgnLR1x 8uuAqZ7mYKLfrN4PwiD+azdryCbOUuvQhGSE7x5GSPt7oDAJ2/muK2I1nqLNVISYXOHZ5 MqOKFhX69838BNH/VR1pMcu09+/5XpZcyBU33mWSqHIym9+rO1Bw6BfpoqlF7XXdbMch9 yC1Fuq3WIZKCUhTFUNbvO5tqj4FLnPAa+vBaK2y2fIp/7htsXlDjHyRIr37hUiE443JQv rnfdtPkJEo0y64WPsCc3xwJcMPwxhpeKlJxF9L7xjqbCbn8JAcGc4Nt3u5IyZdwiHGA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Tz5zgHmw; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF94A606A327; Sun, 29 Nov 2026 23:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Tz5zgHmw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08C031F0089B; Sun, 29 Nov 2026 23:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795994603; bh=J9Rmwxhkk6rL/3Lh/RkutHdOyWa8ipkuO/LfxtnJh24=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Tz5zgHmwTljgp4W7ziy1Za4WVKAge99+qtLxiWNUCIG3jr5UrbnLWBRefHwz0+FfJ OP5gvGEjvEobQF0maaEOSNQZ/kHptf+znv5W8+wcnDNNjQNQ0bHt17cQF1z5T8uskR a7S0qCj3OeH4LE4HujOU3wenGi3E2WvLPXK0Qtr0WANlKGUjy/7SX+ob2Ky/oCXu/N wg5Un/gGtEW9f2uYd8FpRNN5nTjykGjdmShpCwd9UvEkAW4WKiSdi57vbHBji0OgcE paUNIxDaLHPhnlebbWyzSzVQ6klYyyQkeIHiWy/NQdDpZ0PcClEPgpvC8SlcKVSsz1 2xXUULh+NM3Yg== Date: Sun, 29 Nov 2026 15:23:20 -0800 From: Eric Biggers To: Jarkko Sakkinen Cc: keyrings@vger.kernel.org, dm-devel@lists.linux.dev, 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, Ahmad Fatoum , Alasdair Kergon , Andrew Morton , Benjamin Marzinski , David Gstir , David Howells , David Laight , "David S. Miller" , David Woodhouse , Herbert Xu , Ignat Korchagin , James Bottomley , James Morris , James Prestwood , Jason Gunthorpe , Jonathan Corbet , Jonathan McDowell , Lukas Wunner , Marek =?iso-8859-1?Q?Beh=FAn?= , Mike Snitzer , Mikulas Patocka , Mimi Zohar , Paul Moore , Peter Huewe , Randy Dunlap , "Serge E. Hallyn" , Shuah Khan , Sumit Garg Subject: Re: [PATCH v6 00/18] KEYS: trusted: asymmetric keys Message-ID: <20261129232320.GC2118@sol> References: <20261128215621.2253928-1-jarkko@kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261128215621.2253928-1-jarkko@kernel.org> On Sat, Nov 28, 2026 at 11:56:02PM +0200, Jarkko Sakkinen wrote: > OVERVIEW > ======== > > Extend TPM 2.0 trusted keys to load ASN.1 TPMKey [1] asymmetric keys > (OID_TPMLoadableKey, 2.23.133.10.1.3) for RSA (2048/3072/4096) and ECC > (NIST P-256/P-384/P-521), and expose keyctl pkey-operations directly on > key_type_trusted. In addition, extend TPMKey support to derive a > transient TCG H-2 NIST P-256 primary key on the fly for 0x40 permanent > hierarchy handles (such as TPM2_RH_OWNER). > > This allows provisioning an asymmetric key whose private portion stays > sealed to the TPM rather than sitting in plaintext on disk or in kernel > memory, while letting privileged setup load the blob into a keyring and > grant signing or decryption access via KEYCTL_PKEY_* without exposing > /dev/tpm0, /dev/tpmrm0, or a userspace PKCS#11 stack. For example, a > UEFI Secure Boot Machine Owner Key (MOK) used for local module signing > can have its X.509 certificate enrolled into MokList while its private > key is wrapped into an OID_TPMLoadableKey blob and shredded from disk; > network daemons such as iwd can similarly authenticate with TPM-bound > client keys. Though patch 2 is nice, the feature patches 8-18 seem to add a lot of unprivileged attack surface. Unprivileged processes will be able to do add_key("trusted", ...), then KEYCTL_PKEY_* to do expensive TPM operations or attack the new ASN.1 and TPMT_PUBLIC parsers. At the very least CONFIG_TRUSTED_KEYS_ASYMMETRIC needs to be default n, just like CONFIG_ASYMMETRIC_KEY_PKEY. But the motivation (over using the existing /dev/tpm*) seems suspect. Is anyone actually planning to use this, and if so, why? And why does the entire flow including add_key() need to be usable by an unprivileged user, and even support things like public key operations that do not need the TPM at all? - Eric