acrn-kernel/arch/x86/boot/compressed
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
..
.gitignore
Makefile x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments 2022-08-10 18:30:09 -07:00
acpi.c x86/boot: Add an efi.h header for the decompressor 2022-04-17 21:15:49 +02:00
cmdline.c
cpuflags.c
early_serial_console.c x86/boot: Put globals that are accessed early into the .data section 2022-04-20 20:10:54 +02:00
efi.c x86/boot: Add an efi.h header for the decompressor 2022-04-17 21:15:49 +02:00
efi.h x86/boot: Add an efi.h header for the decompressor 2022-04-17 21:15:49 +02:00
efi_thunk_64.S - Get rid of all the .fixup sections because this generates 2022-01-12 16:31:19 -08:00
error.c
error.h
head_32.S x86: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
head_64.S Intel Trust Domain Extensions 2022-05-23 17:51:12 -07:00
ident_map_64.c x86/compressed/64: Add identity mappings for setup_data entries 2022-07-06 11:23:39 +02:00
idt_64.c x86/sev: Check SEV-SNP features support 2022-04-06 13:10:23 +02:00
idt_handlers_64.S
kaslr.c x86/boot: Add an efi.h header for the decompressor 2022-04-17 21:15:49 +02:00
kernel_info.S
mem_encrypt.S x86/compressed/64: Detect/setup SEV/SME features earlier during boot 2022-04-06 13:02:21 +02:00
misc.c Intel Trust Domain Extensions 2022-05-23 17:51:12 -07:00
misc.h x86/boot: Don't propagate uninitialized boot_params->cc_blob_address 2022-08-24 09:03:04 +02:00
mkpiggy.c
pgtable.h x86/boot: Avoid #VE during boot for TDX platforms 2022-04-07 08:27:53 -07:00
pgtable_64.c x86/boot: Add an efi.h header for the decompressor 2022-04-17 21:15:49 +02:00
sev.c x86/boot: Don't propagate uninitialized boot_params->cc_blob_address 2022-08-24 09:03:04 +02:00
string.c
tdcall.S x86/boot: Port I/O: Add decompression-time support for TDX 2022-04-07 08:27:52 -07:00
tdx.c x86/boot: Port I/O: Add decompression-time support for TDX 2022-04-07 08:27:52 -07:00
tdx.h x86/tdx: Detect TDX at early kernel decompression time 2022-04-07 08:27:51 -07:00
vmlinux.lds.S