]> git.baikalelectronics.ru Git - kernel.git/commit
efi/libstub/x86: Deal with exit() boot service returning
authorArd Biesheuvel <ardb@kernel.org>
Sun, 8 Mar 2020 08:08:45 +0000 (09:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 8 Mar 2020 08:58:18 +0000 (09:58 +0100)
commit744cd39e026e7d55412c3014ef6412c536a47934
tree31be3ac197f5a4a9ae6daf6a5aa8992125443352
parent563916411ea1732b06e8c8dda277220e3e8b37ab
efi/libstub/x86: Deal with exit() boot service returning

Even though it is uncommon, there are cases where the Exit() EFI boot
service might return, e.g., when we were booted via the EFI handover
protocol from OVMF and the kernel image was specified on the command
line, in which case Exit() attempts to terminate the boot manager,
which is not an EFI application itself.

So let's drop into an infinite loop instead of randomly executing code
that isn't expecting it.

Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
[ardb: put 'hlt' in deadloop]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200303080648.21427-1-ardb@kernel.org
Link: https://lore.kernel.org/r/20200308080859.21568-15-ardb@kernel.org
drivers/firmware/efi/libstub/x86-stub.c