HomeFreeBSD

Allow the EFI loader to work with large kernels and/or modules

Description

Allow the EFI loader to work with large kernels and/or modules
(for example, a large mfsroot). Note that for EFI the kernel and
modules (as well as other metadata files such as splash screens or
memory disk images) are loaded into a statically-sized staging area.
When the EFI loader exits it copies this staging area down to the
location the kernel expects to run at.

  • Add bounds checking to the copy routines to fail attempts to access memory outside of the staging area. Previously loading a combined kernel + modules larger than the staging size (32MB) would overflow the staging area trashing whatever memory was afterwards. Under Intel's OVMF firmware for qemu this resulted in fatal faults in the firmware itself. Now the attempt will fail with ENOMEM.
  • Allow the staging area size to be configured at compile time via an EFI_STAGING_SIZE variable in src.conf or on the command line. It accepts the size of the staging area in MB. The default size remains 32MB.

MFC after: 2 weeks
Sponsored by: Cisco Systems, Inc.

Details

Provenance
jhbAuthored on
Parents
rS279928: The H_VIO_SIGNAL hypercall only enables interrupts for future received
Branches
Unknown
Tags
Unknown

Event Timeline