the size of the FDT to reflect the size of that buffer. This prevents
an FDT overflow if the original FDT doesn't have enough space for the
additional properties that we add to it in our bootloader.
Fixes boot on the mcbin.
tested by bluhm@, ok patrick@
-/* $OpenBSD: efiboot.c,v 1.38 2021/12/15 00:37:21 deraadt Exp $ */
+/* $OpenBSD: efiboot.c,v 1.39 2022/03/16 22:32:50 kettenis Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
if (BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
EFI_SIZE_TO_PAGES(len), &addr) == EFI_SUCCESS) {
memcpy((void *)addr, fdt, fdt_get_size(fdt));
+ ((struct fdt_head *)addr)->fh_size = len;
fdt = (void *)addr;
}