Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2221635pxb; Wed, 30 Mar 2022 19:48:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUkIzu5W6mKm77qOL1kClKLNJbZZXluFCPZ7uxAzsAmVUpCOuXsR1c/DmtEu6IMh48EVgU X-Received: by 2002:a62:ed0e:0:b0:4fa:11ed:2ad1 with SMTP id u14-20020a62ed0e000000b004fa11ed2ad1mr2896817pfh.34.1648694894759; Wed, 30 Mar 2022 19:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648694894; cv=none; d=google.com; s=arc-20160816; b=n8hnpSBzHnOIv5ZTnlGRidg6VXgYLBnpDqXCd7J3eW+2rUZkKzQgdagKF/6/fBLOP5 SWJi1PeGRDLSPGicNYgZOTWiW5RbUHYG9yhgh5u1JSLPrOwTloaqdV23VzejAAezPwfZ uM5V4eq/U4uVQtnrC69hkf2Ogvn8apmd7s24N8ywn/9hSORoEWu+jXVX89UAdL4hCynI hbR/CnldNX9VSSXP27LXR1Y/XOgNDK2Y3xyt7hzk6BrIxdtG6gUq8HqyqjFHspD5QE/2 jnqzcZdtq55WWsGVblvmJo5HVWhwnH9ms8uTaSURIpr/doCu6A+pvAUKk9t5JVpD3lv4 utaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0XeYhsl1ZxDhV4sY7GOOVxgbryVcP5F+HskgMIPxod4=; b=xLEAUr26Yxj/2xRbCenqUv6qH3ShHaLQiT/cpktA9ntZmrN6M/A1MIJwp0GXRD/Yzr iqFZ0ypRN+iuqcX3ot1DpHRja3PF/UZcWOvEs40iIEl/GAoHISPmCvYbRvyAoFhsmYqw Xw5m6wKRYUWD84WvsVduGyftXGOmqYuAB5yDpletc4piP37wVMfAS3iC+lLeDaOEVup0 zxqkge3F0ZTLRNgJMROLcf1oeVnLun9bkSPoG6PMUkGcIsvdu+nklGqy9jlUhlczcEvo Ivpj51MPXDSbjPEHvjRF3rG0lcVtvRsapZ9wQDWMbm59ndrl+jZOwZKflb9xV5h1v1tr U/nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ExC06KEr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id rm12-20020a17090b3ecc00b001c6fb9a0ff6si1784244pjb.161.2022.03.30.19.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:48:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ExC06KEr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9BFD7BB92B; Wed, 30 Mar 2022 19:37:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243873AbiC3Hl1 (ORCPT + 99 others); Wed, 30 Mar 2022 03:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235235AbiC3HlW (ORCPT ); Wed, 30 Mar 2022 03:41:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C83851AF13; Wed, 30 Mar 2022 00:39:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E6B8B81B7D; Wed, 30 Mar 2022 07:39:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C97EC34118; Wed, 30 Mar 2022 07:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648625975; bh=0XeYhsl1ZxDhV4sY7GOOVxgbryVcP5F+HskgMIPxod4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ExC06KErHmWeEDo4Zhv8jhhzxIMG1rqWzp0/vfcmYfr8GgJgfXb0rTaznNTAdclYy k+piUt5CgH2QgNxa1be2bTf3tleGz4lc0hOvN08BW9W8xdHxqitPJYii4yGdKurXTt o0diCJUcD86JGy8q4nRLORpmkkr0i1coHwvI/ZduND1fyRqqnThtp9JBq4t1KCvp5D ykOCCxMMgx3Y+DOQWGc4iNnoofojEzIYGVOTPiOJaq2qf3SEENS475t/5amuAk3kib gYMB1JKlv2PI4q0yPeNS8sbajJMLg3WmvQfP9XhoJbDjz6l00H41Qa/e2UMu9yxjDo T3NYuemXFHnig== Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-df26ea5bfbso3687338fac.1; Wed, 30 Mar 2022 00:39:35 -0700 (PDT) X-Gm-Message-State: AOAM532IVYWfTOxQIhJgrVm5Ln7K1HrCq+tFS1W2PPfcQZmC7KVAJMtZ oPAYt6YHE0TsQyPB4uRmi6J5HKshzrzL4kPo2GA= X-Received: by 2002:a05:6870:eaa5:b0:da:b3f:2b45 with SMTP id s37-20020a056870eaa500b000da0b3f2b45mr1580495oap.228.1648625974238; Wed, 30 Mar 2022 00:39:34 -0700 (PDT) MIME-Version: 1.0 References: <20220329174057.GA17778@srcf.ucam.org> <20220330071103.GA809@srcf.ucam.org> <20220330071859.GA992@srcf.ucam.org> <20220330072755.GA1169@srcf.ucam.org> In-Reply-To: <20220330072755.GA1169@srcf.ucam.org> From: Ard Biesheuvel Date: Wed, 30 Mar 2022 09:39:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux DRTM on UEFI platforms To: Matthew Garrett Cc: Daniel Kiper , Alec Brown , Kanth Ghatraju , Ross Philipson , "dpsmith@apertussolutions.com" , "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 , Linux Kernel Mailing List , The development of GNU GRUB , Kees Cook Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, 30 Mar 2022 at 09:27, Matthew Garrett wrote: > > On Wed, Mar 30, 2022 at 09:23:17AM +0200, Ard Biesheuvel wrote: > > On Wed, 30 Mar 2022 at 09:19, Matthew Garrett wrote: > > > From a conceptual perspective we've thought of the EFI stub as being > > > logically part of the bootloader rather than the early kernel, and the > > > bootloader is a point where the line is drawn. My guy feeling is that > > > jumping into the secure kernel environment before EBS has been called is > > > likely to end badly. > > > > If you jump back into the system firmware, sure. > > > > But the point I was trying to make is that you can replace that with > > your own minimal implementation of EFI that just exposes a memory map > > and some protocols and nothing else, and then the secure launch kernel > > would be entirely in charge of the execution environment. > > We can't just replace system firmware with an imitation of the same - > for instance, configuring the cold boot prevention memory overwrite > requires us to pass a variable through to the real firmware, and that's > something that we do in the stub. > But these are exactly the kinds of things the secure launch kernel wants to be made aware of, no? The secure launch kernel could just MITM the calls that it chooses to allow, and serve other calls itself. But more fundamentally, I am failing to see the distinction here between stub code and other kernel code. Is it related to the exact moment the secure launch event is triggered? The way I see it, being able to marshall everything that goes on between the stub and the secure launch kernel allows the latter to make an informed decision about how the stub has manipulated the global system state before triggering the secure launch event at exitbootservices time. But perhaps my mental model is simply too inaccurate - it would be helpful to understand what exactly needs to be locked down, and what aspects of the system state are of interest for the DRTM measurements.