From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH 5/8] efi: Get the secure boot status [ver #6] Date: Wed, 11 Jan 2017 15:27:23 +0000 Message-ID: <7948.1484148443@warthog.procyon.org.uk> References: <20170111143304.GA29649@codeblueprint.co.uk> <148120020832.5854.5448601415491330495.stgit@warthog.procyon.org.uk> <148120024570.5854.10638278395097394138.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170111143304.GA29649@codeblueprint.co.uk> Content-ID: <7947.1484148443.1@warthog.procyon.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Matt Fleming Cc: linux-efi@vger.kernel.org, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: linux-efi@vger.kernel.org Matt Fleming wrote: > > + movb $0, BP_secure_boot(%rsi) > > #ifdef CONFIG_EFI_STUB > > /* > > * The entry point for the PE/COFF executable is efi_pe_entry, so > > Is clearing ::secure_boot really necessary? Any code path that goes > via efi_main() will set it correctly and all other code paths should > get it cleared in sanitize_boot_params(), no? No. The boot_params->secure_boot parameter exists whether or not efi_main() is traversed (ie. if EFI isn't enabled or CONFIG_EFI_STUB=n) and, if not cleared, is of uncertain value. Further, sanitize_boot_params() has to be modified by this patch so as not to clobber the secure_boot flag. > What's the distinction between the unset and unknown enums? unset -> The flag was cleared by head.S and efi_get_secureboot() was never called. unknown -> efi_get_secureboot() tried and failed to access the EFI variables that should give the state. David From mboxrd@z Thu Jan 1 00:00:00 1970 From: dhowells@redhat.com (David Howells) Date: Wed, 11 Jan 2017 15:27:23 +0000 Subject: [PATCH 5/8] efi: Get the secure boot status [ver #6] In-Reply-To: <20170111143304.GA29649@codeblueprint.co.uk> References: <20170111143304.GA29649@codeblueprint.co.uk> <148120020832.5854.5448601415491330495.stgit@warthog.procyon.org.uk> <148120024570.5854.10638278395097394138.stgit@warthog.procyon.org.uk> Message-ID: <7948.1484148443@warthog.procyon.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Matt Fleming wrote: > > + movb $0, BP_secure_boot(%rsi) > > #ifdef CONFIG_EFI_STUB > > /* > > * The entry point for the PE/COFF executable is efi_pe_entry, so > > Is clearing ::secure_boot really necessary? Any code path that goes > via efi_main() will set it correctly and all other code paths should > get it cleared in sanitize_boot_params(), no? No. The boot_params->secure_boot parameter exists whether or not efi_main() is traversed (ie. if EFI isn't enabled or CONFIG_EFI_STUB=n) and, if not cleared, is of uncertain value. Further, sanitize_boot_params() has to be modified by this patch so as not to clobber the secure_boot flag. > What's the distinction between the unset and unknown enums? unset -> The flag was cleared by head.S and efi_get_secureboot() was never called. unknown -> efi_get_secureboot() tried and failed to access the EFI variables that should give the state. David From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965173AbdAKP2u (ORCPT ); Wed, 11 Jan 2017 10:28:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58142 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbdAKP1Z (ORCPT ); Wed, 11 Jan 2017 10:27:25 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20170111143304.GA29649@codeblueprint.co.uk> References: <20170111143304.GA29649@codeblueprint.co.uk> <148120020832.5854.5448601415491330495.stgit@warthog.procyon.org.uk> <148120024570.5854.10638278395097394138.stgit@warthog.procyon.org.uk> To: Matt Fleming Cc: dhowells@redhat.com, ard.biesheuvel@linaro.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 5/8] efi: Get the secure boot status [ver #6] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7947.1484148443.1@warthog.procyon.org.uk> Date: Wed, 11 Jan 2017 15:27:23 +0000 Message-ID: <7948.1484148443@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 11 Jan 2017 15:27:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matt Fleming wrote: > > + movb $0, BP_secure_boot(%rsi) > > #ifdef CONFIG_EFI_STUB > > /* > > * The entry point for the PE/COFF executable is efi_pe_entry, so > > Is clearing ::secure_boot really necessary? Any code path that goes > via efi_main() will set it correctly and all other code paths should > get it cleared in sanitize_boot_params(), no? No. The boot_params->secure_boot parameter exists whether or not efi_main() is traversed (ie. if EFI isn't enabled or CONFIG_EFI_STUB=n) and, if not cleared, is of uncertain value. Further, sanitize_boot_params() has to be modified by this patch so as not to clobber the secure_boot flag. > What's the distinction between the unset and unknown enums? unset -> The flag was cleared by head.S and efi_get_secureboot() was never called. unknown -> efi_get_secureboot() tried and failed to access the EFI variables that should give the state. David