From 492d9698b411045c757b1e1d5cac59a0e3262957 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Wed, 19 Jun 2024 10:29:46 +0200 Subject: [PATCH 2/6] Shrink dump_public after the dump is initialized * src/pdumper.c (pdumper_load): Set dump_public to the pinned region from cold_user_data_start to heap_end. This should reduce the probability that pdumper_object_p is misused. --- src/pdumper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pdumper.c b/src/pdumper.c index 27717eea9c8..27b84707fcc 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -6086,6 +6086,11 @@ pdumper_load (const char *dump_filename, char *argv0) for (int i = 0; i < nr_dump_late_hooks; ++i) dump_late_hooks[i] (); +#ifdef HAVE_MPS + dump_public.start = (uintptr_t)cold_user_data_start; + dump_public.end = (uintptr_t)heap_end; +#endif + initialized = true; struct timespec load_timespec = -- 2.39.2