From df24df891d8364006ae0b482d00ca0cf0a217f6e Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 27 Oct 2022 19:40:21 +0000 Subject: [PATCH] hppa and mips64 have private copies of RCRT0_RELRO(), which should also perform mimmutable() ok guenther --- lib/csu/hppa/boot_md.h | 4 +++- lib/csu/mips64/boot_md.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/csu/hppa/boot_md.h b/lib/csu/hppa/boot_md.h index f63936a9552..a770f7af4bb 100644 --- a/lib/csu/hppa/boot_md.h +++ b/lib/csu/hppa/boot_md.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot_md.h,v 1.3 2022/01/31 05:43:22 guenther Exp $ */ +/* $OpenBSD: boot_md.h,v 1.4 2022/10/27 19:40:21 deraadt Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -50,6 +50,7 @@ void _dl_exit(int); */ #define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden REDIRECT_SYSCALL(mprotect); +REDIRECT_SYSCALL(mimmutable); typedef Elf_RelA RELOC_TYPE; @@ -59,6 +60,7 @@ static size_t relro_size; do { \ if (relro_addr != NULL && relro_size != 0) \ mprotect(relro_addr, relro_size, PROT_READ); \ + mimmutable(relro_addr, relro_size); \ } while (0) /* diff --git a/lib/csu/mips64/boot_md.h b/lib/csu/mips64/boot_md.h index 7bf7d1d4784..09fb17f4d6f 100644 --- a/lib/csu/mips64/boot_md.h +++ b/lib/csu/mips64/boot_md.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot_md.h,v 1.2 2022/01/12 21:41:06 guenther Exp $ */ +/* $OpenBSD: boot_md.h,v 1.3 2022/10/27 19:40:23 deraadt Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -50,6 +50,7 @@ void _dl_exit(int); */ #define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden REDIRECT_SYSCALL(mprotect); +REDIRECT_SYSCALL(mimmutable); #define DT_PROC(n) ((n) - DT_LOPROC) @@ -76,6 +77,7 @@ static size_t relro_size; do { \ if (relro_addr != NULL && relro_size != 0) \ mprotect(relro_addr, relro_size, PROT_READ); \ + mimmutable(relro_addr, relro_size); \ } while (0) /* -- 2.20.1