lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130903104941.GG28598@console-pimps.org>
Date:	Tue, 3 Sep 2013 11:49:41 +0100
From:	Matt Fleming <matt@...sole-pimps.org>
To:	"Lee, Chun-Yi" <joeyli.kernel@...il.com>
Cc:	linux-kernel@...r.kernel.org,
	linux-security-module@...r.kernel.org, linux-efi@...r.kernel.org,
	linux-pm@...r.kernel.org, linux-crypto@...r.kernel.org,
	opensuse-kernel@...nsuse.org, David Howells <dhowells@...hat.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Matthew Garrett <mjg59@...f.ucam.org>,
	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Josh Boyer <jwboyer@...hat.com>,
	Vojtech Pavlik <vojtech@...e.cz>,
	Matt Fleming <matt.fleming@...el.com>,
	James Bottomley <james.bottomley@...senpartnership.com>,
	Greg KH <gregkh@...uxfoundation.org>, JKosina@...e.com,
	Rusty Russell <rusty@...tcorp.com.au>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	"H. Peter Anvin" <hpa@...or.com>, Michal Marek <mmarek@...e.cz>,
	Gary Lin <GLin@...e.com>, Vivek Goyal <vgoyal@...hat.com>,
	Matthew Garrett <mjg@...hat.com>,
	"Lee, Chun-Yi" <jlee@...e.com>
Subject: Re: [PATCH 10/18] efi: Enable secure boot lockdown automatically
 when enabled in firmware

On Thu, 22 Aug, at 07:01:49PM, Lee, Chun-Yi wrote:
> From: Matthew Garrett <mjg@...hat.com>
> 
> 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 <mjg@...hat.com>
> Signed-off-by: Josh Boyer <jwboyer@...hat.com>
> Acked-by: Lee, Chun-Yi <jlee@...e.com>
> Signed-off-by: Lee, Chun-Yi <jlee@...e.com>
> ---
>  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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