Re: [RFC PATCH 1/2] efi: import USB I/O related declarations from the UEFI spec

2017-09-02 Thread Ard Biesheuvel
On 2 September 2017 at 09:25, Greg KH wrote: > On Sat, Sep 02, 2017 at 09:15:37AM +0100, Ard Biesheuvel wrote: >> On 2 September 2017 at 07:41, Greg KH wrote: >> > On Sat, Aug 19, 2017 at 04:17:39PM +0100, Ard Biesheuvel wrote: >> >> In preparation of adding support

Re: [RFC PATCH 2/2] efi: libstub: add support for the Chaoskey RNG USB stick to the stub

2017-09-02 Thread Ard Biesheuvel
On 2 September 2017 at 07:45, Greg KH wrote: > On Sat, Aug 19, 2017 at 04:17:40PM +0100, Ard Biesheuvel wrote: >> Early entropy is hard to come by, especially on non-x86 systems that >> lack an architected instruction and are not as uniform as PCs. >> Fortunately, on UEFI s

Re: [RFC PATCH 1/2] efi: import USB I/O related declarations from the UEFI spec

2017-09-02 Thread Ard Biesheuvel
On 2 September 2017 at 07:41, Greg KH wrote: > On Sat, Aug 19, 2017 at 04:17:39PM +0100, Ard Biesheuvel wrote: >> In preparation of adding support for the Chaoskey USB stick to the >> UEFI stub, import the USB I/O protocol declarations and related types >> to linux/efi.h. >

Re: [PATCH 00/14] EFI capsule update support for IOT2000 devices

2017-08-30 Thread Ard Biesheuvel
On 30 August 2017 at 20:27, Jan Kiszka wrote: > On 2017-08-30 21:24, Ard Biesheuvel wrote: >> Hello Jan, >> >> On 30 August 2017 at 20:13, Jan Kiszka wrote: >>> Last chunk: This backports EFI capsule updates, primarily for the use >>> with the IOT

Re: [PATCH 00/14] EFI capsule update support for IOT2000 devices

2017-08-30 Thread Ard Biesheuvel
y Lutomirski > Cc: Andy Lutomirski > Cc: Ard Biesheuvel > Cc: Borislav Petkov > Cc: Brian Gerst > Cc: Bryan O'Donoghue > Cc: Denys Vlasenko > Cc: H. Peter Anvin > Cc: joeyli > Cc: Josh Poimboeuf > Cc: Kweh Hock Leong > Cc: Linus Torvalds > Cc: linu

[GIT PULL 0/5] more EFI changes for v4.14

2017-08-25 Thread Ard Biesheuvel
of the random seed obtained from UEFI so crng fast init can complete earlier - add 'static' to local function pointer - move efi_mem_type() to common code and replace an open coded instance with it in the BGRT driver ------

[PATCH 2/5] efi/random: Increase size of firmware supplied randomness

2017-08-25 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c| 3 ++- drivers/firmware/efi/libstub/random.c | 10 -- include/linux/efi.h | 2 ++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi

[PATCH 1/5] efi/libstub: Enable reset attack mitigation

2017-08-25 Thread Ard Biesheuvel
Fleming Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/eboot.c| 3 ++ drivers/firmware/efi/Kconfig| 10 ++ drivers/firmware/efi/libstub/Makefile | 1 + drivers/firmware/efi/libstub/arm-stub.c | 3 ++ drivers/firmware/efi/libstub/tpm.c | 58

[PATCH 4/5] efi: move efi_mem_type() to common code

2017-08-25 Thread Ard Biesheuvel
Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/efi.c | 19 --- drivers/firmware/efi/efi.c | 37 +++-- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/e

[PATCH 3/5] efi/reboot: Make function pointer orig_pm_power_off static

2017-08-25 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/reboot.c b/drivers/firmware/efi/reboot.c index 7117e2d0c7f9..22874544d301 100644 --- a/drivers/firmware/efi/reboot.c +++ b/drivers/firmware/ef

[PATCH 5/5] efi: bgrt: use efi_mem_type()

2017-08-25 Thread Ard Biesheuvel
From: Jan Beulich Avoid effectively open-coding the function. Signed-off-by: Jan Beulich Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi-bgrt.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/firmware/efi/efi

Re: [PATCH 1/2] EFI: move efi_mem_type() to common code

2017-08-24 Thread Ard Biesheuvel
On 24 August 2017 at 11:34, Jan Beulich wrote: On 24.08.17 at 12:19, wrote: >> On 24 August 2017 at 11:11, Jan Beulich wrote: >> On 24.08.17 at 11:52, wrote: If it already has its own version, I'd prefer we just add #ifndef CONFIG_IA64 around it instead. >>> >>> Which would t

Re: [PATCH 1/2] EFI: move efi_mem_type() to common code

