]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 2 Aug 2024 15:42:53 +0000 (18:42 +0300)
committerJuergen Gross <jgross@suse.com>
Thu, 12 Sep 2024 06:25:12 +0000 (08:25 +0200)
If this memset() is not inlined than PVH early boot code can call
into KASAN-instrumented memset() which results in unbootable VMs.

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

index 944e0290f2c001810a16a2eee3c2e87a31ba48e0..2263885d16badd18eaf1788d6d0b9e5af49bf632 100644 (file)
@@ -130,7 +130,11 @@ void __init xen_prepare_pvh(void)
                BUG();
        }
 
-       memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+       /*
+        * This must not compile to "call memset" because memset() may be
+        * instrumented.
+        */
+       __builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
 
        hypervisor_specific_init(xen_guest);