Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759939Ab3ICKtx (ORCPT ); Tue, 3 Sep 2013 06:49:53 -0400 Received: from arkanian.console-pimps.org ([212.110.184.194]:53343 "EHLO arkanian.console-pimps.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759914Ab3ICKtt (ORCPT ); Tue, 3 Sep 2013 06:49:49 -0400 Date: Tue, 3 Sep 2013 11:49:41 +0100 From: Matt Fleming To: "Lee, Chun-Yi" Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-pm@vger.kernel.org, linux-crypto@vger.kernel.org, opensuse-kernel@opensuse.org, David Howells , "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Pavel Machek , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina@suse.com, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal , Matthew Garrett , "Lee, Chun-Yi" Subject: Re: [PATCH 10/18] efi: Enable secure boot lockdown automatically when enabled in firmware Message-ID: <20130903104941.GG28598@console-pimps.org> References: <1377169317-5959-1-git-send-email-jlee@suse.com> <1377169317-5959-11-git-send-email-jlee@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1377169317-5959-11-git-send-email-jlee@suse.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2014 Lines: 59 On Thu, 22 Aug, at 07:01:49PM, Lee, Chun-Yi wrote: > From: Matthew Garrett > > The firmware has a set of flags that indicate whether secure boot is enabled > and enforcing. Use them to indicate whether the kernel should lock itself > down. We also indicate the machine is in secure boot mode by adding the > EFI_SECURE_BOOT bit for use with efi_enabled. > > Signed-off-by: Matthew Garrett > Signed-off-by: Josh Boyer > Acked-by: Lee, Chun-Yi > Signed-off-by: Lee, Chun-Yi > --- > Documentation/x86/zero-page.txt | 2 ++ > arch/x86/boot/compressed/eboot.c | 32 ++++++++++++++++++++++++++++++++ > arch/x86/include/asm/bootparam_utils.h | 8 ++++++-- > arch/x86/include/uapi/asm/bootparam.h | 3 ++- > arch/x86/kernel/setup.c | 7 +++++++ > include/linux/cred.h | 2 ++ > include/linux/efi.h | 1 + > 7 files changed, 52 insertions(+), 3 deletions(-) [...] > +static int get_secure_boot(efi_system_table_t *_table) > +{ > + u8 sb, setup; > + unsigned long datasize = sizeof(sb); > + efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; > + efi_status_t status; > + > + status = efi_call_phys5(sys_table->runtime->get_variable, > + L"SecureBoot", &var_guid, NULL, &datasize, &sb); > + The _table argument isn't needed because it's never used. [...] > io_delay_init(); > > + if (boot_params.secure_boot) { > +#ifdef CONFIG_EFI > + set_bit(EFI_SECURE_BOOT, &x86_efi_facility); > +#endif > + secureboot_enable(); > + } > + efi_enabled(EFI_BOOT) should be checked also, instead of assuming that secure_boot contains a sensible value. -- Matt Fleming, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/