This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: --enable-stack-protector for glibc, v4, now with arm
- From: Nix <nix at esperi dot org dot uk>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 04 Mar 2016 11:12:32 +0000
- Subject: Re: --enable-stack-protector for glibc, v4, now with arm
- Authentication-results: sourceware.org; auth=none
- References: <1456677695-29778-1-git-send-email-nix at esperi dot org dot uk> <87twko68ew dot fsf at esperi dot org dot uk> <56D76644 dot 8050906 at linaro dot org> <87fuw74g9b dot fsf at esperi dot org dot uk>
On 3 Mar 2016, nix@esperi.org.uk said:
> I left that in specifically because I wasn't sure which way to go (we
> see it on all platforms, including SPARC and ARM). It is quite possibly
> desirable to de-PLTify this (because these calls are frequently made),
> but it's *also* quite possibly desirable not to do that, because, like
> malloc(), __stack_chk_fail() might reasonably be something that people
> might want to intercept, to change what happens on stack overrun.
"It's plausible" is of course code for "I have no idea and am guessing".
I just had a look on codesearch.debian.net. Overriders (ignoring other
libcs and early runtimes in things like openbios and grub which do
not link against a libc anyway):
physfs, on MacOS X only, because libssp is missing;
wine, overriding it with nothing just to placate the linker;
dmtcp, just prints an error and aborts, would be happy with ours;
run in bizarre circumstances out of an mmap()ed memory region and
also includes stubs for a lot of libgcc
condor, provides __stack_chk_fail itself iff glibc is old, so clearly
*expects* glibc to provide it
*Nobody* overrides __stack_chk_fail with anything significant enough
that they'd be unhappy if we provided an implementation, so I'm going to
go with what you suggested and just de-PLTify it for local within-glibc
calls, leaving it unchanged for everything else.
I also note this code in the binutils ld testsuite:
set flags "--defsym __stack_chk_fail=0"
which gives me confidence that my independent evolution of the same
horrendous hack in the librtld mapfile computation is not all that bad :)
--
NULL && (void)