Skip to content

Commit

Permalink
xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexey Dobriyan authored and Juergen Gross committed Sep 12, 2024
1 parent 416a33c commit fbe5a6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/x86/platform/pvh/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fbe5a6d

Please sign in to comment.