]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader: fix multiboot loading on UEFI
authorRoger Pau Monné <royger@FreeBSD.org>
Wed, 11 Aug 2021 14:55:10 +0000 (16:55 +0200)
committerRoger Pau Monné <royger@FreeBSD.org>
Thu, 12 Aug 2021 07:18:33 +0000 (09:18 +0200)
commit5e4279a8f35aa4b46debf728d3f743d64f15aaf8
treea24062434084a31299a1386447e20e186c14b705
parentf4c6843ec2b9aa5eff475778fb000ed6278c5b77
loader: fix multiboot loading on UEFI

The Xen kernel has no symbol tables, so calling lookup_symbol against
it triggers the following Divide by Zero fault:

Loading Xen kernel...
/boot/xen data=0x2809c8+0x149638 |
!!!! X64 Exception Type - 00(#DE - Divide Error)  CPU Apic ID - 00000000 !!!!

Fix lookup_symbol to prevent the #DE fault from happening if the
symbol table is not loaded and also fix loadfile_raw to mark multiboot
kernels as relocatable, since the only multiboot kernel supported is
Xen and was already unconditionally booted as relocatable.

Fixes: f75caed644a5 ('amd64 UEFI loader: stop copying staging area to 2M physical')
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D31507
stand/common/load_elf.c