From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.149.156.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795090655; b=KY4W1PB08juWsGHcQ2yAU41fFc1/RvvO5QzemEUlmaXWIDCtxW8snNFIPn7fB+jEgzXA SrW5BXa3lX/1APNfViaut7/9e4kDZORslqWRRh/+LtPtPSJNuQpG0R2yOiC6aWZdrzdqs z+j1PUDg8xoecxWHMpWkLpQCvcV2csFMvs8gQtqPfdfuBJP1eTpXnR0xCepJJErk7LhxB sXy5WJqO/8RBwWnlF42HunP2kDWf37Zxg4MDcUQiuFVsNsMSR+vQGgQ3ZgsB6bs4F41Uq tcnrmsYVTaD4y5iF77CmRmC3tCLfwd8fKo0u0148Vq2FuGouJK4AgkEE8nUMEnGWj4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795090655; h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Date:MIME-Version: User-Agent:Subject:Content-Language:To:Cc:References:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CMAE-Envelope; bh=4+hewYS5Xc85XMsrC6qSZHgaMk+5vxcwYlnKkuazLe8=; b=FDAAZY5sp8rOEOKFLHYhxsUk+4yL0Op1KSj4QMgsj35+1jrsMgye371xBUTZ/UkB2mdD TiC7PTaqBRIn+i9KEZsnsSlCdhnNo8lzGeENZ0555yjOkoIMj0ISEiNjYBFd81EJy6/bS 0ylR/yqqlkAWcSWIM6wh4MYSU5oCDs6hKzFWx7B2mqp1uo4qkFu5RIiRABH384j6MVJjn JNC4tPogEFCDUv8cW7DcUwFUqFxoidBwkUegx4IS+VS2EuKO71eLLHvj1g0MXXzHOnytr dBwJbdf07a/WxM0SZ2mQExxuzPXdPXF+h2LDawKfIwgxL5Jf9W1wBtJkZ7uwZuwnFzw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=enneenne.com; spf=pass smtp.mailfrom=enneenne.com; dkim=pass header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=CycFhd9A; arc=none smtp.remote-ip=62.149.156.116 Received: from smtpcmd11116.aruba.it (smtpcmd11116.aruba.it [62.149.156.116]) (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 E9F62606A326 for ; Thu, 19 Nov 2026 12:17:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E9F62606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=enneenne.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=enneenne.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.a=rsa-sha256 header.s=a1 header.b=CycFhd9A Received: from [192.168.0.186] ([101.57.122.26]) by Aruba SMTP with ESMTPSA id U14zxDwan6VShU14zxRiua; Thu, 19 Nov 2026 13:17:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1795090651; bh=V3OZh4icVrzbMI2k6cXTPEjlLw6DW6zRycuz+4CAfec=; h=Date:MIME-Version:Subject:To:From:Content-Type; b=CycFhd9A1catDJK8mSVVnIjyH5ROQd1v+wC5+drY99wllUzOcvv0JnbleYae1QyWl BfXvel5+GlGK/smjYdZVOsE8ifTJ+aNn92e3/PHwymqXJ9vopCmtPNtiJdDDxgFhXQ gH0O5LL0GqGBMM5zzAqHd0YcDoUE/TebWvQKcOdv9bAt/QbHhwHYpgUqx3x1h4Ldgp 75NfGZPT+sNKTTrA02giDUkiO0gk016/Jf4H4Ha37Gpw+3d0e3MxEHOw+7cjazCAy7 12PcNhVzIViATgQFKluA/RK3kpXudgDDYCPNifgplaPxzA8PVajw1Iru4DOG02ulfO Vnl/JByjL9DVw== Message-ID: <10d27c34-72d7-4380-abc9-6f8eddc6c08c@enneenne.com> Date: Thu, 19 Nov 2026 13:17:29 +0100 X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/9] KEYS: keycrypt: keys that user space can use but never read Content-Language: en-US To: Demi Marie Obenour , Jarkko Sakkinen Cc: David Howells , keyrings@vger.kernel.org, Herbert Xu , "David S. Miller" , Jens Wiklander , Sumit Garg , op-tee@lists.trustedfirmware.org, =?UTF-8?Q?Horia_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 References: <20261118140421.584086-1-giometti@enneenne.com> <650f89ef-9745-4f75-b254-80fa5ac4773d@gmail.com> <61ca7c37-7b42-48a3-be2e-95deb4d999a2@gmail.com> <01692969-8e92-4a08-bde9-aad86674504f@gmail.com> From: Rodolfo Giometti In-Reply-To: <01692969-8e92-4a08-bde9-aad86674504f@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfKBPrYJ2CDN4f71Kap/ixDsQG8LCW21ix5G/r+qduPuGoKFzPku3ui/3D6NrDy/I4fLjS/AZ5x4bSLPCyVIF0to5TjSclhUTdSU4uon2/XK98GioKEpu t0DAXGgZowfR8EBdb4xlQI1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S048vbJ5rbuI5vxFjkO5bxo7Dsgk2WyJjnWav55v2ahPGzLX0t+XZEaY1n4iDLxnooNN/H35sYauqbDVs3RMMPG938OJL4wUKNVf/6fDh Y3+0UYag On 19/11/2026 05:35, Demi Marie Obenour wrote: > On 11/18/26 7:43 PM, Demi Marie Obenour wrote: >> On 11/18/26 7:37 PM, Jarkko Sakkinen wrote: >>> On Wed, Nov 18, 2026 at 06:42:15PM -0500, Demi Marie Obenour wrote: >>>> 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. CBC is there for existing formats (craf writes files that openssl enc can read) and because the CAAM path is CBC only. I take your points on it. >>>> 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. You are right that a construction of our own is the wrong choice: patch 9, the only GCM in the series, has no user yet and can go. [snip] >> The usual solution to something like this is a userspace service >> like ssh-agent. Then you can do whatever key management you want. >> That doesn't protect against root, but if someone can get root you >> have bigger problems. The threat here is root, on devices where root eventually falls: a key root can copy decrypts that device's data offline and forever. A service that holds the key in its memory gives that away. keycrypt with the OP-TEE backend does not: the TA keeps the key and checks the purpose sealed with it at every use, so even a compromised kernel can only use it on that device, and only for that purpose. > Also, if you need keys stored in hardware for some reason (compliance, > time-limited exfiltration), you can use a userspace library or > daemon that abstracts over whatever the hardware-specific API is. Yes, that is the case I mean, and a daemon over a TEE would not give the key away either. What it costs here is, for OP-TEE's PKCS#11 TA, secure storage before the root filesystem exists; for the CAAM, the only user-space path is AF_ALG cbc(paes), the one off-CPU exception left in an interface the kernel documents as deprecated, privileged by default, with a key format per driver and no purpose. Ciao, Rodolfo -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming