linux/drivers/firmware
Ard Biesheuvel 23e6039404 efi/libstub/x86: Work around page freeing issue in mixed mode
Mixed mode translates calls from the 64-bit kernel into the 32-bit
firmware by wrapping them in a call to a thunking routine that
pushes a 32-bit word onto the stack for each argument passed to the
function, regardless of the argument type. This works surprisingly
well for most services and protocols, with the exception of ones that
take explicit 64-bit arguments.

efi_free() invokes the FreePages() EFI boot service, which takes
a efi_physical_addr_t as its address argument, and this is one of
those 64-bit types. This means that the 32-bit firmware will
interpret the (addr, size) pair as a single 64-bit quantity, and
since it is guaranteed to have the high word set (as size > 0),
it will always fail due to the fact that EFI memory allocations are
always < 4 GB on 32-bit firmware.

So let's fix this by giving the thunking code a little hand, and
pass two values for the address, and a third one for the size.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Borislav Petkov <bp@alien8.de>
Cc: James Morse <james.morse@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191224151025.32482-21-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-12-25 10:49:23 +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/x86: Work around page freeing issue in mixed mode 2019-12-25 10:49:23 +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-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
dmi_scan.c firmware: dmi: Add dmi_memdev_handle 2019-12-03 11:20:37 +01:00
edd.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
iscsi_ibft_find.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02: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