Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2593160lqo; Tue, 14 May 2024 03:40:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPMtzqEhYn7RvELWFSLVmEhTxoqWArIA6vas/R44bSD9T2o4iz2/pIRj6Sq4N++IUiSXimup4zoYfaw7vUWRT+yHUnH4yizsVuZnS4Og== X-Google-Smtp-Source: AGHT+IFh0vGm2Qv/5xmA2UbdGp0THWkiGRWXX9Znc8N42DzMmN8v6n+CL8mX1i/r9w/s5nhqv+G1 X-Received: by 2002:a17:906:134d:b0:a59:9eab:162b with SMTP id a640c23a62f3a-a5a2d5d01abmr823836066b.35.1715683239269; Tue, 14 May 2024 03:40:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715683239; cv=pass; d=google.com; s=arc-20160816; b=XlQ5SN3TNMa3rjgB0wbqX3lBcODFrsCWFRAO+mVzV+opwSltj+HeofDlYe+q66VqLl g2b5SjPcaAHoie6qsbXrN2wjMrfG0OcDsaAic5TK2K4/PlLf2/vIbqznDMiz4nJYTfHt Xt5wjG6JWIb09z6xgq/h74B66tnkcISn1ttIO6vNUWK+X2BR9xe9ZK5vHd4sclMfkUCz fmsSYXGlTaO3wEDbufD1g7xKf8WR3L6KPXP90GngIB8Xnz9pyLVqE6qAhc1WMUtYz3Be E9uAO92+RH2+FeJWMcz9Ke/8ukAIxVoQVTjnx7o7MM+dgGO81YUytjn6Z2Pw4sC1UMQf MI8Q== 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=JJMnPw1emDY+HwY78xe2ASFo8bdc3Bqhb6kfo40H6t0=; fh=qs3I539MIDyTRTzxxys0rkhfJ2HZom91agE91aCkhOM=; b=neQ5R9ZJ/ctGGbKRYCQE5MEdIicDuoHdFh1so6YtAxRkm9X10n8mrXJVdFGvlGJCBJ gLE8aageC3boeLZtq4FV9ow51xP1aOWBb6eNgNArwjlpDYVWofP1ypjpIunTmbn9WhYG 6eE7q0OFQABKxaCuqLDBLdkc5fwBIkgls/nGD3iSMoS/RdjAdMzWF9IpXDGjLnfBO2Le zi2tjL/4bTUV+W00ANvTgy89oLBkOcyvyaZf15luSsrkOWYMezN1ANz+cYDKGBdMpMqD RhvEBh4iVdpx5HhHFBCC6joC9CjRUjaynWnEJsaW/Kt58F5YElOv2ik5zS4HZ66Q95HT OtbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=JIv1rqb1; 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-178541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178541-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-a5a179463c5si614289466b.75.2024.05.14.03.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 03:40:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178541-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=JIv1rqb1; 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-178541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178541-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 B87871F21CDF for ; Tue, 14 May 2024 10:40:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4572613D2B8; Tue, 14 May 2024 10:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cloudflare.com header.i=@cloudflare.com header.b="JIv1rqb1" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 0210157CAE for ; Tue, 14 May 2024 10:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715681173; cv=none; b=ZVi8Cera8Y1Mo3y5IHLs2+ZRrNc1GVEdziweRyvgBUZKa3vtjKGN1+XwyY7G8KOwY3H3jol9YPKHLs7bGk+wEul8F0V9qFDXKEV9i2nM8MzsvjYwgzo1Q4Le+e7+W5ag8qgvx2q4Y5K2E/1IVtwSviKZVb7EJiOCsjJaEp+XyUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715681173; c=relaxed/simple; bh=JJMnPw1emDY+HwY78xe2ASFo8bdc3Bqhb6kfo40H6t0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DQ0mpMIJTcaqu3GEj7oDexk0BwJpJ/DmuAugk0dg7cuAut7zpqDmHZZju5mci5fmTbqKrgPr18BcM8lkW/lwIc56SLfsWRK6PU7/pwX5aXX1KwcFu6LhiIewbu0MdETqVO5ngVf6JztcA5Hh6Ek84T2CYyRX4XhjncxIPgcsSBI= 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=JIv1rqb1; arc=none smtp.client-ip=209.85.216.48 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-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2b33d011e5dso3635044a91.0 for ; Tue, 14 May 2024 03:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1715681171; x=1716285971; 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=JJMnPw1emDY+HwY78xe2ASFo8bdc3Bqhb6kfo40H6t0=; b=JIv1rqb1rvdYaUxCnNpMc9FPtDhIid1ji4rmyovP+X/GQTAOHCYRsPLOpJaz2obu2n BS97JrPlcm6LK0E5B8vnJslMZgBHZrImpDilNKis3RbK6g57jRS0CJVnlqS+4fnV+1ZB /H0wiLAiaokwVaMPHLh5UTPrSp0vMwG5WONeD/aR4wTK6GWbJ4pBk1oqXAnhg4QnAKWg OGZO8lYQ1xGg5jBDyDXteqVq4oRj8larJjSBu+MGZTvRuj4OPqsLqKW/5MGkvX1vM+RL k5feM2qnqIIPk5PNXOb8hYF9JR22/3OKxgGsbN9trPQEuPRGbGHPG0/oeAgAZPkYVzUL 8x4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715681171; x=1716285971; 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=JJMnPw1emDY+HwY78xe2ASFo8bdc3Bqhb6kfo40H6t0=; b=skWhbHxMntvX7D9XpDi2mKCm7SCQNNwKHMWWqdArpcgWkewOU6rzEOq74/OSAr83SY BVnNj20goYROntSL+DHoLuvLwzE7ySPbO7KcQOmu1URYMhgpPTouiTLwN4QjONKMXI1k x1QUK1rIQUTUisbsfq1u4R5rw2RynPSsFGxphlCNsbOW7J033tHG3vJaf5VAR0md1mVN tLdP4PcW6Kkd67qmU/LScXYvsPeFdY3HdLlzf60dguABPv9NyrcfgGPXwCgfGg484cP+ U8cGlQT7Q7XQ4cR118QWliBG2SYk7XfzODKGrk4Pcvdhw/XQn99+fHahfQsUozciCQnw Jdzw== X-Forwarded-Encrypted: i=1; AJvYcCVK47VhQC74Xw7W/Qh1lkQSW/AovOyjyRcDM5y+0P3Dn+QwnCl+vnJWRf8DEQ2ay3PznIdCSt2toOzoUlJIo/yzWc43W2c9Q8Kc7UZN X-Gm-Message-State: AOJu0YxM8xGaGYtSdWMcQOn8E5/25Io2C8HSROp9+tMDm0KPYmGHCmUz qXiF2VaqgM9I2UjHfsmDwzbMHgb57r5RHP1sXMcQkMF7gzh/vKARS+WGZgE7cqleZ53aZcWFomw bhkPERMQm2tUE/OinYdDZxdHZ1gT6n886gIe+xw== X-Received: by 2002:a17:90a:a108:b0:2b0:e497:56f2 with SMTP id 98e67ed59e1d1-2b6c70faab7mr18694886a91.10.1715681171194; Tue, 14 May 2024 03:06:11 -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 11:05:59 +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: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 asymmetric > 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 laying > 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] > give x.509 compatibility [2]. This patch set will be out soon and likely > 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. 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. 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. > [1] https://lore.kernel.org/all/20200518172704.29608-1-prestwoj@gmail.com= / > [2] https://datatracker.ietf.org/doc/draft-woodhouse-cert-best-practice/ > > BR, Jarkko [1] https://lore.kernel.org/lkml/20221014100737.94742-2-ignat@cloudflare.co= m/T/