diff options
author | Olivier Certner <olce.palemoon@certner.fr> | 2021-02-04 22:37:10 +0100 |
---|---|---|
committer | Olivier Certner <olce.palemoon@certner.fr> | 2021-02-05 18:22:46 +0100 |
commit | 5f29c78f7c2960ccc2f4773ecba6a6ada2985638 (patch) | |
tree | 58819acc2a895eb35d1bb90bfc2c4ea4a5843c09 /memory/mozjemalloc | |
parent | f3405dbede811b21918776034dbb47a5d5e780c4 (diff) | |
download | uxp-5f29c78f7c2960ccc2f4773ecba6a6ada2985638.tar.gz |
Issue #1730 - Part 1: Interpose malloc even on RTLD_DEEPBIND presence
New FreeBSD versions have introduced RTLD_DEEPBIND (see dlopen(3)), which
triggers a provoked build error to be on the "safe" side.
Indeed, improper use of RTLD_DEEPBIND could cause malloc interposing not to
work on specific libraries. This would happen for libraries that provide their
own malloc/free and exchange pointers with other libraries or the main program,
one allocating an area and another one deallocating it.
It seems it happened for glibc, which is not a concern on FreeBSD, and for the
Flash Player (not a concern either, there is no native Flash Player). Moreover,
there is only a single reference to RTLD_DEEPBIND in the whole platform
currently, namely in the WebRTC code, but the corresponding code chunk is
compiled-in only on Linux (and this library doesn't seem to redefine malloc
functions anyway). So I don't see how a problem could happen. Additionally,
Pale Moon, which is my focus, doesn't use WebRTC.
Corresponding Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493541
Diffstat (limited to 'memory/mozjemalloc')
-rw-r--r-- | memory/mozjemalloc/jemalloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c index bbd68365b5..a25bb7a570 100644 --- a/memory/mozjemalloc/jemalloc.c +++ b/memory/mozjemalloc/jemalloc.c @@ -6755,7 +6755,8 @@ jemalloc_darwin_init(void) #define is_malloc_(a) malloc_is_ ## a #define is_malloc(a) is_malloc_(a) -#if !defined(MOZ_MEMORY_DARWIN) && (is_malloc(malloc_impl) == 1) +#if !(defined(MOZ_MEMORY_DARWIN) || defined(MOZ_MEMORY_BSD)) && \ + (is_malloc(malloc_impl) == 1) # if defined(__GLIBC__) && !defined(__UCLIBC__) /* * glibc provides the RTLD_DEEPBIND flag for dlopen which can make it possible |