headers start at a higher address). Using the wrong base address meant
that we were protecting the wrong address range for the malloc internals
which made the code error out now that mimmutable(2) no longer allows an
RW->R transition. Issue found by gkoehler@ who got most of the way
towards a proper fix.
ok deraadt@
-/* $OpenBSD: init.c,v 1.21 2024/01/19 14:15:51 deraadt Exp $ */
+/* $OpenBSD: init.c,v 1.22 2024/01/21 17:18:13 kettenis Exp $ */
/*
* Copyright (c) 2014,2015 Philip Guenther <guenther@openbsd.org>
*
* Static non-PIE processes don't get an AUX vector,
* so find the phdrs through the ELF header
*/
- _static_phdr_info.dlpi_addr = (Elf_Addr)__executable_start;
phdr = (void *)((char *)__executable_start +
__executable_start->e_phoff);
phnum = __executable_start->e_phnum;