linux/arch/x86/mm
Nikita Zhandarovich 701d3da213 x86/mm: Fix use of uninitialized buffer in sme_enable()
commit cbebd68f59 upstream.

cmdline_find_option() may fail before doing any initialization of
the buffer array. This may lead to unpredictable results when the same
buffer is used later in calls to strncmp() function.  Fix the issue by
returning early if cmdline_find_option() returns an error.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: aca20d5462 ("x86/mm: Add support to make use of Secure Memory Encryption")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: <stable@kernel.org>
Link: https://lore.kernel.org/r/20230306160656.14844-1-n.zhandarovich@fintech.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-22 13:34:05 +01:00
..
pat x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case 2023-01-18 11:58:22 +01:00
amdtopology.c
cpu_entry_area.c
debug_pagetables.c
dump_pagetables.c
extable.c x86: simplify load_unaligned_zeropad() implementation 2022-08-16 11:03:38 -07:00
fault.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
highmem_32.c
hugetlbpage.c arch/x86/mm/hugetlbpage.c: pud_huge() returns 0 when using 2-level paging 2022-11-08 15:57:25 -08:00
ident_map.c
init_32.c
init_64.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
init.c mm/swap: cache maximum swapfile size when init swap 2022-09-26 19:46:05 -07:00
iomap_32.c
ioremap.c x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-11-22 12:21:16 +01:00
kasan_init_64.c
kaslr.c
kmmio.c
kmsan_shadow.c x86: kmsan: handle CPU entry area 2022-10-03 14:03:26 -07:00
maccess.c
Makefile x86: kmsan: handle CPU entry area 2022-10-03 14:03:26 -07:00
mem_encrypt_amd.c
mem_encrypt_boot.S
mem_encrypt_identity.c x86/mm: Fix use of uninitialized buffer in sme_enable() 2023-03-22 13:34:05 +01:00
mem_encrypt.c
mm_internal.h
mmap.c
mmio-mod.c
numa_32.c
numa_64.c
numa_emulation.c
numa_internal.h
numa.c
pf_in.c
pf_in.h
pgprot.c
pgtable_32.c
pgtable.c mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG 2022-09-26 19:46:08 -07:00
physaddr.c
physaddr.h
pkeys.c
pti.c
srat.c
testmmiotrace.c
tlb.c