about summary refs log tree commit diff
path: root/stdlib/tst-strfrom.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-12-29 12:24:28 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-01-20 11:13:53 -0300
commit961d7cff51332b7b4ed98d4530a98f73355dda4b (patch)
treea99241d06c8e58419c5bf65f14f149aa2620f4b3 /stdlib/tst-strfrom.h
parent1006250ea2d683e684f65911d738bd84f55c06c1 (diff)
downloadglibc-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 'stdlib/tst-strfrom.h')
0 files changed, 0 insertions, 0 deletions