From: deraadt Date: Tue, 8 Nov 2022 13:47:22 +0000 (+0000) Subject: In the new scheme, the main executable object needs to be marked X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b8b8175121824ed2538378ae3e676af14f7f2c2b;p=openbsd In the new scheme, the main executable object needs to be marked nodelete, so that _dl_relro() will immutable it's relro. --- diff --git a/libexec/ld.so/alpha/ld.script b/libexec/ld.so/alpha/ld.script new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libexec/ld.so/hppa/ld.script b/libexec/ld.so/hppa/ld.script new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libexec/ld.so/i386/ld.script b/libexec/ld.so/i386/ld.script new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index 96aadbfe79d..4d08adfd633 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.202 2022/11/08 06:47:31 deraadt Exp $ */ +/* $OpenBSD: loader.c,v 1.203 2022/11/08 13:47:22 deraadt Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -567,6 +567,7 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) } exe_obj->load_list = load_list; exe_obj->obj_flags |= DF_1_GLOBAL; + exe_obj->nodelete = 1; exe_obj->load_size = maxva - minva; exe_obj->relro_addr = relro_addr; exe_obj->relro_size = relro_size;