diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-12-29 12:24:28 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-01-20 11:13:53 -0300 |
commit | 961d7cff51332b7b4ed98d4530a98f73355dda4b (patch) | |
tree | a99241d06c8e58419c5bf65f14f149aa2620f4b3 /sysdeps/unix/sysv/linux/dl-sysdep.c | |
parent | 1006250ea2d683e684f65911d738bd84f55c06c1 (diff) | |
download | glibc-961d7cff51332b7b4ed98d4530a98f73355dda4b.tar.gz glibc-961d7cff51332b7b4ed98d4530a98f73355dda4b.tar.xz glibc-961d7cff51332b7b4ed98d4530a98f73355dda4b.zip |
stdlib: Add testcase for BZ #26241
Old implementation of realpath allocates a PATH_MAX using alloca for each symlink in the path, leading to MAXSYMLINKS times PATH_MAX maximum stack usage. The test create a symlink with __eloop_threshold() loops and creates a thread with minimum stack size (obtained through support_small_stack_thread_attribute). The thread issues a stack allocations that fill the thread allocated stack minus some slack plus and the realpath usage (which assumes a bounded stack usage). If realpath uses more than about 2 * PATH_MAX plus some slack it triggers a stackoverflow. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/dl-sysdep.c')
0 files changed, 0 insertions, 0 deletions