Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2993978lqo; Tue, 14 May 2024 16:44:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/HUmFz2debJtYgoQ8F/2dIU4DxLylK/p9tjFlTdjbmTFWd3/IfzNNoAf69zKt7FLoHvI6wkH8jG0LcL1ABc5MNOiZ+pnTo05EL/7zaA== X-Google-Smtp-Source: AGHT+IGLxZRXzOixJ82cqiadOhWxvOwnzYxWhabY4b9RIG+TooF6pklo7peWAfmh7/xGxnMJJfUT X-Received: by 2002:a05:6214:3d0a:b0:6a0:b705:2800 with SMTP id 6a1803df08f44-6a168167d4fmr160542166d6.23.1715730254143; Tue, 14 May 2024 16:44:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715730254; cv=pass; d=google.com; s=arc-20160816; b=tgh6RABmpM2Z5vmTjuyId/YqBbyYZLSn6hrAKPU5UUokZyhurTibuh/rgLBkl6JaBJ hvPXe8lTrxYVrqKrkHvszsTnfFqtrhmogAHQ66h8bgE9ZXTHy+Stuuu9WOtZb+zUIfe7 8gD3FkaT43wcy97wFfK8bC+5xnBtoHDgXelEFcyiJ++xVDBvck02dRFPM5KCJxGdlPtU GiaqVaL33CWUkFXTqteZ4S5SuAYBKUAg4sDBMU2P/KNSXap1rdTQTyl0qKaDSzEBAKST X7Qv07RU9EmYHrcyLmBc1rx3N+kngI2eo5ZQPFijXQG5vV6V73Bf/TClBxmRgdUQCqDN pOuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=5fXhxr6R6How6i96KiTwGDRS1/LHld5++9rWLT25ly8=; fh=yEUNK02wqlLeiUPgkfclyeebZ2efwjGXgx85oGsUPec=; b=iXDe9It5b4mFgEK9dainduR0UucOfPYOEWuQcvaPAK0HQqj2cnXSO7ME3g7pjPQNVz 9Q+LSSW0uWnSHcOOzmpROt2v99AKADKEEklBKzFsguNpsmkFSvs/RTS3cbNpIuUu/u9u d71gHyT2Z+wd9pVgCYMk4hQKcSiivCt8RQhZRoQHsPU4kqL045I1d2ICaEJpgIUWeQxq Q3R5kcp1tLSvSFFFEyjWMf0vKZOlGAZZsh6eQd8iz9qSk88xg3RWQ5ReRNCZH2GKBrRk yvB4K7cpKns9aSjwixxR5WWj4+zhNb82KsHkRIUnQT4RnMpd5PvOIBWYWk5ms1VXMxh/ TANw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kQYFAMtV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179266-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2f0ac8si130703246d6.508.2024.05.14.16.44.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 16:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179266-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kQYFAMtV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-179266-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D95061C21026 for ; Tue, 14 May 2024 23:44:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC0D5182CA8; Tue, 14 May 2024 23:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kQYFAMtV" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15F8F1E491; Tue, 14 May 2024 23:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715730248; cv=none; b=Cxh5RS5kIgH2SQD+WdBQWX7hB0D1Ya1VSz94vt86C3DkMfiGY/IOAfCbl94hc3SOlZhd8e2DyH9H4f6Qruom6y8nt/gEHVlxHbogsKpKDXY+rGQW8Ry+Sfo2W2uyDw4aYdI4ommjdMsCMX8hzrK9tIFKnuS0xQqWJ1A/np3RKNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715730248; c=relaxed/simple; bh=zaif6LgrwelbYbMvOV0avkZGQgzBBS+ZGgSOPvFv5Go=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=mE32Eg5Km5y6AaPAxYRjY2PeQF+X+BGlnVffy8jE9MRdz4NqmlRhJyMoO2rvXG2kRsDC02lvrxSyWA9nxFA3eKS7rte7CswZZcZUkLhJSjTsZ6ybh4WPdFghZc0snsDyKU8VoqwWCH1plPzqLPT5OjtMcwI8RlWoPVk/cdSEA1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kQYFAMtV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20C09C32781; Tue, 14 May 2024 23:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715730247; bh=zaif6LgrwelbYbMvOV0avkZGQgzBBS+ZGgSOPvFv5Go=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=kQYFAMtVoFBQcgm7IkENwgGBRxVdWKIhGeFSGFl6UKu7wczxZE1jxhzMqIyHL19TM i/OWOc1hNF+hDC/o/V55qJYX3Qffab3Wd4RzgX/gTKKyJ362r1fALXVduScAKMOgkA CU8V3Xpi/irPUnfOQJPqEZ26qzosvmC8WCYGKANNKFa3zjevIYi2BqBMosI39BShME vfy38t9sV3aW3EMTKwwh188eVhghphvzDEqdJ/h2uqzWvSjphVhmBxMkjX9twe9J4I bzM/M1a+9dxX4mS4SmvJAFAlv2Oc4/l1wdiMqZ3wo6qj/CRkBJYX15RixOJgzPVCFv eTw/uW5Ln7AEA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 May 2024 02:44:03 +0300 Message-Id: Cc: Subject: Re: [RFC PATCH 2/2] KEYS: implement derived keys From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Ignat Korchagin" , "James Bottomley" , "Mimi Zohar" , "David Howells" , "Paul Moore" , "James Morris" , , , , X-Mailer: aerc 0.17.0 References: <20240503221634.44274-1-ignat@cloudflare.com> <20240503221634.44274-3-ignat@cloudflare.com> In-Reply-To: On Wed May 15, 2024 at 2:10 AM EEST, Jarkko Sakkinen wrote: > On Sat May 4, 2024 at 1:16 AM EEST, Ignat Korchagin wrote: > > Derived keys are similar to user keys, but their payload is derived fro= m the > > primary TPM seed and some metadata of the requesting process. This way = every > > What is exactly "some metadata"? > > > application can get a unique secret/key, which is cryptographically bou= nd to > > What is "cryptographically bound". Please go straight to the point and > cut out *all* white paper'ish phrases. We do not need it and will make > painful to backtrack this commit once in the mainline. > > > the TPM without the need to provide the key material externally (unlike= trusted > > keys). Also, the whole key derivation process is deterministic, so as l= ong as > > Why trusted keys is inside braces. It is not important for the point > you are trying to make here? > > > the TPM is available, applications can always recover their keys, which= may > > allow for easier key management on stateless systems. > > Please drop "stateless system" unless you provide a rigid definition > what it is. I have no idea what you mean by it. Probably not that > important, right? > > > > > In this implementation the following factors will be used as a key deri= vation > > factor: > > * requested key length > > * requesting process effective user id > > * either the application executable path or the application integrity > > metadata (if available) > > NAK for path for any possible key derivation. They are racy and > and ambiguous. > > This should have been in the beginning instead of "some data". What > other implementations exist. For me "this implementation" implies > that this one competing alternative to multiple implementations > of the same thing. > > I do not like this science/white paper style at all. Just express > short, open code everything right at start when you need and cut > extras like "stateless system" unless you can provide exact, sound > and unambiguous definiton of it. > > Just want to underline how this really needs a complete rewrite with > clear and concise explanation :-) This won't ever work. > > > > > Key length is used so requests for keys with different sizes result in = keys > > with different cryptographic material. > > What is "key length"? Please refer the exact attribute. > > > > > User id is mixed, so different users get different keys even when execu= ting the > > First of all it would be more clear to just s/User id/UID/ > > And make obvious whether we are talking about ruid or euid and how > this interacts with GIDs. > > I'll look at the code change next round if the commit message starts > making any sense. Right and neither UIDs and GIDs are applicable for key derivation for quite obvious reasons. So NAK for that too. You can make them point out unlimited different identities... BR, Jarkko