--enable-stack-protector for glibc, v4, now with arm
Nix
nix@esperi.org.uk
Fri Mar 4 11:12:00 GMT 2016
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)
More information about the Libc-alpha
mailing list