Received: by 10.213.65.68 with SMTP id h4csp572567imn; Wed, 4 Apr 2018 03:40:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx49hNyKx0/lffTGqQU7DgjOFuQldf0aLb2dT1tqhqxHCZwq+Ig6X32evvvb/dan9zT6ggTul X-Received: by 10.98.205.69 with SMTP id o66mr13579798pfg.34.1522838426414; Wed, 04 Apr 2018 03:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522838426; cv=none; d=google.com; s=arc-20160816; b=oeFfWivhItQzTtYbcPwXOlnuxsmTt6ds80Hnrkwrf3U55floxZ1DPTuk2idWAsRFKV rjE9dtUWjteTSrC2+tRupu83qzoq9loShEaPa2+TlNCsxCPfpRG+0zWhjiX6PlR+mDMg D4T2zSRC1ky/UzwJSRQYL71G05Q+6X+wNsLnTY+l7t/5g0b9a+LRVm8Uj2iSTxRUTtwu rCWNmm0d7mDo/DUbg5EuyofYP3G5CUnKn4IIrT/0m9mB31if0gmnILHR9Hb2EFWTQnDr mK8Zb9Ao+O1//hOhIv5VQs+XKgGNGpHBdJYErzGZgjoFMQ29cD7lvk3HOKA1jz3E1/tj dxiA== 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 :arc-authentication-results; bh=32Xbo82xZ1cjk18KhppRJFHQEFFW+U7oDtKHTHqtEUg=; b=096X/0zP0wCszSSKpDLHIkqeoHlZfiVTLXgr4CCiHkOs4HYyqhSdciOpYRTdj0Vnbo Qfw34CYaXFooGW7KHUsGlc1uM6llOroYT3NorenkniodUhuTbVV83uiwJ9AsQqP5KRNM VS1DkMs1IarKTWofECUnm5L7Fwaahw2bL0ugWp7VgkCrAZ9sZQJxKw6XXmefy4EWg+NP q0wm88oc9xQMqri+NGgYpo890R1xDUh6yYwXJ7sFrgYNG8+hdNEiQHBavJaiH4LrREM0 pgGcFcbWJog2SE3dV6e3P+We0nGAZkeBrFR4jOvekwYo0xCxxiSFcjZybmtmlkPsy+FT qKew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gxqKyoHx; 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 j12si3808098pfh.3.2018.04.04.03.40.12; Wed, 04 Apr 2018 03:40:26 -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-2017-10-26 header.b=gxqKyoHx; 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 S1751332AbeDDKiy (ORCPT + 99 others); Wed, 4 Apr 2018 06:38:54 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:36414 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbeDDKiw (ORCPT ); Wed, 4 Apr 2018 06:38:52 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w34AZXDb113988; Wed, 4 Apr 2018 10:38:32 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-2017-10-26; bh=32Xbo82xZ1cjk18KhppRJFHQEFFW+U7oDtKHTHqtEUg=; b=gxqKyoHx//ZjsOtoE3IxRPu2Vybc6BJyHJvJbPqOyirBa0gJaSmQf01S1fd25BTDulHp P2KMwIjdvlHnngLF44c3o/hSci12iw6jeWfVv7rQa/dab9WtY3FznTJXld3Wf8pSUNhy 2mild9B4xd46OzQKW6OCL5ZoxGQppU8/UXKADkXlIz/D1m1+boIeITrDfkYt3PImmIdD jjUTxnDiUpp4jHzJ9LOmWXS4gUSVqqk14sjWW9kIvTDVfYm0iBwX/nFFW+E7qLNK8yIV 7ZCZGWjkAXXOIUTLEKoRY7JBjjosGQ4VYVaJPcEM4iIp+Sx5UCS5k+/7B73iNzNBA3vW Ig== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2h4w3580ka-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Apr 2018 10:38:32 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w34AcVC3000559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Apr 2018 10:38:31 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w34AcUht017701; Wed, 4 Apr 2018 10:38:30 GMT Received: from olila.local.net-space.pl (/10.175.208.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 04 Apr 2018 03:38:29 -0700 Date: Wed, 4 Apr 2018 12:38:24 +0200 From: Daniel Kiper To: James Bottomley Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, ard.biesheuvel@linaro.org, boris.ostrovsky@oracle.com, eric.snowberg@oracle.com, hpa@zytor.com, jgross@suse.com, konrad.wilk@oracle.com, mingo@redhat.com, tglx@linutronix.de Subject: Re: [PATCH v2] x86/xen/efi: Initialize UEFI secure boot state during dom0 boot Message-ID: <20180404103824.GM26100@olila.local.net-space.pl> References: <1522766345-4169-1-git-send-email-daniel.kiper@oracle.com> <1522770281.4522.14.camel@HansenPartnership.com> <20180403160712.GL26100@olila.local.net-space.pl> <1522774852.4522.25.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1522774852.4522.25.camel@HansenPartnership.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8852 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804040107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 10:00:52AM -0700, James Bottomley wrote: > On Tue, 2018-04-03 at 18:07 +0200, Daniel Kiper wrote: > > On Tue, Apr 03, 2018 at 08:44:41AM -0700, James Bottomley wrote: [...] > > > This looks like a bad idea: you're duplicating the secure boot > > > check in > > > > > > drivers/firmware/efi/libstub/secureboot.c > > > > > > Which is an implementation of policy. ?If we have to have policy in > > > the kernel, it should really only be in one place to prevent drift; > > > why can't you simply use the libstub efi_get_secureboot() so we're > > > not duplicating the implementation of policy? > > > > Well, here is the first version of this patch: > > https://lkml.org/lkml/2018/1/9/496 Ard did not like it. I was not > > happy too. In general both approaches are not perfect. More you can > > find in the discussion around this patchset. If you have better idea > > how to do that I am happy to implement it. > > One way might be simply to have the pre exit-boot-services code lay > down a variable containing the state which you pick up, rather than you Do you mean variable in kernel proper or something like that? If yes this is not possible. EFI Linux stub is not executed in Xen dom0. All UEFI infrastructure is owned and operated by Xen. Dom0 kernel can access some stuff in UEFI, including variables, via hypercall. However, when dom0 runs only UEFI runtime services are available. > calling efi code separately and trying to use the insecure RT I am not sure why they are insecure. > variables. ?That way there's a uniform view of the internal kernel > secure boot state that everyone can use. That would be perfect but I have a feeling that in form proposed above it is not possible. Daniel