diff options
| author | deraadt <> | 2022-10-14 04:38:39 +0000 | 
|---|---|---|
| committer | deraadt <> | 2022-10-14 04:38:39 +0000 | 
| commit | fa629fb86c1178c43a56145cd374cbe7e8948275 (patch) | |
| tree | 79ce5df4e74b8ee27aa82e3449714bcea274161a /src/lib/libc/stdlib/malloc.c | |
| parent | 23148e14f19e3ce83c84737397284ffd4ea6b56d (diff) | |
| download | openbsd-fa629fb86c1178c43a56145cd374cbe7e8948275.tar.gz openbsd-fa629fb86c1178c43a56145cd374cbe7e8948275.tar.bz2 openbsd-fa629fb86c1178c43a56145cd374cbe7e8948275.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.
Diffstat (limited to 'src/lib/libc/stdlib/malloc.c')
| -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 */ | 
