Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1099553ybb; Wed, 25 Mar 2020 15:52:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuEaOqEyUQsGFHSYUAIsB48RBKMEWW5so48uZFqhfVis831qPCDGLwJvslEylKu3Y5PEhLB X-Received: by 2002:a9d:6ad9:: with SMTP id m25mr4372920otq.160.1585176759786; Wed, 25 Mar 2020 15:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585176759; cv=none; d=google.com; s=arc-20160816; b=VoVAu2zqMqsN3jPFgJ8rro6Jf8+Mf/8nw7eGf9gmW260bp+LJuRlp6hN8tG+sEos9j YkVdCVWCXZYK9uZahEdZMdEnumBFCipxI7XYxmmvIZmxVCTnGaMUmDl14Kwd5fDfXpg4 C63btZuh/IuAOGs4n3NQmb7TNMdhWMoicepWtsF4U2pMCLQFwDoVDlTtFbeqgD+kbC4N NaucTcpFxqjSH8+Wo0UzwOSDF6cYvKkhCATctoI+XLxgZNh9aS2bBWtEur/SybIXJBHh TSGWYZ+iZfeSmxtoD2oIkM8ScKhCm9xGuFHb2wMS0sDNjA+bg8b4E7+eYYildOI4qfQq AVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=x9nHxL4gzWjLz71e1xa5LwZIQOhdpg8SPeo6d6T15hU=; b=e4aZS+bcdWtKaoJeGn9/H4AJ3PTgIWBE9zZ4q0ko9FPcKVUTv8pkAkfAx0tj7JXArT NhRxCKS9dq4qcZ6BHY5kmQcDXcF+ZAXNpFDqX+9gmgQUTGTKia0crVHVo4YlixfMuI5E 4tWgHC7fMghczpcYX2Qy9coJ/BoUx4W0SZozUEdPlL8kAeYRf8BaypjtSeawclpzEgWP hh/1eYXq4HCjcX5/+ZA4Rrlf3RdhG4NtNRrg+m/QgbLbapNAQF/+StlSFNZvWr3MGTU/ 6tFi4LL6UY/qSoFJeg9jKwgzGK/0HjUrGu+AegpbV+cRdr/pjVfkDhehGByEtQTLZQe3 rixw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oqE2zfQ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j192si190254oih.233.2020.03.25.15.52.26; Wed, 25 Mar 2020 15:52:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oqE2zfQ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbgCYWwG (ORCPT + 99 others); Wed, 25 Mar 2020 18:52:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbgCYWwF (ORCPT ); Wed, 25 Mar 2020 18:52:05 -0400 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1672620775 for ; Wed, 25 Mar 2020 22:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585176725; bh=BZo++6PRmqn8ECQe/7430RjXeOgiPlyvU+6fA5R/8iY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oqE2zfQ7M+BGJElI8imezU4HMq/9zP88BjHgISTQpdoLzJnXsVh4L+G6bVqJDNlor C9AGXZyus4QTGEQBnmR6rJHUONL8HytIO5IvfL+kQC3PJhOcgHt5VgfiqqZLqCXq2q M/Nd0gmjlffukJ1WCmAKUKy1QGHwiAJ7gUGyJC34= Received: by mail-wr1-f47.google.com with SMTP id p10so5588095wrt.6 for ; Wed, 25 Mar 2020 15:52:05 -0700 (PDT) X-Gm-Message-State: ANhLgQ2Ql8YfXaZXXSUYRN144lgALgMY5oxiAfqKjatjQnrr9RG2EvkH 0Tz2id862ZLcAqIyf0Jfe4upc9s+iCARTZvtQgoVNQ== X-Received: by 2002:adf:9dc6:: with SMTP id q6mr5774802wre.70.1585176723482; Wed, 25 Mar 2020 15:52:03 -0700 (PDT) MIME-Version: 1.0 References: <20200325194317.526492-1-ross.philipson@oracle.com> In-Reply-To: From: Andy Lutomirski Date: Wed, 25 Mar 2020 15:51:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 00/12] x86: Trenchboot secure late launch Linux kernel support To: Matthew Garrett Cc: Ross Philipson , Linux Kernel Mailing List , "the arch/x86 maintainers" , "open list:DOCUMENTATION" , dpsmith@apertussolutions.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , trenchboot-devel@googlegroups.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 1:29 PM Matthew Garrett wrote: > > On Wed, Mar 25, 2020 at 12:43 PM Ross Philipson > wrote: > > To enable the kernel to be launched by GETSEC or SKINIT, a stub must be > > built into the setup section of the compressed kernel to handle the > > specific state that the late launch process leaves the BSP. This is a > > lot like the EFI stub that is found in the same area. Also this stub > > must measure everything that is going to be used as early as possible. > > This stub code and subsequent code must also deal with the specific > > state that the late launch leaves the APs in. > > How does this integrate with the EFI entry point? That's the expected > entry point on most modern x86. What's calling ExitBootServices() in > this flow, and does the secure launch have to occur after it? It'd be > a lot easier if you could still use the firmware's TPM code rather > than carrying yet another copy. I was wondering why the bootloader was involved at all. In other words, could you instead hand off control to the kernel just like normal and have the kernel itself (in normal code, the EFI stub, or wherever it makes sense) do the DRTM launch all by itself? This would avoid needing to patch bootloaders, to implement this specially for QEMU -kernel, to get the exact right buy-in from all the cloud vendors, etc. It would also give you more flexibility to evolve exactly what configuration maps to exactly what PCRs in the future.