Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp877724rwb; Thu, 11 Aug 2022 11:29:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4AM/ylRkaL+Econ99VKKZQpRe44HpvHvDJEvVuN+g0o+rd2FA+2oVN4bw/3L7VD7XlVQVA X-Received: by 2002:a17:902:9043:b0:16c:d862:fdf5 with SMTP id w3-20020a170902904300b0016cd862fdf5mr390185plz.97.1660242551259; Thu, 11 Aug 2022 11:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660242551; cv=none; d=google.com; s=arc-20160816; b=GBhQyFtXQMHTU97qr05QPF3aOHD5jzqNPaO9VFUB89wbKmrOTJbjxTSPWq5Oq+QWsw /lXhgCtO77Lx9oKo4cEf6c8wQHJSykxx5eLwsZCBbCEZ+C0np0IOjXw2CR3ofvtwzoDU mKXKJ9QQ5HNwMehUthuiMZiTtEdh3diqq5H2erySqIQeRfIL7c3D2F6hI91fTwSHls4M ExjbBqfLj2GjMO22AfhtM/CNQDjmpb/aGmdHiMt2Npyd/pQPuP0dCYAo1lXvjwvnvPvc SBCgqy2rr1/JV3hDOQy8CQSC2corvFzxtUYQ8zdrVUlSe7ICM3DujZaNrdGYgqcrRRWA sRAw== 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=qB+5KB/LDaG2DPe57w232joZCgyLVChS9FLuzmVPdRA=; b=GapUPORiq2FUZzCErt9qCi7Qo1bQ7oBWhBpRSseIxKE8EulYgsEX48FMijpWe6nBIE tOEnaqsjXwX78yJy93smk0iR4qWmTCCpQxy86wcXYd1Dh9AozKm1UHZwLLCgjAEqo/x3 /x0InGmOkIBusy8+ARZ7PZXeoQSBd5EHJLhzBYZ4xBbi999Ct4GsiN6x7lm8EeRI/98j 2juBA+uKPF4IagGOvW0gi+gzOj88nLZ4LcvGJmECdI3M8hF7nEZg2bdhI7wEbUQjh0Hv WfrPMcUoM03EBR04kjPGC85N0LwY+d5piU3oc3+VNHaWX062kG2WtXehFirzGnbCODQ8 bwKA== 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 w6-20020a6556c6000000b0040d22b45aadsi108352pgs.459.2022.08.11.11.28.55; Thu, 11 Aug 2022 11:29:11 -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 S234938AbiHKSZJ (ORCPT + 99 others); Thu, 11 Aug 2022 14:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234093AbiHKSZI (ORCPT ); Thu, 11 Aug 2022 14:25:08 -0400 X-Greylist: delayed 88703 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 11 Aug 2022 11:25:03 PDT Received: from cavan.codon.org.uk (cavan.codon.org.uk [176.126.240.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B16BC9753E; Thu, 11 Aug 2022 11:25:03 -0700 (PDT) Received: by cavan.codon.org.uk (Postfix, from userid 1000) id 2E2B040A56; Thu, 11 Aug 2022 19:25:02 +0100 (BST) Date: Thu, 11 Aug 2022 19:25:02 +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: <20220811182502.GA32433@srcf.ucam.org> References: <7aab2990-9c57-2456-b08d-299ae96ac919@apertussolutions.com> <203110bb-b70b-b4f1-9453-46136659f84c@apertussolutions.com> <20220810174638.GA7906@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 Thu, Aug 11, 2022 at 07:25:58PM +0930, Brendan Trotter wrote: > Hi, > > 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. > > Measurements are not opaque objects. If you're not able to reconstruct > > the expected measurement then you're doing it wrong. > > OK; so to detect if boot loader has always given kernel a bad/forged > measurement; the kernel repeats all of the steps involved in creating > the measurement itself exactly the same as the boot loader should have > (but might not have) so that kernel can compare a "known > good/trustworthy" measurement with the useless measurement that the > boot loader created for no sane reason whatsoever? No, some external agent does. Code running on the local machine can never determine whether the machine is trustworthy.