Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1375819rwb; Thu, 11 Aug 2022 23:00:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aUby13h9MvAyMTF4LqWq6pd/4lyeX7ZL84IuUOQc4Nfel0df9Zj0d0TXhzdVHY8ZkGjuZ X-Received: by 2002:a17:907:6e9f:b0:730:e923:a378 with SMTP id sh31-20020a1709076e9f00b00730e923a378mr1625844ejc.71.1660284023903; Thu, 11 Aug 2022 23:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660284023; cv=none; d=google.com; s=arc-20160816; b=GRkm7TEkEplRVLu4zOWuwG2zPL++BpyqkvEWzlmVdFYklE4nsr7RcBq64x0A51h7zD ILS+ibrz9FYS3HWagSbQiwwg9XEHvtYtUiPplc36Luv0Ahz/m9DlLkiQc8XEKzevGqsv KBvbN4UslIw/gJuU7wl06CxfTIfSZfogGORJRH67cmN6whUr4kjfXclje/WfxSCcPFCd 7rNdC2HnuA2AZdC+gJbIll1Xs/2Z6ctN6h/HQ7EMlowGUVenLIXUxPZJ0LUARpMGir3e pNcyVYlc66ria6/Z7WoORRRQihEQII1kE/rruoK1L/eZUt4V+u7mLIAbTaMQYxV1AoJ+ a7Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ZIIASIVN9THzb76jHYFtIQmDp/MctOr1SO03b/AbjGs=; b=Ln8vwGlkA5ZGRs7M72bpG2IwBSdItSUk/P9H9c2nb/jQcMJxVSnWDG26OPlFoCkzy0 t07WhH/Tlckdb6YqURwPRRxYaCjcK5h9rvzkudQP00+OutI06oYIIbmit06oZOrMDmwD cD7XMPAwq0qNlO1FUpisIF49SU8KAbyQNiZ9zocTHu56+rvS4prbD/4ayzwnStuCQWKm iNlDYqT5SrDgUWO1I0SWKH+oshtkj5I3vgk2Q2d9T+dZKY7VZgtHp0vFxgKniou4xGSe JAXGZONz+5o4T+kc1VINc9N9F4TqPjn5FhAAlWZgTPFAMKNk6gv5t6XJxLAFfccFf6RK IVkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb5-20020a170907960500b007312456b75fsi1371187ejc.270.2022.08.11.22.59.58; Thu, 11 Aug 2022 23:00:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236698AbiHLFyo (ORCPT + 99 others); Fri, 12 Aug 2022 01:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiHLFym (ORCPT ); Fri, 12 Aug 2022 01:54:42 -0400 Received: from cavan.codon.org.uk (cavan.codon.org.uk [176.126.240.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90959A222B; Thu, 11 Aug 2022 22:54:38 -0700 (PDT) Received: by cavan.codon.org.uk (Postfix, from userid 1000) id 168AC40A77; Fri, 12 Aug 2022 06:54:37 +0100 (BST) Date: Fri, 12 Aug 2022 06:54:37 +0100 From: Matthew Garrett To: Brendan Trotter Cc: The development of GNU GRUB , Ard Biesheuvel , Daniel Kiper , Alec Brown , Kanth Ghatraju , Ross Philipson , "piotr.krol@3mdeb.com" , "krystian.hebel@3mdeb.com" , "persaur@gmail.com" , "Yoder, Stuart" , Andrew Cooper , "michal.zygowski@3mdeb.com" , James Bottomley , "lukasz@hawrylko.pl" , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, James Morris Subject: Re: Linux DRTM on UEFI platforms Message-ID: <20220812055437.GA10952@srcf.ucam.org> References: <203110bb-b70b-b4f1-9453-46136659f84c@apertussolutions.com> <20220810174638.GA7906@srcf.ucam.org> <20220811182502.GA32433@srcf.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 12, 2022 at 12:52:58PM +0930, Brendan Trotter wrote: > Hi, > > On Fri, Aug 12, 2022 at 3:55 AM Matthew Garrett wrote: > > On Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > > > On Thu, Aug 11, 2022 at 3:16 AM Matthew Garrett wrote: > > > > The kernel has no way to know this - *any* code you've run before > > > > performing a measurement could tamper with the kernel such that it > > > > believes it's fine. This is just as true in DRTM as it is in SRTM. But > > > > you know what the expected measurements should be, so you're able to > > > > either seal secrets to those PCR values or rely on remote attestation. > > > > > > In this scenario the kernel has no idea what the measurement should > > > be, it only knows the measurement that a potentially malicious boot > > > loader felt like giving the kernel previously (e.g. when the kernel > > > was installed). > > > > Even if the kernel has an idea of what the measurement should be, it has > > no way to verify that what it believes to be true is true - any > > malicious code could simply have modified the kernel to believe that > > anything it asks the TPM returns the "correct" answer. > > Right. To achieve the best possible security; you'd need Secure Boot > to ensure that the kernel itself wasn't modified, and then the kernel > establishes a dynamic root of trust itself. You can't rely on Secure Boot because compromised firmware might fail to implement it, so you're back to relying on dynamic trust. > Anything involving a boot loader (e.g. Secure Boot ensure's boot > loader wasn't modified, then boot loader ensure's kernel wasn't > modified, then ....) increases the attack surface for no benefit. I honestly feel like we're talking about different things. Can you describe the attack vector you're concerned about here? > I'm not convinced an external agent can detect "bad/forged > measurement" either. E.g. if a MiTM boot loader always provided a > bad/forged measurement the external agent won't detect it (as the > measurement always matches the expected measurement), and then if the > MiTM boot loader is replaced by a good/honest boot loader the external > agent will decide that the good/honest boot loader is malicious > because its measurement doesn't match the expected bad/forged > measurement. The point of DRTM is that the platform (in the form of an authenticated code module running on the CPU, outside of the control of the OS) performs a measreument of a specific point in time. The policy it's provided with allows an external agent to identify which component of the runtime system is being measured. If an external malicious agent has been executed then the measurement will be different as a result.