linux-stable/arch/x86
Michael Roth 4b1c742407 x86/boot: Don't propagate uninitialized boot_params->cc_blob_address
In some cases, bootloaders will leave boot_params->cc_blob_address
uninitialized rather than zeroing it out. This field is only meant to be
set by the boot/compressed kernel in order to pass information to the
uncompressed kernel when SEV-SNP support is enabled.

Therefore, there are no cases where the bootloader-provided values
should be treated as anything other than garbage. Otherwise, the
uncompressed kernel may attempt to access this bogus address, leading to
a crash during early boot.

Normally, sanitize_boot_params() would be used to clear out such fields
but that happens too late: sev_enable() may have already initialized
it to a valid value that should not be zeroed out. Instead, have
sev_enable() zero it out unconditionally beforehand.

Also ensure this happens for !CONFIG_AMD_MEM_ENCRYPT as well by also
including this handling in the sev_enable() stub function.

  [ bp: Massage commit message and comments. ]

Fixes: b190a043c4 ("x86/sev: Add SEV-SNP feature detection/setup")
Reported-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
Reported-by: watnuss@gmx.de
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216387
Link: https://lore.kernel.org/r/20220823160734.89036-1-michael.roth@amd.com
2022-08-24 09:03:04 +02:00
..
boot x86/boot: Don't propagate uninitialized boot_params->cc_blob_address 2022-08-24 09:03:04 +02:00
coco x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page 2022-06-17 15:37:33 -07:00
configs efi: vars: Remove deprecated 'efivars' sysfs interface 2022-06-24 20:40:19 +02:00
crypto SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
entry x86/entry: Fix entry_INT80_compat for Xen PV guests 2022-08-16 10:02:52 +02:00
events ARM: 2022-08-04 14:59:54 -07:00
hyperv ARM: 2022-08-04 14:59:54 -07:00
ia32
include x86/cpu: Add new Raptor Lake CPU model number 2022-08-23 10:58:21 -07:00
kernel x86/unwind/orc: Unwind ftrace trampolines with correct ORC entry 2022-08-21 12:19:32 +02:00
kvm * Xen timer fixes 2022-08-11 12:10:08 -07:00
lib x86/retbleed: Add fine grained Kconfig knobs 2022-06-29 17:43:41 +02:00
math-emu x86/32: Remove lazy GS macros 2022-04-14 14:09:43 +02:00
mm x86/PAT: Have pat_enabled() properly reflect state when running on Xen 2022-08-15 10:51:23 +02:00
net Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-07-22 16:55:44 -07:00
pci x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" 2022-06-17 14:24:14 -05:00
platform Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
power x86/cpu: Load microcode during restore_processor_state() 2022-04-19 19:37:05 +02:00
purgatory x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
ras
realmode Intel Trust Domain Extensions 2022-05-23 17:51:12 -07:00
tools
um Misc fixes: 2022-08-06 17:45:37 -07:00
video
virt/vmx/tdx
xen x86/xen: Add support for HVMOP_set_evtchn_upcall_vector 2022-08-12 11:28:21 +02:00
.gitignore x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
Kbuild
Kconfig - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-06-23 15:39:21 +01:00
Makefile lkdtm: Disable return thunks in rodata.c 2022-07-20 19:24:53 +02:00
Makefile.um
Makefile_32.cpu