Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5927471imb; Fri, 8 Mar 2019 05:40:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzqAO+zhu9WrCIru7r7jtdfC1NidKB565G6wDypFk0jSYArvgIuwD7n5VULz9jIiNNv5GxZ X-Received: by 2002:a62:f201:: with SMTP id m1mr18547736pfh.97.1552052453107; Fri, 08 Mar 2019 05:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552052453; cv=none; d=google.com; s=arc-20160816; b=LMmPCFTYxQzzD4xwpoARaJgkI4SR4ET0MQCFRwEaP3b00ehcIe5CX+ZyvzOamYkLBR 7RiCGaTWWvXKV0j6wcw+ddXFf4w8QvgjQQpY+5UKbP6HYmU/t0V+hZpYyep+I1o8c16v TBuf/X+WeBt5emp/8fvrzctQuWwxdI1KOG6HFjw9e+HmYfG7EOPpERai9y3yIcKdhgm+ hUBjm+Aoav4owYSrjmYrcmCGtfbljx/6VF07w8ilRQgFVcVi2H0px7mJ5brSgAbqpxmL wTIo7acGooJ8zWN7nrTmwmbxzcjXClwDYUTiwuTBihpeAPyjr7f3KsICBOcQwDd/Avzg Af7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=ry6+g+zyL+SjKS3SfrHIEP+p8vagPnRjjM4GtT+MzxY=; b=n6HcJS256/VUQTvf1O7FDZIQU/aJ9Xa7iVmxwWes0Si1/V/eKQFjM0lFnCBxY/ePgm Z5f6RXZmnxAw4x+Ckxyovk15VeKaNRZexHjaFTMSUAihYwdYDYMXu3QeF+utcaWRi4Gm SHZSDU4QP6IeCBwDLE5UKOEL/4T+0MWrvT6KqUpABKDRpSUWGa8cgpSUel/g8QXp8sU/ 7A83tQNThfY+KyANHUjgR79UV1R7VNlK8sJ3P6hjPaAsGCc+R2k8XdYJoK49qQvA6u5S AHIhNj/Nv1cXwIv5ca5QlKY19AZR9JxNHAzh15g/88Nta8nMBqnD8i5G4LjElgJ63WZ1 mZuA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4si1053596plb.133.2019.03.08.05.40.37; Fri, 08 Mar 2019 05:40:53 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbfCHNj6 (ORCPT + 99 others); Fri, 8 Mar 2019 08:39:58 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33242 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbfCHNj5 (ORCPT ); Fri, 8 Mar 2019 08:39:57 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x28DVOxh046242 for ; Fri, 8 Mar 2019 08:39:56 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2r3qq3500d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 08 Mar 2019 08:39:56 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Mar 2019 13:39:53 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 8 Mar 2019 13:39:50 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x28Ddnq624510488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 Mar 2019 13:39:49 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8AA7211C050; Fri, 8 Mar 2019 13:39:49 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41E4011C04A; Fri, 8 Mar 2019 13:39:48 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.93.116]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 8 Mar 2019 13:39:48 +0000 (GMT) Subject: Re: [PATCH 3/3] x86/ima: retry detecting secure boot mode From: Mimi Zohar To: Matthew Garrett Cc: Justin Forbes , linux-integrity , LSM List , linux-efi , Linux Kernel Mailing List , David Howells , Seth Forshee , kexec@lists.infradead.org, Nayna Jain Date: Fri, 08 Mar 2019 08:39:37 -0500 In-Reply-To: References: <1542657371-7019-1-git-send-email-zohar@linux.ibm.com> <1542657371-7019-4-git-send-email-zohar@linux.ibm.com> <1551998897.31706.461.camel@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19030813-0028-0000-0000-00000351A5BC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19030813-0029-0000-0000-000024101BFE Message-Id: <1552052377.4134.23.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-08_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=745 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903080096 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-03-07 at 14:50 -0800, Matthew Garrett wrote: > On Thu, Mar 7, 2019 at 2:48 PM Mimi Zohar wrote: > > I added this last attempt because I'm seeing this on my laptop, with > > some older, buggy firmware. > > Is the issue that it gives incorrect results on the first read, or is > the issue that it gives incorrect results before ExitBootServices() is > called? If the former then we should read twice in the boot stub, if > the latter then we should figure out a way to do this immediately > after ExitBootServices() instead. Detecting the secure boot mode isn't the problem.  On boot, I am seeing "EFI stub: UEFI Secure Boot is enabled", but setup_arch() emits "Secure boot could not be determined". In efi_main() the secure_boot mode is initially unset, so efi_get_secureboot() is called.  efi_get_secureboot() returns the secure_boot mode correctly as enabled.  The problem seems to be in saving the secure_boot mode for later use. Mimi