2017-08-24 Thread Ard Biesheuvel
On 24 August 2017 at 11:11, Jan Beulich wrote: On 24.08.17 at 11:52, wrote: >> On 24 August 2017 at 10:48, Jan Beulich wrote: >> On 24.08.17 at 11:18, wrote: On 24 August 2017 at 10:11, Jan Beulich wrote: > --- 4.13-rc6-EFI.orig/drivers/firmware/efi/efi.c > +++ 4.13-rc6-E

Re: [PATCH 1/2] EFI: move efi_mem_type() to common code

2017-08-24 Thread Ard Biesheuvel
On 24 August 2017 at 10:48, Jan Beulich wrote: On 24.08.17 at 11:18, wrote: >> On 24 August 2017 at 10:11, Jan Beulich wrote: >>> --- 4.13-rc6-EFI.orig/drivers/firmware/efi/efi.c >>> +++ 4.13-rc6-EFI/drivers/firmware/efi/efi.c >>> @@ -819,6 +819,35 @@ u64 __weak efi_mem_attributes(unsigned

Re: [PATCH 2/2] EFI/BGRT: use efi_mem_type()

2017-08-24 Thread Ard Biesheuvel
e; > @@ -85,7 +65,7 @@ void __init efi_bgrt_init(struct acpi_ta > goto out; > } > > - if (!efi_bgrt_addr_valid(bgrt->image_address)) { > + if (efi_mem_type(bgrt->image_address) != EFI_BOOT_SERVICES_DATA) { > pr_noti

Re: [PATCH 1/2] EFI: move efi_mem_type() to common code

2017-08-24 Thread Ard Biesheuvel
Hi Jan, On 24 August 2017 at 10:11, Jan Beulich wrote: > This follows efi_mem_attributes(), as it's similarly generic. > > Signed-off-by: Jan Beulich > --- > arch/x86/platform/efi/efi.c | 19 --- > drivers/firmware/efi/efi.c | 29 + > 2 files cha

Re: [PATCH][next] efi/reboot: make function pointer orig_pm_power_off static

2017-08-22 Thread Ard Biesheuvel
On 22 August 2017 at 16:50, Colin King wrote: > From: Colin Ian King > > The function pointer orig_pm_power_off is local to the source and does > not need to be in global scope, so make it static. > > Cleans up sparse warning: > symbol 'orig_pm_power_off' was not declared. Should it be static? >

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-21 Thread Ard Biesheuvel
On 21 August 2017 at 16:59, Peter Zijlstra wrote: > On Mon, Aug 21, 2017 at 08:23:10AM -0700, Andy Lutomirski wrote: >> > Ah, but only root can create per-cpu events or attach events to kernel >> > threads (with sensible paranoia levels). >> >> But this may not need to be percpu. If a non root us

[PATCH] efi: random: increase size of firmware supplied randomness

2017-08-19 Thread Ard Biesheuvel
The crng code requires at least 64 bytes (2 * CHACHA20_BLOCK_SIZE) to complete the fast boot-time init, so provide that many bytes when invoking UEFI protocols to seed the entropy pool. Also, add a notice so we can tell from the boot log when the seeding actually took place. Signed-off-by: Ard

[RFC PATCH 1/2] efi: import USB I/O related declarations from the UEFI spec

2017-08-19 Thread Ard Biesheuvel
In preparation of adding support for the Chaoskey USB stick to the UEFI stub, import the USB I/O protocol declarations and related types to linux/efi.h. Signed-off-by: Ard Biesheuvel --- include/linux/efi.h | 66 + 1 file changed, 66

[RFC PATCH 2/2] efi: libstub: add support for the Chaoskey RNG USB stick to the stub

2017-08-19 Thread Ard Biesheuvel
this fallback based on the Chaoskey RNG USB stick, which should be exposed using the standard UEFI USB I/O protocol if the firmware has USB support. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/Kconfig | 7 ++ drivers/firmware/efi/libstub/Makefile | 2 +- dr

Re: [PATCH] Enable reset attack mitigation

2017-08-18 Thread Ard Biesheuvel
On 18 August 2017 at 20:57, Matthew Garrett wrote: > On Fri, Aug 18, 2017 at 12:29 PM, Ard Biesheuvel > wrote: >> On 18 August 2017 at 20:08, Matthew Garrett wrote: >>> If the kernel doesn't synchronously zero the key when dm-crypt is torn >>> down, that f

[GIT PULL 00/14] EFI changes for v4.14

2017-08-18 Thread Ard Biesheuvel
RX and RW parts of the ARM stub loader so that the firmware can use strict mapping permissions - constify some struct attribute_group instances -------- Ard Biesheuvel (10): efi: arm: Don't mark ACPI reclaim memory as MEMBLOCK_

[PATCH 01/14] efi: arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP

2017-08-18 Thread Ard Biesheuvel
gmentation, which increases TLB pressure, and so we should avoid doing so if we can. So add a special case for regions of type EFI_ACPI_RECLAIM_MEMORY, and memblock_reserve() them instead of marking them MEMBLOCK_NOMAP. Acked-by: Mark Rutland Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --

[PATCH 02/14] efi/libstub: arm64: use hidden attribute for struct screen_info reference

2017-08-18 Thread Ard Biesheuvel
To prevent the compiler from emitting absolute references to screen_info when building position independent code, redeclare the symbol with hidden visibility. Cc: Matt Fleming Tested-by: Matthias Kaehlcke Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/efi.h | 3 +++ 1 file changed

[PATCH 03/14] efi/libstub: arm64: force 'hidden' visibility for section markers

2017-08-18 Thread Ard Biesheuvel
To prevent the compiler from emitting absolute references to the section markers when running in PIC mode, override the visibility to 'hidden' for all contents of asm/sections.h Cc: Matt Fleming Tested-by: Matthias Kaehlcke Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/lib

[PATCH 04/14] efi/libstub: arm64: set -fpie when building the EFI stub

2017-08-18 Thread Ard Biesheuvel
n a priori unknown offset is arguably an improvement in any case, and given that the recent visibility changes allow the PIC build to pass with GCC as well, let's add -fpie for all arm64 builds rather than only for Clang. Cc: Matt Fleming Tested-by: Matthias Kaehlcke Signed-off-by: Ard Biesheuve

[PATCH 08/14] arm: efi: remove forbidden values from the PE/COFF header

2017-08-18 Thread Ard Biesheuvel
Bring the PE/COFF header in line with the PE/COFF spec, by setting NumberOfSymbols to 0, and removing the section alignment flags. Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH 06/14] efi/reboot: Fall back to original power-off method if EFI_RESET_SHUTDOWN returns

2017-08-18 Thread Ard Biesheuvel
the efi-reboot code remember the old pm_power_off handler and if EFI_RESET_SHUTDOWN returns it falls back to calling that. This seems preferable to dmi-quirking our way out of this, since there are likely quite a few devices suffering from this. Signed-off-by: Hans de Goede Cc: Mark Salter Cc

[PATCH 07/14] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-08-18 Thread Ard Biesheuvel
place, and so let's remove the preprocessor conditional that makes it !X86 only. Cc: Matt Fleming Reviewed-by: Peter Jones Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Bjorn Helgaas Signed-off-by: Ard Biesheuvel --- drivers/video/fbdev/efifb.c | 31 ++- 1 fi

[PATCH 10/14] arm: efi: replace open coded constants with symbolic ones

2017-08-18 Thread Ard Biesheuvel
Replace the various open coded constants in the EFI PE/COFF header with definitions from pe.h, or expressions based on local symbols. Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 128 ++ 1 file changed, 67 insertions

[PATCH 12/14] firmware: dcdbas: constify attribute_group structures.

2017-08-18 Thread Ard Biesheuvel
From: Arvind Yadav attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Cc: Matt Fleming Cc: Douglas_Warzecha Signed-off-by: Ard

[PATCH 11/14] arm: efi: split zImage code and data into separate PE/COFF sections

2017-08-18 Thread Ard Biesheuvel
between one and two years from now. Cc: Russell King Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 32 +++- arch/arm/boot/compressed/vmlinux.lds.S | 30 +++--- 2 files changed, 46 insertions(+), 16

[PATCH 13/14] firmware: efi: constify attribute_group structures.

2017-08-18 Thread Ard Biesheuvel
From: Arvind Yadav attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers

[PATCH 14/14] firmware: efi: esrt: constify attribute_group structures.

2017-08-18 Thread Ard Biesheuvel
From: Arvind Yadav attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers

[PATCH 09/14] arm: efi: remove pointless dummy .reloc section

2017-08-18 Thread Ard Biesheuvel
mment) that relocatable images with no base relocations are perfectly fine, as long as they don't have the RELOCS_STRIPPED attribute set (which is not the case for our PE/COFF image) So simply remove the .reloc section altogether. Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- arc

[PATCH 05/14] efi: arm/arm64: Add missing assignment of efi.config_table

2017-08-18 Thread Ard Biesheuvel
deliberate: exposing physical addresses via sysfs nodes encourages behavior that we would like to avoid on ARM (given how it is more finicky about using correct memory attributes when mapping memory in userland that may be mapped by the kernel already as well) Cc: Matt Fleming Signed-off-by: Ard Biesheuvel

Re: [PATCH] Enable reset attack mitigation

2017-08-18 Thread Ard Biesheuvel
On 18 August 2017 at 20:08, Matthew Garrett wrote: > On Fri, Aug 18, 2017 at 11:52 AM, Ard Biesheuvel > wrote: >> On 4 August 2017 at 22:20, Matthew Garrett wrote: >>> + * Enable reboot attack mitigation. This requests that the firmware clear >>> the >

Re: [PATCH] Enable reset attack mitigation

2017-08-18 Thread Ard Biesheuvel
On 4 August 2017 at 22:20, Matthew Garrett wrote: > If a machine is reset while secrets are present in RAM, it may be > possible for code executed after the reboot to extract those secrets > from untouched memory. The Trusted Computing Group specified a mechanism > for requesting that the firmware

Re: [PATCH v9 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions

2017-08-18 Thread Ard Biesheuvel
On 17 August 2017 at 14:04, Baoquan He wrote: > On 08/14/17 at 10:54pm, Baoquan He wrote: >> Currently KASLR will parse all e820 entries of RAM type and add all >> candidate position into slots array. Then we will choose one slot >> randomly as the new position which kernel will be decompressed in

Re: [PATCH 1/3] firmware: dcdbas: constify attribute_group structures.

2017-08-18 Thread Ard Biesheuvel
On 3 August 2017 at 14:37, Arvind Yadav wrote: > attribute_group are not supposed to change at runtime. All functions > working with attribute_group provided by work with > const attribute_group. So mark the non-const structs as const. > > Signed-off-by: Arvind Yadav > --- > drivers/firmware/dc

Re: [PATCH v5 0/2] Add EFI capsule pstore backend support

2017-08-17 Thread Ard Biesheuvel
On 17 August 2017 at 03:29, Zhuo, Qiuxu wrote: >> -Original Message- >> From: Zhuo, Qiuxu >> Sent: Monday, June 26, 2017 11:39 PM >> To: m...@codeblueprint.co.uk; ard.biesheu...@linaro.org; >> keesc...@chromium.org >> Cc: Luck, Tony ; linux-efi@vger.kernel.org; Zhuo, Qiuxu >> >> Subject:

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-16 Thread Ard Biesheuvel
(+ Mark, Will) On 15 August 2017 at 22:46, Andy Lutomirski wrote: > On Tue, Aug 15, 2017 at 12:18 PM, Sai Praneeth Prakhya > wrote: >> +/* >> + * Makes the calling kernel thread switch to/from efi_mm context >> + * Can be used from SetVirtualAddressMap() or during efi runtime calls >> + * (Note:

Re: [PATCH] Enable reset attack mitigation

2017-08-05 Thread Ard Biesheuvel
On 4 August 2017 at 22:20, Matthew Garrett wrote: > If a machine is reset while secrets are present in RAM, it may be > possible for code executed after the reboot to extract those secrets > from untouched memory. The Trusted Computing Group specified a mechanism > for requesting that the firmware

Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API

2017-07-26 Thread Ard Biesheuvel
On 26 July 2017 at 08:52, Christoph Hellwig wrote: > On Tue, Jul 25, 2017 at 01:40:06PM +0300, Andy Shevchenko wrote: >> Christoph, can we apply this one at least to move things forward? > > Id be happy to pick this up for 4.14. Does everyone involved agree > that the uuid tree is the right one?

Re: [PATCH v1 1/6] efi: Switch to use new generic UUID API

2017-07-20 Thread Ard Biesheuvel
On 19 July 2017 at 19:28, Andy Shevchenko wrote: > There are new types and helpers that are supposed to be used in new code. > > As a preparation to get rid of legacy types and API functions do > the conversion here. > > Cc: Matt Fleming > Cc: Ard Biesheuvel > Signed

[PATCH v3] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-07-14 Thread Ard Biesheuvel
place, and so let's remove the preprocessor conditional that makes it !X86 only. Reviewed-by: Peter Jones Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Bjorn Helgaas Signed-off-by: Ard Biesheuvel --- v3: - at the request of Bjorn, record the struct pci_dev pointer as well, so that we c

Re: [PATCH v2] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-07-12 Thread Ard Biesheuvel
On 12 July 2017 at 11:00, Bartlomiej Zolnierkiewicz wrote: > On Monday, July 10, 2017 10:13:05 PM Ard Biesheuvel wrote: >> On UEFI systems, the firmware may expose a Graphics Output Protocol (GOP) >> instance to which the efifb driver attempts to attach in order to provi

Re: [PATCH v2] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-07-11 Thread Ard Biesheuvel
On 11 July 2017 at 12:55, Peter Jones wrote: > On Mon, Jul 10, 2017 at 10:13:05PM +0100, Ard Biesheuvel wrote: >> On UEFI systems, the firmware may expose a Graphics Output Protocol (GOP) >> instance to which the efifb driver attempts to attach in order to provide >> a m

Re: [PATCH v2] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-07-11 Thread Ard Biesheuvel
On 10 July 2017 at 22:13, Ard Biesheuvel wrote: > On UEFI systems, the firmware may expose a Graphics Output Protocol (GOP) > instance to which the efifb driver attempts to attach in order to provide > a minimal, unaccelerated framebuffer. The GOP protocol itself is not very > sophis

[PATCH v2] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-07-10 Thread Ard Biesheuvel
place, and so let's remove the Signed-off-by: Ard Biesheuvel --- v2: - use pr_info() not pr_warn() for non-error condition drivers/video/fbdev/efifb.c | 24 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/e

[PATCH v2 0/7] ARM: efi: PE/COFF cleanup/hardening

2017-06-29 Thread Ard Biesheuvel
referring to the path to arch/arm/boot/compressed/vmlinux on the build host. This is a debug feature that allows seamless source level single step debugging of the UEFI stub while executing in the context of the firmware. v2: - rebase onto v4.12-rc7+ - simplify #3 Ard Biesheuvel (7): arm: efi

[PATCH v2 4/7] arm: compressed: discard ksymtab/kcrctab sections

2017-06-29 Thread Ard Biesheuvel
-by: Ard Biesheuvel --- arch/arm/boot/compressed/vmlinux.lds.S | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 81c493156ce8..1fa62432e283 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch

[PATCH v2 3/7] arm: efi: replace open coded constants with symbolic ones

2017-06-29 Thread Ard Biesheuvel
Replace the various open coded constants in the EFI PE/COFF header with definitions from pe.h, or expressions based on local symbols. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 128 ++-- 1 file changed, 67 insertions(+), 61 deletions(-) diff --git

[PATCH v2 5/7] arm: efi: split zImage code and data into separate PE/COFF sections

2017-06-29 Thread Ard Biesheuvel
between one and two years from now. Cc: Russell King Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 32 ++-- arch/arm/boot/compressed/vmlinux.lds.S | 30 +- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/arch/arm/boot

[PATCH v2 2/7] arm: efi: remove pointless dummy .reloc section

2017-06-29 Thread Ard Biesheuvel
mment) that relocatable images with no base relocations are perfectly fine, as long as they don't have the RELOCS_STRIPPED attribute set (which is not the case for our PE/COFF image) So simply remove the .reloc section altogether. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/ef

[PATCH v2 7/7] arm: efi: add PE/COFF debug table to EFI header

2017-06-29 Thread Ard Biesheuvel
This updates the PE/COFF header to emit the absolute path to the decompressor vmlinux ELF file into a so-called NB10 Codeview entry. This is hugely helpful when debugging the firmware->stub handover. Cc: Russell King Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/Makefile |

[PATCH v2 1/7] arm: efi: remove forbidden values from the PE/COFF header

2017-06-29 Thread Ard Biesheuvel
Bring the PE/COFF header in line with the PE/COFF spec, by setting NumberOfSymbols to 0, and removing the section alignment flags. Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot

[PATCH v2 6/7] arm: compressed: put zImage header and EFI header in dedicated section

2017-06-29 Thread Ard Biesheuvel
if the PE/COFF .text section and the ELF .text section live at different offsets. Cc: Russell King Signed-off-by: Ard Biesheuvel --- arch/arm/boot/compressed/efi-header.S | 1 + arch/arm/boot/compressed/vmlinux.lds.S | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch

Re: [PATCH] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-06-27 Thread Ard Biesheuvel
On 27 June 2017 at 20:02, Peter Jones wrote: > On Tue, Jun 27, 2017 at 04:19:36PM +0000, Ard Biesheuvel wrote: >> On UEFI systems, the firmware may expose a Graphics Output Protocol (GOP) >> instance to which the efifb driver attempts to attach in order to provide >> a m

Re: [PATCH] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-06-27 Thread Ard Biesheuvel
On 27 June 2017 at 16:19, Ard Biesheuvel wrote: > On UEFI systems, the firmware may expose a Graphics Output Protocol (GOP) > instance to which the efifb driver attempts to attach in order to provide > a minimal, unaccelerated framebuffer. The GOP protocol itself is not very > sophis

[PATCH] drivers/fbdev: efifb: allow BAR to be moved instead of claiming it

2017-06-27 Thread Ard Biesheuvel
place, and so let's remove the Signed-off-by: Ard Biesheuvel --- drivers/video/fbdev/efifb.c | 24 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index b827a8113e26..6220de3e25d3 100644 --- a/dr

Re: [PATCH v4 2/2] eif/capsule-pstore: Add capsule pstore backend

2017-06-26 Thread Ard Biesheuvel
On 22 June 2017 at 16:35, Qiuxu Zhuo wrote: > The EFI capsule mechanism allows data blobs to be passed to the EFI > firmware. By setting the EFI_CAPSULE_POPULATE_SYSTEM_TABLE and the > EFI_CAPSULE_PERSIST_ACROSS_REBOOT flags, the firmware will place a > pointer to our data blob in the EFI System T

Re: [PATCH v4 0/2] Add EFI capsule pstore backend support

2017-06-26 Thread Ard Biesheuvel
On 26 June 2017 at 04:09, Zhuo, Qiuxu wrote: >> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] >> >> Actually, no, The issue I raised the last time around was not addressed >> anywhere, and is not even mentioned in the commit log. >> >> The problem

Re: [PATCH v4 0/2] Add EFI capsule pstore backend support

2017-06-24 Thread Ard Biesheuvel
On 23 June 2017 at 23:03, Ard Biesheuvel wrote: > On 23 June 2017 at 20:42, Kees Cook wrote: >> On Thu, Jun 22, 2017 at 9:34 AM, Qiuxu Zhuo wrote: >>> Change Log v3->v4: >>> - Add comment 'the number of config tables' for 'nr_config_t

Re: [PATCH v4 0/2] Add EFI capsule pstore backend support

2017-06-23 Thread Ard Biesheuvel
On 23 June 2017 at 20:42, Kees Cook wrote: > On Thu, Jun 22, 2017 at 9:34 AM, Qiuxu Zhuo wrote: >> Change Log v3->v4: >> - Add comment 'the number of config tables' for 'nr_config_table' in efi >> structure >> - Initialize 'efi.nr_config_table' to 0 in default >> - Set 'efi.nr_config_table' t

Re: Problem with new X.509 is_hash_blacklisted() interface

2017-06-21 Thread Ard Biesheuvel
On 21 June 2017 at 14:49, David Howells wrote: > Ard Biesheuvel wrote: > >> > This can be told to skip a particular algorithm for when the caller >> > has one precalculated. The precalculated hash can be passed to >> > is_hash_blacklisted(). Thi

Re: Problem with new X.509 is_hash_blacklisted() interface

2017-06-21 Thread Ard Biesheuvel
is_hash_blacklisted(). This would typically be the case for a signed > X.509 message. > This last part seems a premature optimization to me. Is there a performance concern preventing us from using (4) only? In any case, the approach and the code look sound to me, althoug

Re: [PATCH 0/7] ARM: efi: PE/COFF cleanup/hardening

2017-06-21 Thread Ard Biesheuvel
On 30 May 2017 at 20:36, Ard Biesheuvel wrote: > This is the ARM counterpart of the changes now in v4.12 to clean up > the PE/COFF header that makes the kernel zImage loadable directly from > UEFI, and to enhance it with hardening and debug features. > > First of all, the clea

Re: [PATCH v3 1/2] efi: Add 'nr_config_table' variable in efi structure

2017-06-21 Thread Ard Biesheuvel
On 19 June 2017 at 19:54, Qiuxu Zhuo wrote: > The 'nr_config_table' and 'config_table' (alreay in efi structure) > in efi structure provide a way for some driver(e.g. capsule-pstore > goes through the configuration table to extract crash capsules to > aid in debugging) iterates over the EFI config

Re: [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Ard Biesheuvel
a few times until now. So, let's initialize only efi struct members used by > Xen to avoid such issues in the future. > > Signed-off-by: Daniel Kiper Acked-by: Ard Biesheuvel > --- > arch/x86/xen/efi.c | 45 - > 1 file chan

Re: [PATCH 1/2] efi: Process MEMATTR table only if EFI_MEMMAP

2017-06-21 Thread Ard Biesheuvel
On 20 June 2017 at 22:14, Daniel Kiper wrote: > Otherwise e.g. Xen dom0 on x86_64 EFI platforms crashes. > > In theory we can check EFI_PARAVIRT too, however, > EFI_MEMMAP looks more generic and covers more cases. > > Signed-off-by: Daniel Kiper Reviewed-by: Ard Biesheuvel

Re: [PATCH v2 18/31] efi-stub.txt: standardize document format

2017-06-20 Thread Ard Biesheuvel
> - use proper markups for titles; > - identify literal blocks. > > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Ard Biesheuvel > --- > Documentation/efi-stub.txt | 25 +++-- > 1 file changed, 15 insertions(+), 10 deletions(-) > > diff --gi

Re: [PATCH 0/5] security, efi: Set lockdown if in secure boot mode

2017-06-09 Thread Ard Biesheuvel
(+ Kees) On 6 June 2017 at 09:34, David Howells wrote: > Ard Biesheuvel wrote: > >> and print a subsequent line for every lockdown feature that is enabled, e.g., >> >> lockdown: disabling MSRs >> lockdown: disabling hibernate support > > There's ano

Re: [PATCH 0/3] efi: arm64: use -fpie for building the stub

2017-06-09 Thread Ard Biesheuvel
On 18 May 2017 at 10:09, Ard Biesheuvel wrote: > Clang requires the stub to be built with -fpie, or it may emit absolute > symbol references that trigger the absolute relocation detection code and > cause the build to fail. > > The remedy is to set -fpie (#3), but due to st

Re: [PATCH] efi: arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP

2017-06-09 Thread Ard Biesheuvel
On 5 June 2017 at 09:08, Mark Rutland wrote: > On Mon, Jun 05, 2017 at 08:04:35AM +0000, Ard Biesheuvel wrote: >> On ARM, regions of memory that are described by UEFI as having special >> significance to the firmware itself are omitted from the linear mapping. >> This is nece

[GIT PULL] Another EFI BGRT fix for v4.12

2017-06-09 Thread Ard Biesheuvel
The following changes since commit 7425826f4f7ac60f2538b06a7f0a5d1006405159: efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot (2017-05-28 11:06:17 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git tags/efi-urgent for you to fetch

[PATCH] efi: fix boot panic because of invalid bgrt image address

2017-06-09 Thread Ard Biesheuvel
ned-off-by: Dave Young Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi-bgrt.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c index 8bf27323f7a3..b58233e4e

Re: [PATCH v2] efi: fix boot panic because of invalid bgrt image address

2017-06-09 Thread Ard Biesheuvel
On 9 June 2017 at 08:24, Dave Young wrote: > Maniaxx reported a kernel boot failure of below: > (emulated the panic by using same invalid phys addr in code) > There are also a bug in bugzilla.kernel.org: > https://bugzilla.kernel.org/show_bug.cgi?id=195633 > > The reported panic happens after bel

Re: [PATCH 3/3] efi/libstub: arm64: set -fpie when building the EFI stub

2017-06-08 Thread Ard Biesheuvel
On 8 June 2017 at 19:08, Matthias Kaehlcke wrote: > El Thu, May 18, 2017 at 10:09:53AM +0100 Ard Biesheuvel ha dit: > >> Clang may emit absolute symbol references when building in non-PIC mode, >> even when using the default 'small' code model, which is already mostl

Re: [PATCH] x86/efi: fix boot panic because of invalid bgrt image address

2017-06-08 Thread Ard Biesheuvel
On 8 June 2017 at 05:32, Dave Young wrote: > Maniaxx reported kernel boot panic similar to > below: > (emulated the panic with using same invalid phys addr in a uefi vm) > There are also a bug in bugzilla.kernel.org: > https://bugzilla.kernel.org/show_bug.cgi?id=195633 > > This happens after be

Re: [PATCH] x86/efi: fix boot panic because of invalid bgrt image address

2017-06-08 Thread Ard Biesheuvel
On 8 June 2017 at 14:24, Ard Biesheuvel wrote: > On 8 June 2017 at 14:20, Dave Young wrote: >> On 06/08/17 at 10:02am, Ard Biesheuvel wrote: >>> On 8 June 2017 at 05:32, Dave Young wrote: >>> > Maniaxx reported kernel boot panic similar to >>> > b

Re: [PATCH] x86/efi: fix boot panic because of invalid bgrt image address

2017-06-08 Thread Ard Biesheuvel
On 8 June 2017 at 14:20, Dave Young wrote: > On 06/08/17 at 10:02am, Ard Biesheuvel wrote: >> On 8 June 2017 at 05:32, Dave Young wrote: >> > Maniaxx reported kernel boot panic similar to >> > below: >> > (emulated the panic with using same invalid phys addr

Re: [PATCH] x86/efi: fix boot panic because of invalid bgrt image address

2017-06-08 Thread Ard Biesheuvel
On 8 June 2017 at 05:32, Dave Young wrote: > Maniaxx reported kernel boot panic similar to > below: > (emulated the panic with using same invalid phys addr in a uefi vm) > There are also a bug in bugzilla.kernel.org: > https://bugzilla.kernel.org/show_bug.cgi?id=195633 > > This happens after bel

Re: [PATCH 01/13] x86/efi: Clean up efi CR3 save/restore

2017-06-05 Thread Ard Biesheuvel
On 5 June 2017 at 15:40, Ingo Molnar wrote: > > * Ard Biesheuvel wrote: > >> From: Andy Lutomirski >> >> efi_call_phys_prolog() used to return a "pgd_t *" that meant one of >> three different things depending on kernel and system configuration. &g

Re: [PATCH 10/13] efi/capsule: Add support for Quark security header

2017-06-05 Thread Ard Biesheuvel
On 5 June 2017 at 15:50, Ingo Molnar wrote: > > * Ard Biesheuvel wrote: > >> From: Jan Kiszka >> >> The firmware for Quark X102x prepends a security header to the capsule >> which is needed to support the mandatory secure boot on this processor. >> The hea

Re: [GIT PULL 00/13] First batch of EFI updates for v4.13

2017-06-05 Thread Ard Biesheuvel
On 5 June 2017 at 09:07, Ingo Molnar wrote: > > * Ard Biesheuvel wrote: > >> (trim cc) >> >> On 2 June 2017 at 13:51, Ard Biesheuvel wrote: >> > The following changes since commit >> > 5ed02dbb497422bf225783f46e6eadd237d23d6b: >>

Re: [GIT PULL 00/13] First batch of EFI updates for v4.13

2017-06-05 Thread Ard Biesheuvel
(trim cc) On 2 June 2017 at 13:51, Ard Biesheuvel wrote: > The following changes since commit 5ed02dbb497422bf225783f46e6eadd237d23d6b: > > Linux 4.12-rc3 (2017-05-28 17:20:53 -0700) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/k

[PATCH] efi: arm: Don't mark ACPI reclaim memory as MEMBLOCK_NOMAP

2017-06-05 Thread Ard Biesheuvel
gmentation, which increases TLB pressure, and so we should avoid doing so if we can. So add a special case for regions of type EFI_ACPI_RECLAIM_MEMORY, and memblock_reserve() them instead of marking them MEMBLOCK_NOMAP. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/arm-init.c | 5 +++

[GIT PULL 00/13] First batch of EFI updates for v4.13

2017-06-02 Thread Ard Biesheuvel
cleanups Andy Lutomirski (1): x86/efi: Clean up efi CR3 save/restore Ard Biesheuvel (4): efi/capsule-loader: Use a cached copy of the capsule header efi/capsule-loader: Redirect calls to efi_capsule_setup_info via weak

[PATCH 02/13] efi/capsule: Fix return code on failing kmap/vmap

2017-06-02 Thread Ard Biesheuvel
From: Jan Kiszka If kmap or vmap fail, it means we ran out of memory. There are no user-provided addressed involved that would justify EFAULT. Signed-off-by: Jan Kiszka Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 4 ++-- 1 file changed

[PATCH 06/13] efi/capsule-loader: Use a cached copy of the capsule header

2017-06-02 Thread Ard Biesheuvel
Instead of kmapping the capsule data twice, copy the capsule header into the capsule info struct we keep locally. This is an improvement by itself, but will also enable handling of non-standard header formats more easily. Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers

[PATCH 04/13] efi/capsule: Clean up pr_err/info messages

2017-06-02 Thread Ard Biesheuvel
From: Jan Kiszka Avoid __func__, improve the information provided by some of the messages. Signed-off-by: Jan Kiszka Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions

[PATCH 05/13] efi/capsule: Adjust return type of efi_capsule_setup_info

2017-06-02 Thread Ard Biesheuvel
From: Jan Kiszka We actually expect int at the caller and never return any size information. Signed-off-by: Jan Kiszka Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH 08/13] efi/capsule-loader: Redirect calls to efi_capsule_setup_info via weak alias

2017-06-02 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 56 +-- include/linux/efi.h | 12 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/c

[PATCH 12/13] x86/efi: Add EFI_PGT_DUMP support for x86_32 and kexec

2017-06-02 Thread Ard Biesheuvel
r efi configurations like kexec kernel, efi=old_map and to x86_32 as well. This doesn't effect normal boot path because this config option should be used only for debug purposes. Signed-off-by: Sai Praneeth Prakhya Cc: Borislav Petkov Cc: Ricardo Neri Cc: Ard Biesheuvel Cc: Ravi Shankar

[PATCH 13/13] efi: arm: enable DMI/SMBIOS

2017-06-02 Thread Ard Biesheuvel
platform via DMI to decide whether certain workarounds for buggy hardware and/or firmware need to be enabled. This would require the DMI subsystem to be enabled much earlier than we do on ARM, which is non-trivial. Cc: Matt Fleming Acked-by: Russell King Signed-off-by: Ard

[PATCH 10/13] efi/capsule: Add support for Quark security header

2017-06-02 Thread Ard Biesheuvel
ff-by: Jan Kiszka Cc: Matt Fleming Tested-by: "Bryan O'Donoghue" Reviewed-by: Andy Shevchenko Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 137 + drivers/firmware/efi/Kconfig | 9 +++ 2 files changed, 146 insertions(

[PATCH 11/13] efi/efi_test: Use memdup_user() helper

2017-06-02 Thread Ard Biesheuvel
From: Geliang Tang Use memdup_user() helper instead of open-coding to simplify the code. Signed-off-by: Geliang Tang Acked-by: Ivan Hu Cc: Ard Biesheuvel Signed-off-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/test/efi_test.c | 11 +++ 1 file changed, 3

[PATCH 09/13] efi/capsule-loader: Use page addresses rather than struct page pointers

2017-06-02 Thread Ard Biesheuvel
thout putting any knowledge of the nature of such quirks into the generic code. Cc: Matt Fleming Tested-by: "Bryan O'Donoghue" Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 12 drivers/firmware/efi/capsule.c| 7 ---

<    4   5   6   7   8   9   10   11   12   13   >