acrn-kernel/arch/x86/boot
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
..
compressed x86/boot: Don't propagate uninitialized boot_params->cc_blob_address 2022-08-24 09:03:04 +02:00
tools
.gitignore
Makefile x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments 2022-08-10 18:30:09 -07:00
a20.c
apm.c
bioscall.S
bitops.h
boot.h
cmdline.c
copy.S
cpu.c
cpucheck.c
cpuflags.c
cpuflags.h
ctype.h
early_serial_console.c
edd.c
genimage.sh
header.S efi: x86: Fix config name for setting the NX-compatibility flag in the PE header 2022-06-01 14:07:48 +02:00
install.sh
io.h
main.c
memory.c
mkcpustr.c
msr.h
mtools.conf.in
pm.c
pmjump.S
printf.c
regs.c
setup.ld
string.c
string.h
tty.c
version.c
vesa.h
video-bios.c
video-mode.c
video-vesa.c
video-vga.c
video.c
video.h