[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240802154253.482658-3-adobriyan@gmail.com>
Date: Fri, 2 Aug 2024 18:42:53 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: jgross@...e.com,
boris.ostrovsky@...cle.com,
tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: adobriyan@...il.com,
linux-kernel@...r.kernel.org,
x86@...nel.org,
hpa@...or.com
Subject: [PATCH 3/3] xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()
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@...il.com>
---
arch/x86/platform/pvh/enlighten.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index 944e0290f2c0..2263885d16ba 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -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);
--
2.45.0
Powered by blists - more mailing lists