This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487) [committed]
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 13 Feb 2020 11:21:55 +0100
- Subject: Re: Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487) [committed]
- References: <alpine.DEB.2.21.2002122331510.29921@digraph.polyomino.org.uk>
* Joseph Myers:
> Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero
> argument (an representation where all the significand bits, including
> diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile
> index 995e90d6da..318628aed6 100644
> --- a/sysdeps/ieee754/ldbl-96/Makefile
> +++ b/sysdeps/ieee754/ldbl-96/Makefile
> @@ -17,5 +17,6 @@
> # <https://www.gnu.org/licenses/>.
>
> ifeq ($(subdir),math)
> -tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96
> +tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo
> +CFLAGS-test-sinl-pseudo.c += -fstack-protector-all
> endif
> diff --git a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
Thanks for fixing this. Unfortunately, the test doesn't build on ia64
because GCC does not support -fstack-protector-all there:
cc1: error: ‘-fstack-protector’ not supported for this target [-Werror]
cc1: all warnings being treated as errors
make[3]: *** [/mnt/scratch1/fw/bmg/default/build/glibcs/ia64-linux-gnu/glibc/sysd-rules:639: /mnt/scratch1/fw/bmg/default/build/glibcs/ia64-linux-gnu/glibc/math/test-sinl-pseudo.o] Error 1