]> www.infradead.org Git - users/jedix/linux-maple.git/commit
efi/libstub: Avoid CopyMem/SetMem EFI services after ExitBootServices
authorArd Biesheuvel <ardb@kernel.org>
Thu, 27 Feb 2025 17:35:11 +0000 (18:35 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Thu, 13 Mar 2025 10:52:05 +0000 (11:52 +0100)
commit74d613e046e418ed512b265aa2ef8a27a761fb4d
treebc1a02f4864f39f57b93fbe43cedabfd854722d6
parentac2efaa8455021ce1e6216457684d60a9e2c77fd
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>
drivers/firmware/efi/libstub/intrinsics.c