Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1750922ybb; Thu, 26 Mar 2020 06:42:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuAdNL7LbvgZtAa2s3PebNTdYxkjtwCJubGBB6SR7nIOU99T52Mxl8esh/dqsWXOtx5zsfm X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr6522666otr.282.1585230165167; Thu, 26 Mar 2020 06:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585230165; cv=none; d=google.com; s=arc-20160816; b=VHAz4CpZxK3BT7RXnCDpBbT/O/7Z4GxRFLUBRJzcu//N2AvvW5s/Lcg5gmOGdrO0xv 4U9J4HofPiRExzfT1mlprZIXHbGctEgqlG2T684vDOA0ws6emFKXpFGPLDujC5Dh6k4k QsZ9m/WOXiv4yjQEOu2jtblHX//j2kKvrjEvj3FjC0W4eS6Ih2u31rSv4Nq4P5LMRDKn TBBeCaLx8uirn5qVVCZUqlQ1ldVKrXb0Mc8Q94UiOMMvCZNK7YXoXp/qmF7ozItvznuo KLi/uIlXcLVTdpN+VeGIXI5XAL2f74oLC0L9qRO9AyFgUHyqKEb4qc6NjB8rzMdrlc4n cdpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=47kOGG+bdoJaXnP8m/osKaGZ0uajF8a3MGNKMsop3vY=; b=TKWlm1Sfts9mNRrCMl12NroAWAeUBMAkaBQ1LH4boCMJfJnETbxgljjIyFfvBO9jSG hb/L2FxnGdRSziZNYfNO/NoEIwdx3k//DYSDpuHDuOdkE6QdBC6qD/1N/2cm5QKDqPpb EExHQb1jmgjeXWRYt1tulbcdLk+eugMW0SShi4l0muoiVtPuqYdSkhTdpB7jQmwCmWZR KzlE5c1ud1+ztWhNoO4gGmKe9XI+5PxJ3fRFIqt3vrqJmTURhabniMCjqPBU8DUy28YH 2c4IkAMvPhujeakK6N8E99WsFMHwr7PDWC0EOXXyL2vxtBdn862moVkhQkWcB35I5oDi jzuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=POqSritt; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si1087223otq.204.2020.03.26.06.42.32; Thu, 26 Mar 2020 06:42:45 -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=@oracle.com header.s=corp-2020-01-29 header.b=POqSritt; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbgCZNlG (ORCPT + 99 others); Thu, 26 Mar 2020 09:41:06 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:46064 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgCZNlG (ORCPT ); Thu, 26 Mar 2020 09:41:06 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02QDdON6026557; Thu, 26 Mar 2020 13:40:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=corp-2020-01-29; bh=47kOGG+bdoJaXnP8m/osKaGZ0uajF8a3MGNKMsop3vY=; b=POqSrittxnwjNutlDxb96joCHnJG44Uwn0rAnWaPePWcbKl24WTa/fHu8MBJbYxX/DUI 1Lgrt4Gy6uxnHBYL0Gm3CfnKJCAnlnKAAZcjgmKYbiTcXy6T91ziidi0vYCGLM1S8wCy KKpWPeiXFX5tZ+Z8R0DeA/NGhu6u9SJJK681d4nzOCTO0rDrsYOc2IdwViUO263hlfxS UnGr2W57gQ3+rYanhvGnx8N5+fe+ny+8YNBDQPgKeh/7A345gyVLVMQI7+F9GbPyMVub gXLxxklYBHLI5p2QUrWpzSYpviHg6mPJbJVfRNhgsIyOLgl67JL/4RtTn6gJaxAMxdmS mQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2ywabrfun5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Mar 2020 13:40:24 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02QDVgiS000938; Thu, 26 Mar 2020 13:40:23 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 3003gkvkmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Mar 2020 13:40:23 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02QDeHrF000682; Thu, 26 Mar 2020 13:40:18 GMT Received: from tomti.i.net-space.pl (/10.175.206.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Mar 2020 06:40:17 -0700 Date: Thu, 26 Mar 2020 14:40:11 +0100 From: Daniel Kiper To: Matthew Garrett Cc: Ross Philipson , Linux Kernel Mailing List , the arch/x86 maintainers , linux-doc@vger.kernel.org, dpsmith@apertussolutions.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , trenchboot-devel@googlegroups.com, ardb@kernel.org, leif@nuviainc.com, eric.snowberg@oracle.com, piotr.krol@3mdeb.com, krystian.hebel@3mdeb.com, michal.zygowski@3mdeb.com, james.bottomley@hansenpartnership.com, andrew.cooper3@citrix.com Subject: Re: [RFC PATCH 00/12] x86: Trenchboot secure late launch Linux kernel support Message-ID: <20200326134011.c4dswiq2g7eln3qd@tomti.i.net-space.pl> References: <20200325194317.526492-1-ross.philipson@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9571 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003260104 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9571 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1011 adultscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003260104 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey, CC-in Ard, Leif, Eric, Piotr, Krystian, MichaƂ, James and Andrew... On Wed, Mar 25, 2020 at 01:29:03PM -0700, 'Matthew Garrett' via trenchboot-devel 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 It does not. We do not want and need to tie secure launch with UEFI. > entry point on most modern x86. Yeah, most but not all... > What's calling ExitBootServices() in Currently it is a bootloader, the GRUB which I am working on... OK, this is not perfect but if we want to call ExitBootServices() from the kernel then we have to move all pre-launch code from the bootloader to the kernel. Not nice because then everybody who wants to implement secure launch in different kernel, hypervisor, etc. has to re-implement whole pre-launch code again. > this flow, and does the secure launch have to occur after it? It'd be Yes, it does. > a lot easier if you could still use the firmware's TPM code rather > than carrying yet another copy. I think any post-launch code in the kernel should not call anything from the gap. And UEFI belongs to the gap. OK, we can potentially re-use UEFI TPM code in the pre-launch phase but I am not convinced that we should (I am looking at it right now). And this leads us to other question which pops up here and there. How to call UEFI runtime services, e.g. to modify UEFI variables, update firmware, etc., from MLE or even from the OS started from MLE? In my opinion it is not safe to call anything from the gap after secure launch. However, on the other hand we have to give an option to change the boot order or update the firmware. So, how to do that? I do not have an easy answer yet... Daniel