mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-23 08:21:24 -04:00
add configuration for self-init
This needs to be disabled for compatibility with the exploit protection compatibility mode on GrapheneOS. hardened_malloc shouldn't be trying to initialize itself when exploit protection compatibility mode is enabled. This has to be handled in our Bionic integration instead.
This commit is contained in:
parent
dd427cb3b8
commit
8f38bbdee6
5 changed files with 11 additions and 1 deletions
|
@ -1183,11 +1183,13 @@ static inline unsigned init(void) {
|
|||
return arena;
|
||||
}
|
||||
|
||||
#if CONFIG_SELF_INIT
|
||||
// trigger early initialization to set up pthread_atfork and protect state as soon as possible
|
||||
COLD __attribute__((constructor(101))) static void trigger_early_init(void) {
|
||||
// avoid calling init directly to skip it if this isn't the malloc implementation
|
||||
h_free(h_malloc(16));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Returns 0 on overflow.
|
||||
static size_t get_large_size_class(size_t size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue