Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2680161lqo; Tue, 14 May 2024 06:22:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWCqLj/8ajQdLLBYlldY++UWxjhiaVaruCTDxEGEmiWAPb7U3DWWGRENHmZ0szcuPEAs5PwawcDGi4SU9OIaUJAyOenT3/w580eZapKA== X-Google-Smtp-Source: AGHT+IElJDni/87kvQaHSPHooOPRidy9QeLYtlvM0v8/iA3uTF3CImTz5UuioAinFd4KEKK4Sjod X-Received: by 2002:a17:907:785a:b0:a59:a033:3e2 with SMTP id a640c23a62f3a-a5a2d676511mr1234233466b.74.1715692926713; Tue, 14 May 2024 06:22:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715692926; cv=pass; d=google.com; s=arc-20160816; b=NhuV8nYF/JDCOn+COsQbq9q/u098exfwFd5mp5FSHbuLFkpyBXxmjpnEbQxstNdw8M VdH62oFlkvfUGoDDV4uA7WWsS8AjKI6V9WWV2ulKyDe11HQ9ndWy3Hzj2xxXX200l0Z2 2hjzWeKHWDSDqsYzaAab16oPODHA+UyIlNN+inKNaH/FVmKY8obDZcVv+GKH01I6nOh5 AVEJZZpiKXKsOFYIsNnx+22D8NDkImd57Uf+zwzpeL6Nj2pcoKLDYhC0/3+NtJJprHzO oW/C82co7gT84rdHmCviBvEizU54qmKQSxU4qvTKQ8TXsio8rTcC67YzH0aLTgxP2sap DMug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=gqd1UzTZmwcZdR5n3AwIksJ+CVAmV+O8oPVTGzelpbU=; fh=8QzwoHmUHIu08Ry16OPFJ8zRVCodZmofqNJVJHuGxxY=; b=EMuJuHb+JuMSBEpXrh//TJqVtUhtehQMgZQR0BPJciiT0jbkdbuFv0iLLgnkz+f2+S CRGNK9lcqEFqDdhg+/ZO3F4byf3UCezci1HLSgbOdllDVmymrK8Sv7R9hxmzqbclGpi2 q2n6hIsXoSqhWy68hG0bPydtHfPs/JCB2zWf7h/iZQDZ+ycllDbMUgYo6EPSrLogB1lu hAL16kkfGC6YC1PjX7JU16LrWPTF33j3D5rntH0MIz5Ky462gEL3tm9Me65zPY1DnnNk LNTleavcuoy2ysk4TprC1+Z+bFxo9/QKJu7AzGb/EvLOvuR1cM3DODHHrskUMrp0eu/G BfKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=DBNufP83; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-178705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a3e54619bsi445616066b.741.2024.05.14.06.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:22:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=DBNufP83; arc=pass (i=1 spf=pass spfdomain=cloudflare.com dkim=pass dkdomain=cloudflare.com dmarc=pass fromdomain=cloudflare.com); spf=pass (google.com: domain of linux-kernel+bounces-178705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D3AF71F24503 for ; Tue, 14 May 2024 13:12:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B912E140E5E; Tue, 14 May 2024 13:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="DBNufP83" Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 638E17E116 for ; Tue, 14 May 2024 13:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692317; cv=none; b=XE9GdqeqvXNWQoG7s4TGb2Hj7XYaS+N+dUQfiaHFmcE1xD8WqmWkY/0XWG5ZIfCBnEjsVHh4RhZHHX5jZR6j7cxxUxfCoe8koO4m4H1aD7R5ckjQFXZJOs3uZvd8LJEQq0B9Vajr8cV55n4yyPXrZ8qqlfsGNYjQKkiKsvSqgyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692317; c=relaxed/simple; bh=i78nag7VwGIylmXT7ULMgiXTvq5zZgYQxOsCzHqZVSA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DIohW/hXKngpcVGUxHv5/WmR6AKd1Gy5pTc60W6GazT/jmy5p+jGo1GblTtBLlHuLfEzqHPNjLPj7iTobdyl6M3Lu+Gl0AlePMK7Ct1nVbqn4SfEoIExCvPtsm6Hj48z6gEn7POwiKzzWrJOO+a1knDWxE1TGwWbrTKGweED6ZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com; spf=pass smtp.mailfrom=cloudflare.com; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b=DBNufP83; arc=none smtp.client-ip=209.85.215.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cloudflare.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloudflare.com Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-602801ea164so3880677a12.0 for ; Tue, 14 May 2024 06:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1715692316; x=1716297116; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gqd1UzTZmwcZdR5n3AwIksJ+CVAmV+O8oPVTGzelpbU=; b=DBNufP83dAzL6zfzTWNDg7DHZcF88tPmTl1W1NZphcsmMNdzvDzBw3uOUrXx8r7iM4 p+FP0OH5mpcoWUql52bZb4IkMbeSUt9Eq4e61q3QpdYxRIpdRpDHu+Nc4hBqFERUbNT5 M9OJWXO/kK8Zf6AyQqISQDcUrOhRHUi3wEcaJd5HODaVxC75gYbaPUxDZQyNUfjGjmap GOAlhOFK5AB+Al5MMZzdfpKBZujTlNwBrGEzGvkH+cI3EvA1wy8yMjw1NnYRVqnExRS7 NDbq6Bo6V0b0qBmHepRXkrvniQ14vH6ased/ZtkXXKmU1poBh45iGK+KfcBu9Ngru/kT Qz+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715692316; x=1716297116; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gqd1UzTZmwcZdR5n3AwIksJ+CVAmV+O8oPVTGzelpbU=; b=vet4IhJXJ7JRzvfA0gqgjnJB72qmuAfQ1G0RSNVygmE+bgpB+CyzsKMH8nbi5lT/EO p9JCmtGK2UFvI9sRWqdYczQ70hqXYVTUqvnGRyNSHzg1dH9PLyegaYNZtgC7vciVAE0l QNgCPcZHq26gv7JXA46FWTD/SJR0jsQSkOc4ZLQ1RKAr4cIQ8Saa2v2i87UYxGnwP3HA q7oR8PIIeCjmyR3UIUnq4GS8qQrSo7/2V6z6N57eDdYl9nc009xYrVNbAudRyrFaTKPu RC7OGM8jG7C5cibWnuAcOWkglD7AvDgI69jyDcDK2ZJDmEuOpaED17SEOJYCeHMYCZxJ lXnw== X-Forwarded-Encrypted: i=1; AJvYcCVeFWri3QLke1m4XWcwp4OovlnB7lR3nyxAuWgwZimefp5NtwoizA5zxetcZkqyE6aN616fKVVlWeGD3xCy+wwqoE5VPOg7iyXnn0oE X-Gm-Message-State: AOJu0YxIKQRiCmoU/madCbWU8TbH22K7w9QXDRO6Kqpkza1hM7+g0f13 rnSxZpKZGQcEIpvu6Tm7dugvlm2WjB0xzmAt+gDzHIm3WA7O6gAYgOkJAwx2fEPnQSCtKy791Oo mt7gAa0nEO+H+UPTTBjTshFt/PjFdGBuKtfW+WxvpDlnySqy0LEk= X-Received: by 2002:a17:90a:630c:b0:2b2:6de2:cdc7 with SMTP id 98e67ed59e1d1-2b6cc3429f7mr10099479a91.20.1715692315282; Tue, 14 May 2024 06:11:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240503221634.44274-1-ignat@cloudflare.com> In-Reply-To: From: Ignat Korchagin Date: Tue, 14 May 2024 14:11:44 +0100 Message-ID: Subject: Re: [RFC PATCH 0/2] TPM derived keys To: Jarkko Sakkinen Cc: James Bottomley , Mimi Zohar , David Howells , Paul Moore , James Morris , serge@hallyn.com, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@cloudflare.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2024 at 1:09=E2=80=AFPM Jarkko Sakkinen = wrote: > > On Tue May 14, 2024 at 1:05 PM EEST, Ignat Korchagin wrote: > > On Tue, May 14, 2024 at 1:28=E2=80=AFAM Jarkko Sakkinen wrote: > > > > > > On Mon May 13, 2024 at 8:11 PM EEST, Ignat Korchagin wrote: > > > > On Fri, May 3, 2024 at 11:16=E2=80=AFPM Ignat Korchagin wrote: > > > > I would like to point out to myself I was wrong: it is possible to = ask > > > > the kernel to generate a trusted key inside the kernel locally with > > > > "keyctl add trusted kmk "new 32" @u" > > > > > > Not in a full-time kernel position ATM as I'm working as contract > > > researcher up until beginning of Oct (took some industry break after > > > a startup went down of business), so please, politely asking, write > > > a bit more compact descriptions ;-) I'm trying to find a new position= by > > > the beginning of Oct but right now I'd appreciate a bit more thought = out > > > text descriptions. > > > > > > I'm working out a small patch set with James Prestwood to add asymmet= ric > > > TPM2 keys based on his old patch set [1] but laid out on top of the > > > existing baseline. > > > > > > I did already the key type shenanigans etc. for it and James P is lay= ing > > > his pre-existing RSA code and new ECDSA on top of that. So this will > > > > This is great. Perhaps we can finally have ECDSA software signature > > support as well, which I have been trying to get in for some time now > > [1] > > Yes exactly both. > > > > > > give x.509 compatibility [2]. This patch set will be out soon and lik= ely > > > part of 6.11 (or almost guaranteed as most of it is done). > > > > > > So by plain guess this might be along the lines what you might want? > > > > I don't think so. I have seen this patchset, but unless the new > > version is fundamentally different, it looks to me that the asymmetric > > TPM keys are the same as trusted keys except they are asymmetric > > instead of being symmetric. That is, they are still of limited use on > > stateless systems and are subject to the same restrictions I described > > in my revised cover description. > > OK, hmm... can you an "apples and oranges" example what would be > most trivial use case where these don't cut? For example, a cheap NAS box with no internal storage (disks connected externally via USB). We want: * disks to be encrypted and decryptable only by this NAS box * if someone steals one of the disks - we don't want them to see it has encrypted data (no LUKS header) Additionally we may want to SSH into the NAS for configuration and we don't want the SSH server key to change after each boot (regardless if disks are connected or not). > > > On top of that I'm not sure they would be widely used as "leaf" keys > > by applications, maybe more as root/intermediate keys in some kind of > > key hierarchy. TPMs are slow and I don't see a high-performance > > web-server, for example, using asymmetric TPM keys for TLS operations. > > Also, as we learned the hard way operating many TPMs in production, > > some TPMs are quite unreliable and fail really fast, if you "spam" > > them with a lot of crypto ops. I understand this is a HW/TPM vendor > > problem, but in practice we're trying to build systems, where TPM is > > used to protect/generate other keys, but most of the "leaf" crypto > > operations are done in software, so we don't make the TPM do too much > > crypto. > > So what about SGX/SNP/TDX? In theory yes, but I have chased the tech for a while on commodity HW and it keeps having problems. > TPM is definitely not made for workloads :-) > > > Just to clarify - I'm not arguing about the usefulness of TPM > > asymmetric keys in the kernel. I would really want to see this > > building block available as well, but I think it just serves a > > different purpose/use case from what I'm trying to figure out in this > > RFC thread. > > Got it :-) NP > > BR, Jarkko