Skip to content

Commit fbe5a6d

Browse files
Alexey Dobriyanjgross1
authored andcommitted
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 <[email protected]> Acked-by: Juergen Gross <[email protected]> Message-ID: <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 416a33c commit fbe5a6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/platform/pvh/enlighten.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ void __init xen_prepare_pvh(void)
130130
BUG();
131131
}
132132

133-
memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
133+
/*
134+
* This must not compile to "call memset" because memset() may be
135+
* instrumented.
136+
*/
137+
__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
134138

135139
hypervisor_specific_init(xen_guest);
136140

0 commit comments

Comments
 (0)