]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 2 Aug 2024 15:42:51 +0000 (18:42 +0300)
committerJuergen Gross <jgross@suse.com>
Thu, 12 Sep 2024 06:25:12 +0000 (08:25 +0200)
Uninstrument arch/x86/platform/pvh/enlighten.c: KASAN has not been setup
_this_ early in the boot process.

Steps to reproduce:

make allnoconfig
make sure CONFIG_AMD_MEM_ENCRYPT is disabled
AMD_MEM_ENCRYPT independently uninstruments lib/string.o
so PVH boot code calls into uninstrumented memset() and
memcmp() which can make the bug disappear depending on
the compiler.
enable CONFIG_PVH
enable CONFIG_KASAN
enable serial console
this is fun exercise if you never done it from nothing :^)

make

qemu-system-x86_64 \
-enable-kvm \
-cpu host \
-smp cpus=1 \
-m 4096 \
-serial stdio \
-kernel vmlinux \
-append 'console=ttyS0 ignore_loglevel'

Messages on serial console will easily tell OK kernel from unbootable
kernel. In bad case qemu hangs in an infinite loop stroboscoping
"SeaBIOS" message.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Juergen Gross <jgross@suse.com>
Message-ID: <20240802154253.482658-1-adobriyan@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/platform/pvh/Makefile

index 5dec5067c9fb775478fb79a8d7e0296f1035f4e3..c43fb7964dc4dc97d088573a06c3f20be2bcc513 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 OBJECT_FILES_NON_STANDARD_head.o := y
+KASAN_SANITIZE := n
 
 obj-$(CONFIG_PVH) += enlighten.o
 obj-$(CONFIG_PVH) += head.o