Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp307841rdb; Thu, 1 Feb 2024 09:03:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOg/Fl17uvJSdfeNnbokbQKmHpWvTuhPwpJdJnIcjYqE+xG19S5LlsDz+BF3HJ4FkdR+2L X-Received: by 2002:a05:6a20:e687:b0:19e:3e76:2d37 with SMTP id mz7-20020a056a20e68700b0019e3e762d37mr2871439pzb.59.1706807008954; Thu, 01 Feb 2024 09:03:28 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1706807008; cv=pass; d=google.com; s=arc-20160816; b=Kdmk2YlJPK62ujKUJBkVxnDpLGUVBeDIcNycRp0ss2T9csRgB5Jr9XsrUKapBQZKsP Ti+sSPI3bTJQ98+QKXlwDTBwZJDVTBNBPjySKZATSdFmt2ez3hCqO4EnLhwocr4LTEkY jXi5nFDI1US8+4mvOUrxsCvzKQMTD+3LfUwv+tK6uFJMre7ZSLtGU9cRxfuQ61akWJpF uSCOLggpRMJ3f4cwi//axsVSc2nVoGJlkK8/DVF9e9A95DrXQq9hD+Jr8UscVWO1RbB+ 9zEyYG5m2y0vgXU1FHQquBz3fwuP3p6v5vhf1TlYyvQtu8a1ZgcX7XnEYSREWtrmEwdv hdow== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Exjrm0JkMmrLHfveYJPV4JzDlCBEpPbHczsuJz8we7Q=; fh=xRebXyBgdrd0P/usVmWckHa7bMYnUct8RkB4yNVCjX4=; b=LiEd6Aqc7UKjW9ikUrsClHLqOI8gJHcaGRn5J6vYlCnY9z4gJt+Pp3MIDxUXZOdrag k0LfVR8Sx4KLpXNUx7Il7BxgMoFekyGsE4k4FLNltflFSY8ocau4jKP4uvf3J6uNPji0 TBnXThpt9AErIu99vpmNm/ALhBvU2bOR8I9IhGDrUBUA//natx9LlFy+v6fE3vIFWyKN mFvqWTNX0ZZjSTJ5GvZaJ/TJBh3S0QIl0W6h4hqyzkpye/+jWet+crNk4AKbZXUlcqNH nfHE2Jl5GvKCBqOqu277FNEd8lfycqOCGObA6De4V1oyn4taPK0QGm97oSZgw5iDCrpx M9bQ==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@apertussolutions.com header.s=zoho header.b=Touy7tyx; arc=pass (i=2 spf=pass spfdomain=apertussolutions.com dkim=pass dkdomain=apertussolutions.com); spf=pass (google.com: domain of linux-kernel+bounces-47024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47024-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVJSYpYwtXp5d3maKciC6906g/mdpWBKrSy+QvKDbMyMfoltTH1Xxxfzjbe/tLEpYdc+Jw6CfSTOegFvYbG436MHR4KPJYsocaARp5IEg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 74-20020a63004d000000b005dbcf14be2bsi5357466pga.800.2024.02.01.09.03.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 09:03:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@apertussolutions.com header.s=zoho header.b=Touy7tyx; arc=pass (i=2 spf=pass spfdomain=apertussolutions.com dkim=pass dkdomain=apertussolutions.com); spf=pass (google.com: domain of linux-kernel+bounces-47024-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47024-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C0076289553 for ; Wed, 31 Jan 2024 19:41:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C60B3EA8F; Wed, 31 Jan 2024 19:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=apertussolutions.com header.i=dpsmith@apertussolutions.com header.b="Touy7tyx" Received: from sender4-of-o50.zoho.com (sender4-of-o50.zoho.com [136.143.188.50]) (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 8C1D73B198; Wed, 31 Jan 2024 19:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.50 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706730098; cv=pass; b=pbYs0rl+lP33d3AK8yZuerAYPkufqGhPxudxU1jpSIuScy9HdzQumwJFmP06MnmBgbZutW5HmbHv3XAmdphxeD+cd3DdWgypDtwjMFubhZDsbIClF0oUPMDBrUg5TWLs54osbJZKzWBrDTMFejiTs9faIF1TenCH0MLuBenxv/w= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706730098; c=relaxed/simple; bh=MVaPKWXDpTdplz7PBiWoPwFbLQhMQk9zgGSMyc9P+Ao=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IYJ0EzX0KSM24utu2nPX4o84QaYQUhmggkco009NogAxlfSpHsUllbI3sJvv9g9auRNvgCfR4+g+VATQGPlkWDe5KSL8RsbimC32+EnHyiQh1mZJmG+FucX5v+YXWEuHGXz4xdgi0qelqtO5PUdtdGIv0rVnNFEbvO1LSuYElnc= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=apertussolutions.com; spf=pass smtp.mailfrom=apertussolutions.com; dkim=pass (1024-bit key) header.d=apertussolutions.com header.i=dpsmith@apertussolutions.com header.b=Touy7tyx; arc=pass smtp.client-ip=136.143.188.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=apertussolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=apertussolutions.com ARC-Seal: i=1; a=rsa-sha256; t=1706730045; cv=none; d=zohomail.com; s=zohoarc; b=JmiHzRNYzl8PNHVj/q3cq1jsYD13Wow6VM65eoYQvbvL7XWdxDkRjSkaq+Us6I6iCiSah8xk2sDB8k9cDdkApeORl5eJcPjEJBJ+ujX6Lwbl42vttFUcfdG6GiUsvWaQpzQV+FhubqRgyuTWr+c8ovRH0qfLDI/7G9u3hm01uvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706730045; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Exjrm0JkMmrLHfveYJPV4JzDlCBEpPbHczsuJz8we7Q=; b=R6fUABgPPLK4rzWIfi2PHbAQWuLxbFDoJ1MOU914VB53HaC6gEHHO64MD6b5uuexKnUad58yTH1tBLGZkJHBIF6Gz9V9sH/S3FCzHrRXmVfSoJGWx6xj3zqIlxRML5pFGHOP4criJ8aKqajXMs5PGGSDdqEKkyIWF0C6V23LoAU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@apertussolutions.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1706730045; s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=Exjrm0JkMmrLHfveYJPV4JzDlCBEpPbHczsuJz8we7Q=; b=Touy7tyxCDR6MDVHEF9X5UOd2e11wC8c5olfzh93diH2AcMUlPbV8TfJ8uqABQs6 rozg5ugsmviXJTlkRegSFn4yy4BbMM4C0tKG3oJA4zW0jqrJMOVwDOz2x1a7ctOVf3r MBwHetGfwY3/p9Sp5cUjgZFBpeMQdsjggAtJxqZI= Received: from [10.10.1.138] (static-72-81-132-2.bltmmd.fios.verizon.net [72.81.132.2]) by mx.zohomail.com with SMTPS id 1706730042244444.47380530398664; Wed, 31 Jan 2024 11:40:42 -0800 (PST) Message-ID: Date: Wed, 31 Jan 2024 14:40:38 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 02/13] Documentation/x86: Secure Launch kernel documentation Content-Language: en-US To: Alyssa Ross , Ross Philipson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, ardb@kernel.org, mjg59@srcf.ucam.org, James.Bottomley@hansenpartnership.com, luto@amacapital.net, nivedita@alum.mit.edu, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com References: <20231110222751.219836-1-ross.philipson@oracle.com> <20231110222751.219836-3-ross.philipson@oracle.com> From: "Daniel P. Smith" Autocrypt: addr=dpsmith@apertussolutions.com; keydata= xsJuBFYrueARCACPWL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jo5yJbRjT93Hl0vMY= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ZohoMailClient: External Hi Alyssa, apologies for the late response. On 11/12/23 13:07, Alyssa Ross wrote: >> +Load-time Integrity >> +------------------- >> + >> +It is critical to understand what load-time integrity establishes about a >> +system and what is assumed, i.e. what is being trusted. Load-time integrity is >> +when a trusted entity, i.e. an entity with an assumed integrity, takes an >> +action to assess an entity being loaded into memory before it is used. A >> +variety of mechanisms may be used to conduct the assessment, each with >> +different properties. A particular property is whether the mechanism creates an >> +evidence of the assessment. Often either cryptographic signature checking or >> +hashing are the common assessment operations used. >> + >> +A signature checking assessment functions by requiring a representation of the >> +accepted authorities and uses those representations to assess if the entity has >> +been signed by an accepted authority. The benefit to this process is that >> +assessment process includes an adjudication of the assessment. The drawbacks >> +are that 1) the adjudication is susceptible to tampering by the Trusted >> +Computing Base (TCB), 2) there is no evidence to assert that an untampered >> +adjudication was completed, and 3) the system must be an active participant in >> +the key management infrastructure. >> + >> +A cryptographic hashing assessment does not adjudicate the assessment but >> +instead, generates evidence of the assessment to be adjudicated independently. >> +The benefits to this approach is that the assessment may be simple such that it >> +may be implemented in an immutable mechanism, e.g. in hardware. Additionally, >> +it is possible for the adjudication to be conducted where it cannot be tampered >> +with by the TCB. The drawback is that a compromised environment will be allowed >> +to execute until an adjudication can be completed. >> + >> +Ultimately, load-time integrity provides confidence that the correct entity was >> +loaded and in the absence of a run-time integrity mechanism assumes, i.e. >> +trusts, that the entity will never become corrupted. > > I'm somewhat familiar with this area, but not massively (so probably the > sort of person this documentation is aimed at!), and this was the only > section of the documentation I had trouble understanding. > > The thing that confused me was that the first time I read this, I was > thinking that a hashing assessment would be comparing the generated hash > to a baked-in known good hash, simliar to how e.g. a verity root hash > might be specified on the kernel command line, baked in to the OS image. > This made me wonder why it wasn't considered to be adjudicated during > assessment. Upon reading it a second time, I now understand that what > it's actually talking about is generating a hash, but not comparing it > automatically against anything, and making it available for external > adjudication somehow. > > I don't know if the approach I first thought of is used in early boot > at all, but it might be worth contrasting the cryptographic hashing > assessment described here with it, because I imagine that I'm not going > to be the only reader who's more used to thinking about integrity > slightly later in the boot process where adjudicating based on a static > hash is common, and who's mind is going to go to that when they read > about a "cryptographic hashing assessment". The scenario that first came to mind for you, specifically the verity root hash, is in fact a form of signature checking assessment. A signature is nothing more than saying here is a hash with provenance that is enforced by the measuring entity. For a PKI signature, e.g. UEFI Secure Boot, the provenance is confirming that the encrypted portion of the signature can be decrypted using the CA public key. For the case of dm-verity, the provenance of the hash is its source, that it came from the command line. If you consider the consequences presented for a signature checking assessment, one should see the same issues with dm-verity: 1) any logic in the kernel, intended or injected, could tamper with the validation of the hash, 2) there is no evidence of each block hashed into the final hash that is assessed, and 3) the system is responsible to ensure only the correct hash has been provided on the command line. Another way to consider the above, there are always two actions for assessing integrity, measurement and assessment. When both actions are delegated to a single entity along with a mechanism to provide the known good, this is a signature checking assessment. When these two actions are delegated to two separate entities, this is a cryptographic hashing assessment. In TCG parlance, the former is a Root of Trust for Verification (RTV) chain and the latter is a Root of Trust for Measurement (RTM) chain. And to clarify the example provided by Ross in using the TPM seal method. This is a cryptographic hashing assessment, as the two functions are done by separate entities. The software makes the measurements while the TPM makes the assessment. In theory, the solution employing a TPM seal will have established what the expected sequence of measurements should be, and ensured the TPM seal was the final and correct measurement. I don't know if you will find it too rudimentary, but I feel I did a fairly decent job covering on this in the first ever TrenchBoot talk[1]. [1] https://www.platformsecuritysummit.com/2018/speaker/smith/ > The rest of the documentation was easy to understand and very helpful to > understanding system launch integrity. Thanks! I am very glad to hear you found it helpful. This is a very complex topic, and trying to break it all down for an audience that may have zero background and an interest to help is no small undertaking. V/r, Daniel P. Smith