linux_dsm_epyc7002/drivers/firmware/efi/libstub
Hans de Goede 818c7ce724 efi/libstub/random: Initialize pointer variables to zero for mixed mode
Commit:

  0d95981438 ("x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table")

causes the drivers/efi/libstub/random.c code to get used on x86 for the first time.

But this code was not written with EFI mixed mode in mind (running a 64
bit kernel on 32 bit EFI firmware), this causes the kernel to crash during
early boot when running in mixed mode.

The problem is that in mixed mode pointers are 64 bit, but when running on
a 32 bit firmware, EFI calls which return a pointer value by reference only
fill the lower 32 bits of the passed pointer, leaving the upper 32 bits
uninitialized which leads to crashes.

This commit fixes this by initializing pointers which are passed by
reference to EFI calls to NULL before passing them, so that the upper 32
bits are initialized to 0.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Fixes: 0d95981438 ("x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table")
Link: https://lkml.kernel.org/r/20191224132909.102540-3-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-12-25 10:46:06 +01:00
..
arm32-stub.c arm/efi: EFI soft reservation to memblock 2019-11-07 15:44:19 +01:00
arm64-stub.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
arm-stub.c efi: libstub/tpm: enable tpm eventlog function for ARM platforms 2019-11-07 10:18:45 +01:00
efi-stub-helper.c efi: Common enable/disable infrastructure for EFI soft reservation 2019-11-07 15:44:08 +01:00
efistub.h x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table 2019-11-07 10:18:45 +01:00
fdt.c Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
gop.c efi/gop: Fix memory leak in __gop_query32/64() 2019-12-08 12:42:18 +01:00
Makefile x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table 2019-11-07 10:18:45 +01:00
random.c efi/libstub/random: Initialize pointer variables to zero for mixed mode 2019-12-25 10:46:06 +01:00
secureboot.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
string.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tpm.c tpm: Don't duplicate events from the final event log in the TCG2 log 2019-06-24 23:57:50 +03:00