The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=37e9b420b23a4d39400a5f8d1fe0c15bc1e04230
commit 37e9b420b23a4d39400a5f8d1fe0c15bc1e04230 Author: Hesham Almatary <[email protected]> AuthorDate: 2025-11-13 14:57:54 +0000 Commit: John Baldwin <[email protected]> CommitDate: 2025-12-18 22:51:50 +0000 arm64: Fix calculating kernel size for preload metadata Cast &end to vm_offset_t before subtracting VM_MIN_KERNEL_ADDRESS to ensure the resulting size is correct for PRELOAD_PUSH_VALUE. Previously the correct size was effectively divided by sizeof(void *). Reviewed by: andrew Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D53699 (cherry picked from commit 587490dabc649b58f0c7966e749aa80a0f16796b) --- sys/arm64/arm64/machdep_boot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 83bd74ea7317..1c5e8189e436 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -106,7 +106,8 @@ fake_preload_metadata(void *dtb_ptr, size_t dtb_size) PRELOAD_PUSH_VALUE(uint32_t, MODINFO_SIZE); PRELOAD_PUSH_VALUE(uint32_t, sizeof(size_t)); - PRELOAD_PUSH_VALUE(uint64_t, (size_t)(&end - VM_MIN_KERNEL_ADDRESS)); + PRELOAD_PUSH_VALUE(uint64_t, + (size_t)((vm_offset_t)&end - VM_MIN_KERNEL_ADDRESS)); if (dtb_ptr != NULL) { /* Copy DTB to KVA space and insert it into module chain. */
