diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-12-16 15:09:52 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-12-16 15:13:40 +0100 |
commit | e7570f4131a6af9405af7b4fd1c31de807e7cf68 (patch) | |
tree | 0f11050a7a1b768fb0d683dc60412bc2a101c3a5 /include | |
parent | 9459fe9da0f981f77ba931790f82e43ac552b73c (diff) | |
download | glibc-e7570f4131a6af9405af7b4fd1c31de807e7cf68.zip glibc-e7570f4131a6af9405af7b4fd1c31de807e7cf68.tar.gz glibc-e7570f4131a6af9405af7b4fd1c31de807e7cf68.tar.bz2 |
Replace __libc_multiple_libcs with __libc_initial flag
Change sbrk to fail for !__libc_initial (in the generic
implementation). As a result, sbrk is (relatively) safe to use
for the __libc_initial case (from the main libc). It is therefore
no longer necessary to avoid using it in that case (or updating the
brk cache), and the __libc_initial flag does not need to be updated
as part of dlmopen or static dlopen.
As before, direct brk system calls on Linux may lead to memory
corruption.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libc-internal.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/libc-internal.h b/include/libc-internal.h index 915613c..c1e7405 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -47,6 +47,11 @@ extern void __init_misc (int, char **, char **) attribute_hidden; extern __typeof (__profile_frequency) __profile_frequency attribute_hidden; # endif -extern int __libc_multiple_libcs attribute_hidden; +#ifdef SHARED +/* True if this libc belongs to the initially loaded program (i.e., it + is not for an audit module, not loaded via dlmopen, and not loaded + via static dlopen either). */ +extern _Bool __libc_initial attribute_hidden; +#endif #endif /* _LIBC_INTERNAL */ |