Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2760755lqo; Tue, 14 May 2024 08:23:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUx36XNn1s/3mYytyDjOSiEKdJYaJb8BKeo1hH1CWKGJqEMXMPb5+PBvWILUPKCjqGVrrEJuqUbZsOTk+IMoxRmX2W4CI386jz29h4+5A== X-Google-Smtp-Source: AGHT+IGLkSoYyRRHGnxgXNFqWwD8QSXn6T1A3jcUaKnSA4vwCnKk660UYdYjUehWHwUNJzDXkJpX X-Received: by 2002:a17:90a:bf05:b0:2b9:a7bf:8701 with SMTP id 98e67ed59e1d1-2b9a7bf887amr1162788a91.21.1715700180756; Tue, 14 May 2024 08:23:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715700180; cv=pass; d=google.com; s=arc-20160816; b=wTruzh7rkPggjjdr5vlXY+t/I9m/9ijpC0q6glJc6FatmsBcqyMcvGN2N3r/+4IN/G doHDmgvSdMDg+nZJ1Te7x4uudkSzkYZEilAjTDlTq5q2gJTUXhzOFI8+P2o6Z5cQcYHj /e//WydLug6cUgsRK5BfJaJflkgGYhtLIsj8H/n0RDDXZzaAPnpCXGlX13qxDw5tApyF u5Aw9P1XueEGL6TptjD53xKfYdHeLmn6EpvTcDN4XzGGsY1KpItGZmRtFYCXgeCV2goT X0XskTUrDnDz4mmWc4xhJjWRrOZDVDFTL0cj+dhO7+N77R1mh7Tii2jmclmWVSIItAki RJLw== 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=o7rLHRAFhpdgvazb32ZBJrjHR5q5bKRUEZsIKrO9LgI=; fh=yS9NQ6daWbjuzbtfIsHfh8xgCZ7azL6I4SVox6zKglI=; b=zSYze13qLIa6IJIOxrEwbOJIztftg3xToMhEJaTzAq0stEE13V8ZRmmMud7kTJ3kuZ uhNSda8IZuqtX9cwoWm3aVB+jdakgE8MVThd53+OVF5+4+I3R1yXaKL/1mwhmuHLJyxt Uid2WSY5nSssihIzKe4zrH9fe2nnYvIW5tOQ3HHhHQ974fspPAXLWnqjQ+tV19ajPt8W nf8xONjoT+aDP1nr3PaAWew3cg2MqhmOaGH+2QOGydDZUr8K7bKZiDn8lIfjnv5FoyMs sBzCLooLXXndDQxLHEIL6VYC7P4JBKfhMa5350ko2tayqBSLSf/FGeM36+xKdlU7ukFg QCnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f1+G9nnn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178848-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5c7e6si13700203a91.48.2024.05.14.08.23.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 08:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f1+G9nnn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178848-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7BE57B203FC for ; Tue, 14 May 2024 15:21:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EE9017EB9A; Tue, 14 May 2024 15:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f1+G9nnn" 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 4CAD917BB3E; Tue, 14 May 2024 15:21:10 +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=1715700071; cv=none; b=sn38KgCO8R0xSSHH2C0jmNHzHvSShD5+iBq2nnn+1x8UZX5cZLltRDG1jBXN7BUbnlk5fv+GM1pbWhS760Auoe7I86x7fp5YFQNY63RLw8QeKCgF74TDHBxnvrxl2C7CqZttiohy9l3bt2/oUwJy0bEsoCWxGeZUAb1hbhoejmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715700071; c=relaxed/simple; bh=dt6KEmyr9WRZ3KLJyEpAgM2p7Pm++GEzc+zDaBvA6zQ=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=iiL50xiCQtunagbXf3juYp2zhBc1wXXNYrOKFlkHSfE7j054zxgDlewhK9LLMRjI3SmIMqDVcvwPqnHZbHLI4H+y1mZZwzrvhihXGPwjTKiqI3gwsXlqiyYT7aBwG41LLTrXPZgR6AbWc5ssAoQC41qWqBwQzO5/G1TjqeaenTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f1+G9nnn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 574E7C2BD10; Tue, 14 May 2024 15:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715700070; bh=dt6KEmyr9WRZ3KLJyEpAgM2p7Pm++GEzc+zDaBvA6zQ=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=f1+G9nnnE8FAgaxfw8WydJ+Y7C7L37+Bd1CM7qPsgqRfl70d4tJqauhYT6eHp1aLx 56iT8WXsRM/esL2uSR6g9Gtgje1guV1y1hy6jKTTt6ckodDZUreWijv/2KsM/NAW/k 4Pwxc/qqIOLdSAy6dZ6iemzPQfP0aaYZqtQCBqe0Lcz3brc63KgqOnQn18kkkStME6 2CWgqxfAxH7twA1OMS8Ok3+wZcoc0Rtw1DWtW2heEJihz7w1P1MbW+O9pUxWQ+ljXJ /p9ni7DpHzxO3FkSRlaCGgz9BlrIiMyuPvvnT/dQJs+9R9UyRX4ktkHKVeVw6A9bo7 vueoEP0E33wfQ== 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: Tue, 14 May 2024 18:21:06 +0300 Message-Id: Cc: "James Bottomley" , "Mimi Zohar" , "David Howells" , "Paul Moore" , "James Morris" , , , , , Subject: Re: [RFC PATCH 0/2] TPM derived keys From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Ignat Korchagin" X-Mailer: aerc 0.17.0 References: <20240503221634.44274-1-ignat@cloudflare.com> In-Reply-To: On Tue May 14, 2024 at 5:30 PM EEST, Jarkko Sakkinen wrote: > On Tue May 14, 2024 at 5:00 PM EEST, Jarkko Sakkinen wrote: > > On Tue May 14, 2024 at 4:11 PM EEST, Ignat Korchagin wrote: > > > For example, a cheap NAS box with no internal storage (disks connecte= d > > > externally via USB). We want: > > > * disks to be encrypted and decryptable only by this NAS box > > > > So how this differs from LUKS2 style, which also systemd supports where > > the encryption key is anchored to PCR's? If I took hard drive out of my > > Linux box, I could not decrypt it in another machine because of this. > > Maybe you could replace the real LUKS2 header with a dummy LUKS2 > header, which would need to be able the describe "do not use this" and > e.g. SHA256 of the actual header. And then treat the looked up header as > the header when the drive is mounted. > > LUKS2 would also need to be able to have pre-defined (e.g. kernel > command-line or bootconfig) small internal storage, which would be > also encrypted with TPM's PRCs containing an array of LUKS2 header > and then look up that with SHA256 as the key. > > Without knowing LUKS2 implementation to me these do not sound reaching > the impossible engineer problems so maybe this would be worth of > investigating... Or why you could not just encrypt the whole header with another key that is only in that device? Then it would appear as random full length. I.e. unsealing 1. Decrypt LUKS2 header with TPM2 key 2. Use the new resulting header as it was in the place of encrypted stored to the external drive. 3. Decrypt key from the LUK2S header etc. ? BR, Jarkko