In the new scheme, the main executable object needs to be marked
authorderaadt <deraadt@openbsd.org>
Tue, 8 Nov 2022 13:47:22 +0000 (13:47 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 8 Nov 2022 13:47:22 +0000 (13:47 +0000)
nodelete, so that _dl_relro() will immutable it's relro.

libexec/ld.so/alpha/ld.script [new file with mode: 0644]
libexec/ld.so/hppa/ld.script [new file with mode: 0644]
libexec/ld.so/i386/ld.script [new file with mode: 0644]
libexec/ld.so/loader.c

diff --git a/libexec/ld.so/alpha/ld.script b/libexec/ld.so/alpha/ld.script
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libexec/ld.so/hppa/ld.script b/libexec/ld.so/hppa/ld.script
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/libexec/ld.so/i386/ld.script b/libexec/ld.so/i386/ld.script
new file mode 100644 (file)
index 0000000..e69de29
index 96aadbf..4d08adf 100644 (file)
@@ -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;