diff options
author | deraadt <> | 2022-10-14 04:38:39 +0000 |
---|---|---|
committer | deraadt <> | 2022-10-14 04:38:39 +0000 |
commit | b645f2b4bb773550337fd6ab6965c7fc96dc9c62 (patch) | |
tree | 79ce5df4e74b8ee27aa82e3449714bcea274161a | |
parent | 97dd2cd0e521799dfc6b2124c0e847fb7f404b8d (diff) | |
download | openbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.tar.gz openbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.tar.bz2 openbsd-b645f2b4bb773550337fd6ab6965c7fc96dc9c62.zip |
put the malloc_readonly struct into the "openbsd.mutable" section, so
that the kernel and ld.so will know not to mark it immutable. malloc
handles the read/write transitions by itself.
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index b12c89aca0..a0ee04f821 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc.c,v 1.274 2022/06/30 17:15:48 guenther Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.275 2022/10/14 04:38:39 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net> |
4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
@@ -228,7 +228,8 @@ struct malloc_readonly { | |||
228 | static union { | 228 | static union { |
229 | struct malloc_readonly mopts; | 229 | struct malloc_readonly mopts; |
230 | u_char _pad[MALLOC_PAGESIZE]; | 230 | u_char _pad[MALLOC_PAGESIZE]; |
231 | } malloc_readonly __attribute__((aligned(MALLOC_PAGESIZE))); | 231 | } malloc_readonly __attribute__((aligned(MALLOC_PAGESIZE))) |
232 | __attribute__((section(".openbsd.mutable"))); | ||
232 | #define mopts malloc_readonly.mopts | 233 | #define mopts malloc_readonly.mopts |
233 | 234 | ||
234 | char *malloc_options; /* compile-time options */ | 235 | char *malloc_options; /* compile-time options */ |