]> git.ipfire.org Git - thirdparty/grub.git/commit
efi: Handle NULL return value when getting loaded image protocol
authorArd Biesheuvel <ardb@kernel.org>
Wed, 24 May 2023 17:29:09 +0000 (19:29 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 25 May 2023 14:48:00 +0000 (16:48 +0200)
commitf00ddc6834410adb9762ef0873573e86dce8294b
tree00fdfe075bdbb35259d880b0c13f7a12896efe59
parentcfbfae1aef0694b416aa199291cfef7596cdfc20
efi: Handle NULL return value when getting loaded image protocol

The EFI spec mandates that the handle produced by the LoadImage boot
service has a LoadedImage protocol instance installed on it, but for
robustness, we should still deal with a NULL return value from the
helper routine that obtains this protocol pointer.

If this happens, don't try to start the image but unload it and return
an error.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/efi/linux.c