HomeFreeBSD

Fix coredump_phnum test with ASLR enabled by default

Description

Fix coredump_phnum test with ASLR enabled by default

coredump_phnum intends to generate a core file with many PT_LOAD
segments. Previously it called mmap() in a loop with alternating
protections, relying on each mapping following the previous, to produce
a core file with many page-sized PT_LOAD segments. With ASLR on we no
longer have this property of each mmap() following the previous.

Instead, perform a single allocation, and then use mprotect() to set
alternating pages to PROT_READ.

PR: 259970
Reported by: lwhsu, mw
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33070

Details

Provenance
emasteAuthored on Nov 21 2021, 5:17 PM
Reviewer
kib
Differential Revision
D33070: Fix coredump_phnum test with ASLR enabled by default
Parents
R10:77e3db078984: loader: abstract boot services exiting to libefi function
Branches
Unknown
Tags
Unknown