aboutsummaryrefslogtreecommitdiff
path: root/stdlib/tst-canon-bz26341.c
AgeCommit message (Collapse)AuthorFilesLines
2021-10-20stdlib: Fix tst-canon-bz26341 when the glibc build current working directory ↵omain GEISSLER1-0/+6
is itself using symlinks.
2021-03-24stdlib: Fix BZ #26241 testcase on GNU/HurdSamuel Thibault1-3/+4
GNU/Hurd's readlink system call is partly implemented in userspace, which also allocates a buffer on the stack for the result, and thus needs one more path. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-01-20stdlib: Add testcase for BZ #26241Adhemerval Zanella1-0/+101
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>