linux/drivers/firmware
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
..
arm_scmi firmware: arm_scmi: Avoid double free in error flow 2019-11-26 10:50:30 +00:00
broadcom firmware: broadcom: add OP-TEE based BNXT f/w manager 2019-10-31 11:00:45 -07:00
efi efi/libstub/random: Initialize pointer variables to zero for mixed mode 2019-12-25 10:46:06 +01:00
google firmware: google: increment VPD key_len properly 2019-10-11 08:41:34 +02:00
imx firmware: imx: add missing include of <linux/firmware/imx/sci.h> 2019-10-28 14:50:09 +08:00
meson firmware: meson_sm: use %*ph to print small buffer 2019-10-03 08:43:33 -07:00
psci firmware/psci: use common SMCCC_CONDUIT_* 2019-10-14 10:55:14 +01:00
tegra firmware: tegra: Move BPMP resume to noirq phase 2019-10-01 16:38:45 +02:00
xilinx firmware: xilinx: Add support for versal soc 2019-10-16 12:55:37 +02:00
arm_scpi.c firmware: arm_scpi: convert platform driver to use dev_groups 2019-08-02 13:18:42 +02:00
arm_sdei.c firmware: arm_sdei: use common SMCCC_CONDUIT_* 2019-10-14 10:55:14 +01:00
dmi_scan.c firmware: dmi: Add dmi_memdev_handle 2019-12-03 11:20:37 +01:00
dmi-id.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
dmi-sysfs.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
edd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
iscsi_ibft_find.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
iscsi_ibft.c Merge branch 'for-linus-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft 2019-07-26 09:43:43 -07:00
Kconfig Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
Makefile Char/Misc driver patches for 5.4-rc1 2019-09-18 11:14:31 -07:00
memmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
pcdp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcdp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
qcom_scm-32.c drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
qcom_scm-64.c drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
qcom_scm.c drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
qcom_scm.h drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
qemu_fw_cfg.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
raspberrypi.c firmware: raspberrypi: register clk device 2019-06-25 16:04:26 -07:00
scpi_pm_domain.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
stratix10-rsu.c firmware: Fix incompatible function behavior for RSU driver 2019-11-14 13:11:32 +08:00
stratix10-svc.c firmware: Fix incompatible function behavior for RSU driver 2019-11-14 13:11:32 +08:00
ti_sci.c firmware: ti_sci: Allow for device shared and exclusive requests 2019-09-04 20:44:33 +02:00
ti_sci.h ARM: SoC-related driver updates 2019-07-19 17:13:56 -07:00
trusted_foundations.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
turris-mox-rwtm.c firmware: Add Turris Mox rWTM firmware driver 2019-09-04 17:32:13 +02:00