1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00
freebsd/stand
Ian Lepore 7297dc4441 Fix args cross-threading between gptboot(8) and loader(8) with zfs support.
When loader(8) is built with zfs support enabled, it assumes that any extarg
data present is a zfs_boot_args struct, but if the first-stage loader was
gptboot(8) the extarg data is actually a geli_boot_args struct.  Luckily,
zfsboot(8) and gptzfsboot(8) have always passed KARGS_FLAGS_ZFS along with
KARGS_FLAGS_EXTARG, so we can use KARGS_FLAGS_ZFS to decide whether the
extarg data is a zfs_boot_args struct.

To avoid similar problems in the future, gptboot(8) now passes a new
KARGS_FLAGS_GELI to indicate that extarg data is geli_boot_args.  In
loader(8), if the neither KARGS_FLAGS_ZFS nor KARGS_FLAGS_GELI is set but
extarg data is present (which will be the case for gptboot compiled before
this change), we now check for the known size of the geli_boot_args struct
passed by the older versions of gptboot as a way of confirming what type of
extarg data is present.

In a semi-related tidying up, since loader's main() has already decided
what type of extarg data is present and set the global 'zargs' var
accordingly, don't repeat the check in extract_currdev, just check whether
zargs is NULL or not.

X-MFC after:	a few days, along with prior related changes.
2018-12-04 16:43:50 +00:00
..
arm
arm64
common When handling CMD_CRIT error set command_errmsg to NULL after we dump it out, 2018-11-30 02:14:41 +00:00
defaults Enable lualoader's kernel autodetection, disabled on install media 2018-10-11 17:17:54 +00:00
efi loader.efi: fix EFI getchar() for multiple consoles 2018-11-30 08:42:14 +00:00
fdt stand: fdt: Drop some write-only assignments/variables and leaked bits 2018-08-23 18:01:34 +00:00
ficl
ficl32
forth Restore the ability to prevent the user from interrupting the boot process 2018-10-21 00:15:51 +00:00
i386 Fix args cross-threading between gptboot(8) and loader(8) with zfs support. 2018-12-04 16:43:50 +00:00
kshim
liblua Move LUA_ROOT to /boot/lua 2018-10-28 02:57:50 +00:00
liblua32
libsa Eliminate duplicated code and struct member definitions in the handoff 2018-12-03 03:58:30 +00:00
libsa32
lua lualoader: Add chainload menu entry 2018-11-05 16:20:07 +00:00
man Improve formatting. 2018-08-15 11:39:13 +00:00
mips
ofw Stop using ../zfs/libzfs.h but instead use libzfs.h. 2018-07-08 07:42:58 +00:00
powerpc
sparc64 Increase the size of the heap size available on sparc64 during 2018-08-22 14:33:57 +00:00
uboot ubldr: Force 'usefdt' variable to 1 for powerpc 2018-12-02 02:20:35 +00:00
usb
userboot userboot: handle guest interpreter mismatches more intelligently 2018-09-01 02:23:45 +00:00
defs.mk Move inclusion of src.opts.mk later. 2018-12-03 17:51:10 +00:00
fdt.mk
ficl.mk
loader.mk Create a loader for each interpreter for x86 BIOS and all EFI 2018-08-14 18:44:41 +00:00
lua.mk
Makefile Move ZFS files into libsa 2018-07-08 07:42:49 +00:00
Makefile.amd64
Makefile.inc
uboot.mk