efi/libstub: Avoid CopyMem/SetMem EFI services after ExitBootServices

Given that memset/memcpy are intrinsics, the compiler might insert calls
to these routines unexpectedly, including in code that executes after
ExitBootServices(). In this case, the respective boot services are no
longer accessible, and calling them will cause a crash.

So fall back to a bytewise copy/store if this happens to occur, even
though no such occurrences are known to exist in the kernel currently.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Ard Biesheuvel 2025-02-27 18:35:11 +01:00
commit 74d613e046