tmp_suning_uos_patched/arch/x86/platform
Tom Lendacky dded8d76a7 x86/sme: Explicitly map new EFI memmap table as encrypted
commit 1ff2fc02862d52e18fd3daabcfe840ec27e920a8 upstream.

Reserving memory using efi_mem_reserve() calls into the x86
efi_arch_mem_reserve() function. This function will insert a new EFI
memory descriptor into the EFI memory map representing the area of
memory to be reserved and marking it as EFI runtime memory. As part
of adding this new entry, a new EFI memory map is allocated and mapped.
The mapping is where a problem can occur. This new memory map is mapped
using early_memremap() and generally mapped encrypted, unless the new
memory for the mapping happens to come from an area of memory that is
marked as EFI_BOOT_SERVICES_DATA memory. In this case, the new memory will
be mapped unencrypted. However, during replacement of the old memory map,
efi_mem_type() is disabled, so the new memory map will now be long-term
mapped encrypted (in efi.memmap), resulting in the map containing invalid
data and causing the kernel boot to crash.

Since it is known that the area will be mapped encrypted going forward,
explicitly map the new memory map as encrypted using early_memremap_prot().

Cc: <stable@vger.kernel.org> # 4.14.x
Fixes: 8f716c9b5f ("x86/mm: Add support to access boot related data in the clear")
Link: https://lore.kernel.org/all/ebf1eb2940405438a09d51d121ec0d02c8755558.1634752931.git.thomas.lendacky@amd.com/
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
[ardb: incorporate Kconfig fix by Arnd]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-14 11:32:35 +01:00
..
atom x86/platform: Convert to new CPU match macros 2020-03-24 21:29:38 +01:00
ce4100
efi x86/sme: Explicitly map new EFI memmap table as encrypted 2021-12-14 11:32:35 +01:00
geode
goldfish
intel x86: platform: iosf_mbi: Call cpu_latency_qos_*() instead of pm_qos_*() 2020-02-13 11:27:03 +01:00
intel-mid x86/platform/intel-mid: convert to use i2c_new_client_device() 2020-06-19 09:20:25 +02:00
intel-quark x86/platform: Convert to new CPU match macros 2020-03-24 21:29:38 +01:00
iris
olpc x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI 2021-10-13 10:04:30 +02:00
pvh treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
scx200
sfi x86: Use pr_warn instead of pr_warning 2019-10-18 15:00:18 +02:00
ts5500
uv - Fix the #DE oops message string format which confused tools parsing 2020-10-13 12:02:57 -07:00
Makefile