From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A41B606A32A for ; Thu, 19 Nov 2026 00:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0EyK8NTv; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=h+plfSKN DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=oAmABwcXXotQ3MKjKlI/9ynn2ibq7W7A2AvNHWEPewY=; b=0EyK8NTv+Ln1+couVjPan6HYaX xFFP9iEnjdE8ek/6napvdErrdHHOzfV9gHp2GZHmWwzVbDFzv8Hs4dW5VwfVSbVcszXlPYdz+Nlqt gc+At8SBe5K0RuMfQhQvC8drKudhgIujOyCUt34tAzj0Catzondsya4TXt/7Ogmk21PNAa0p+qagl r6aAtCBO7xsYth3u96ieIDQegJmhFdkZL2oPRRzD6bNruIt2Lt7Qr/SPVsI/6zosTKAVUveiVUUY7 CuQNSU0F8TlT3eFLJgW8AVKK7SIDqnyG8R+a/4eQiDxDxoqGzDrkyLhU+DoruyFqVoaQQ10USYCBg ardflZ0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTq9g-0000000AajI-3W2p; Thu, 19 Nov 2026 00:37:36 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTq9e-0000000Aail-3EFr for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2026 00:37:34 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with UTF8SMTP id AE056644A0; Thu, 19 Nov 2026 00:37:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id DBFE31F000C7; Thu, 19 Nov 2026 00:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795048653; bh=oAmABwcXXotQ3MKjKlI/9ynn2ibq7W7A2AvNHWEPewY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=h+plfSKN+NLklqzjVemtZ32v59otj6WZ+i5ZX7AJNaHRwkty60vwf5CANYwQxXadx 9grKaSXHcL88gyAjvmXj7Dxj3igtLg6VRA9BkS2Xz+sbkPiCJQ65NyUYXBfOPbFLaf XdoVCRs1sK9pCYlYYliMAoWSNOquomqnVLl3/oQYKhVOXjNB/2YkLR+ZmUSK7vARM2 NrnppZL015i7TMfc06dS3AIYzWHi0I0F9oDGYTm5PYv5MbnqgOyCcmXq05dDZE4G/8 9EcXCPKRRhyeREJcSq+0h5D+bY7R62ppVpH/JRlvhOiY5Ob80r79UOhLIEBJXASLY8 Zf17RFO2AFGOw== Date: Thu, 19 Nov 2026 02:37:29 +0200 From: Jarkko Sakkinen To: Demi Marie Obenour Cc: Rodolfo Giometti , David Howells , keyrings@vger.kernel.org, Herbert Xu , "David S. Miller" , Jens Wiklander , Sumit Garg , op-tee@lists.trustedfirmware.org, Horia =?utf-8?Q?Geant=C4=83?= , Pankaj Gupta , Sahil Malhotra , Ahmad Fatoum , Richard Weinberger , "Christophe Leroy (CS GROUP)" , Eric Biggers , Arnd Bergmann , Paul Moore , James Morris , "Serge E. Hallyn" , Jonathan Corbet , Shuah Khan , Randy Dunlap , linux-crypto@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-api@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/9] KEYS: keycrypt: keys that user space can use but never read Message-ID: References: <20261118140421.584086-1-giometti@enneenne.com> <650f89ef-9745-4f75-b254-80fa5ac4773d@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <650f89ef-9745-4f75-b254-80fa5ac4773d@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Nov 18, 2026 at 06:42:15PM -0500, Demi Marie Obenour wrote: > On 11/18/26 9:04 AM, Rodolfo Giometti wrote: > > This RFC proposes a key type, "keycrypt", whose material user space can > > use for symmetric operations but never read: AES-256-CBC, HMAC-SHA256 > > and an authenticated AES-256-GCM stream, through a file descriptor that > > KEYCTL_CRYPT_OPEN returns for one key and one operation. > > I haven't looked at the API, but from a cryptographic perspective, > this encourages very poor practices. AES-GCM even allows userspace > to extract the secret authentication key. > > AES-256-CBC isn't a suitable mode on its own, unless it's combined > with a MAC in encrypt-then-MAC. Even then, it has a 2^64 birthday > bound, so it should only be used 2^48 times with a single key unless > the key is ephemeral. > > AES-GCM is not a suitable algorithm either. If you allow encrypting > with a key loaded from persistent storage, there is no way for the API > to ensure it is only used with a unique nonce. Nonce reuse leaks the > authentication key and allows forgeries. Using random nonces isn't > good enough either: NIST only allows 2^32 encryptions in this case, > and the API can't enforce that limit. > > For long-term keys, all of the following are much safer choices. > They have 192-bit nonces, which means that one can generate them > at random for each encryption without any problems. > > - XAES-256-GCM > - XChaCha20-Poly1305 > - AEGIS-256 > > AES-GCM-SIV is also okay, provided that you are fine with occasionally > leaking if two plaintexts are equal. This happens whenever there is > a nonce collision, so with probability 2^-32 after 2^32 encryptions. The exitential problem here is that KEYCTL_CRYPT_OPEN creates a circular relationship between the keyrings API and a specific key type. At hardware level I did not see any support for TPM, which narrows down the potential user base. The remaining potential user base is further reduced by those that use trusted keys; leaving out those who need to solve the assumed problem that only this patch set can presumebly sort out. And we don't really know at this point that cut. This is pretty much the break down of what is wrong here. If there is/was a problem to sort out, it should be so constrained that it should be as quick to describe as stepping over a nail really. These are the main topics what I would focus on. > -- > Sincerely, > Demi Marie Obenour (she/her/hers) Br, Jarkko