ladybird/Userland/Libraries/LibC
Itamar a3360bcee8 LibC+DynamicLoader: Store the auxiliary vector address at startup
Previously, getauxval() got the address of the auxiliary vector by
traversing to the end of the `environ` pointer.

The assumption that the auxiliary vector comes after the environment
array is true at program startup, however the environment array may
be re-allocated and change its address during runtime which would cause
getauxval() to work with an incorrect auxiliary vector address.

To fix this, we now get the address of the auxiliary vector once in
__libc_init and store it in a libc-internal pointer which is then used
by getauxval().

Fixes #10087.
2021-09-20 18:32:09 +02:00
..
arch CMake: Let Meta/serenity.sh run aarch64 make it past cmake 2021-08-28 14:43:07 +01:00
arpa LibC: Make <netinet/in.h> more POSIX compliant 2021-08-22 10:29:06 +02:00
bits LibC: Define ptrdiff_t limits 2021-09-16 16:42:40 +02:00
net Kernel+LibC: Share definitions for net/{if,if_arp,route}.h 2021-08-14 19:58:11 +02:00
netinet LibC: Spec compliant IN6_IS_ADDR_V4MAPPED 2021-09-20 15:26:46 +02:00
sys LibC+DynamicLoader: Store the auxiliary vector address at startup 2021-09-20 18:32:09 +02:00
alloca.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
assert.cpp LibC: Don't format strings when asserting with an unstable heap 2021-09-18 01:35:11 +00:00
assert.h LibC: Use C-style void cast in assert() 2021-07-13 19:02:20 +01:00
byteswap.h Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
CMakeLists.txt AK+LibC: Remove SERENITY_LIBC_BUILD guard around <initializer_list> 2021-09-20 00:39:46 +00:00
crt0_shared.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
crt0.cpp LibC: Use 64-bit stack smash value for 64-bit mode 2021-07-17 01:45:20 +02:00
ctype.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ctype.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
cxxabi.cpp LibC: Expand region for global destructors when it reaches capacity 2021-09-06 01:55:14 +02:00
dirent.cpp LibC: Add function fdopendir 2021-08-14 22:32:00 +01:00
dirent.h LibC: Add function fdopendir 2021-08-14 22:32:00 +01:00
dlfcn.cpp LibC+LibELF: Implement dladdr() 2021-06-06 22:16:11 +02:00
elf.h DynamicLoader+LibELF: Move self-relocation code into a separate file 2021-07-27 13:15:16 +02:00
endian.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
errno_numbers.h LibC: Add definition for EDQUOT 2021-05-08 18:11:52 +02:00
errno.h LibC: Don't clear errno on success 2021-05-30 19:37:32 +02:00
fcntl.cpp Kernel+LibC: Pack SC_inode_watcher_add_watch_params struct better 2021-09-16 17:17:13 +02:00
fcntl.h Kernel+LibC: Share definitions in fcntl.h and sys/types.h 2021-08-14 19:58:11 +02:00
fd_set.h LibC: Modify fd_set to be compatible with X/OPEN 2021-08-22 10:29:06 +02:00
fenv.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
fenv.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
float.h LibC: Don't include fenv.h from float.h 2021-07-08 10:11:00 +02:00
fnmatch.cpp LibC: Add stub for fnmatch and a set of defined values 2021-08-14 22:32:00 +01:00
fnmatch.h LibC: Add FNM_NOMATCH to fnmatch.h 2021-08-19 22:27:26 +02:00
getopt.cpp LibC+Utilities: Add gnu::format attributes 2021-07-08 10:11:00 +02:00
getopt.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
grp.cpp LibC: Add putgrent 2021-07-15 11:16:58 +02:00
grp.h LibC: Fix grp.h includes 2021-07-17 13:00:33 +02:00
iconv.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
inttypes.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
inttypes.h LibC: Don't include AK headers in system headers 2021-07-15 23:51:59 +02:00
ioctl.cpp LibC: Don't truncate arguments for ioctl() on x86_64 2021-07-22 04:18:39 +04:30
langinfo.cpp LibC: Implement most langinfo values mentioned in POSIX 2021-09-18 03:12:58 +00:00
langinfo.h LibC: Implement most langinfo values mentioned in POSIX 2021-09-18 03:12:58 +00:00
libcinit.cpp LibC+DynamicLoader: Store the auxiliary vector address at startup 2021-09-20 18:32:09 +02:00
libgen.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
libgen.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
limits.h LibC: Add LINK_MAX and _PC_LINK_MAX 2021-08-22 10:29:06 +02:00
link.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
link.h Userland: Prefer using ARCH() over __LP64__ 2021-07-13 23:19:33 +02:00
locale.cpp LibC: Let setlocale() pretend that setting the locale succeeded 2021-06-05 10:56:37 +02:00
locale.h LibC: Add definition for LC_MESSAGES 2021-05-08 19:14:21 +02:00
malloc.cpp LibC: Don't format strings when asserting with an unstable heap 2021-09-18 01:35:11 +00:00
mallocdefs.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
memory.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
mntent.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
mntent.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
net.cpp LibC: Add definitions/stubs for IPv6 functionality 2021-05-09 21:16:11 +02:00
netdb.cpp AK: Replace the mutable String::replace API with an immutable version 2021-09-11 20:36:43 +03:00
netdb.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
nl_types.h LibC: Implement CODESET for langinfo 2021-09-16 16:42:40 +02:00
paths.h Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
poll.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
poll.h Kernel+LibC: Share definitions for poll.h 2021-08-14 19:58:11 +02:00
pthread_forward.cpp LibC+AK: Remove our custom macros from <assert.h> 2021-06-08 17:29:57 +02:00
pthread_integration.cpp LibC: Only set owner on recursive mutexes 2021-07-06 17:25:34 +02:00
pthread_tls.cpp Toolchain+Userland: Enable TLS for x86_64 2021-07-04 01:07:28 +02:00
pty.cpp LibC: openpty error handling update 2021-05-30 08:41:17 +02:00
pty.h LibC: Remove 'int* aslave' parameter from forkpty() 2021-05-06 13:52:46 +01:00
pwd.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
pwd.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
qsort.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
regex.cpp LibC: Add stub forwarders to LibRegex C API 2021-08-12 18:56:30 +02:00
regex.h LibRegex+LibUnicode: Begin implementing Unicode property escapes 2021-07-30 21:26:31 +01:00
resolv.cpp LibC: Add stub for res_query 2021-08-14 22:32:00 +01:00
resolv.h LibC: Add stub for res_query 2021-08-14 22:32:00 +01:00
scanf.cpp Everywhere: Behaviour => Behavior 2021-09-07 13:53:14 +02:00
sched.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
sched.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
serenity.cpp Kernel+Userland: Remove loadable kernel moduless 2021-09-11 19:05:00 +02:00
serenity.h Kernel+Userland: Remove loadable kernel moduless 2021-09-11 19:05:00 +02:00
setjmp.h LibC: Run clang-format on setjmp.h 2021-08-31 01:37:30 +02:00
shadow.cpp LibC: Allow empty spwd members when writing shadow entries via putspent 2021-05-30 17:42:03 +01:00
shadow.h LibCore: Fix building the library on macOS 2021-05-01 15:56:16 +02:00
signal_numbers.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
signal.cpp LibC: Support getsignalbyname() with full signal name 2021-08-22 15:23:25 +02:00
signal.h LibC: Expose sig_sysname array 2021-08-18 10:33:48 +02:00
spawn.cpp LibC: Do not include errno.h inside unistd.h 2021-05-14 22:24:02 +02:00
spawn.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ssp.cpp LibC: Use 64-bit stack smash value for 64-bit mode 2021-07-17 01:45:20 +02:00
stat.cpp Kernel+LibC: Pack SC_stat_params struct tighter 2021-09-16 17:17:13 +02:00
stdarg.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stddef.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stdint.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stdio_ext.h LibC: Implement __fpurge 2021-05-30 14:56:50 +01:00
stdio.cpp LibC: Make remove() propagate non-EISDIR unlink() errors 2021-09-09 21:49:49 +02:00
stdio.h Kernel+LibC: Share definitions for stdio.h 2021-08-14 19:58:11 +02:00
stdlib.cpp LibC+DynamicLoader: Store the auxiliary vector address at startup 2021-09-20 18:32:09 +02:00
stdlib.h LibC: Implement mblen() 2021-06-04 10:39:41 +02:00
string.cpp LibC: Upgrade memmove() to memcpy() when possible 2021-09-13 19:11:33 +02:00
string.h LibC: Implement strerror_r() 2021-05-25 17:36:02 +02:00
strings.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
strings.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
stubs.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
sysexits.h LibC: Use EX_IOERR instead of EX_IOER 2021-06-10 20:21:08 +01:00
syslog.cpp LibC: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
syslog.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termcap.cpp AK: Replace the mutable String::replace API with an immutable version 2021-09-11 20:36:43 +03:00
termcap.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termios.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
termios.h Kernel+LibC: Share definitions for termios.h 2021-08-14 19:58:11 +02:00
time.cpp LibC: Don't delete null check in gettimeofday 2021-08-12 21:10:44 +02:00
time.h Kernel+LibC: Share definitions for time.h and sys/stat.h 2021-08-14 19:58:11 +02:00
times.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ulimit.cpp LibC: Add stubs for getrlimit()/setrlimit() 2021-05-08 19:14:21 +02:00
ulimit.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
unistd.cpp Kernel+LibC: Pack SC_mount_params struct tighter 2021-09-16 17:17:13 +02:00
unistd.h Kernel+Userland: Introduce a new way to reboot and poweroff the machine 2021-09-12 11:52:16 +02:00
utime.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utime.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utmp.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
utsname.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
wchar.cpp LibC: Primitively implement wcscoll 2021-09-18 02:57:56 +00:00
wchar.h LibC: Implement mbsinit and mbrtowc 2021-09-16 16:42:40 +02:00
wctype.cpp LibC: Implement towctrans 2021-09-17 22:59:51 +00:00
wctype.h LibC: Change wctrans_t to be a long instead of int* 2021-09-17 22:59:51 +00:00