public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Nix <nix@esperi.org.uk>
Cc: libc-alpha@sourceware.org,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH 08/12] De-PLTize __stack_chk_fail internal calls within libc.so.
Date: Thu, 15 Dec 2016 14:21:00 -0000	[thread overview]
Message-ID: <78b1f109-91e5-4150-4c00-15a86aacb2f7@redhat.com> (raw)
In-Reply-To: <87y3zhjn1s.fsf@esperi.org.uk>

On 12/15/2016 03:15 PM, Nix wrote:

> Possible fix, untested:
>
> diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
> index 36908b5..0679354 100644
> --- a/sysdeps/generic/symbol-hacks.h
> +++ b/sysdeps/generic/symbol-hacks.h
> @@ -7,5 +7,7 @@ asm ("memcpy = __GI_memcpy");
>
>  /* -fstack-protector generates calls to __stack_chk_fail, which need
>     similar adjustments to avoid going through the PLT.  */
> +#if defined __SSP__ || defined __SSP_ALL__ || defined __SSP_STRONG__
>  asm ("__stack_chk_fail = __stack_chk_fail_local");
>  #endif
> +#endif

The condition looks rather brittle.  What if GCC grows an 
-fstack-protector-light switch and __SSP_LIGHT__ macro?

I wonder if it's better to add something to $(no-stack-protector) and 
use that in the conditional.

Thanks,
Florian

  reply	other threads:[~2016-12-15 14:21 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 12:33 --enable-stack-protector for glibc, v9 Nix
2016-11-28 12:33 ` [PATCH 07/12] Add stack_chk_fail_local to libc.so Nix
2016-11-28 12:33 ` [PATCH 04/12] Compile the entire dynamic linker with -fno-stack-protector Nix
2016-11-28 12:33 ` [PATCH 06/12] Work even with compilers hacked to enable -fstack-protector by default Nix
2016-11-28 12:33 ` [PATCH 03/12] Mark all machinery needed in early static-link init as -fno-stack-protector Nix
2016-12-15 14:01   ` Florian Weimer
2016-12-15 14:21     ` Nick Alcock
2016-12-15 14:31       ` Florian Weimer
2016-12-15 14:44         ` Nick Alcock
2016-11-28 12:33 ` [PATCH 12/12] Enable -fstack-protector=* when requested by configure Nix
2016-11-28 13:25 ` [PATCH 10/12] Drop explicit stack-protection of pieces of the system Nix
2016-11-28 13:25 ` [PATCH 08/12] De-PLTize __stack_chk_fail internal calls within libc.so Nix
2016-12-15 13:56   ` Florian Weimer
2016-12-15 14:16     ` Nix
2016-12-15 14:21       ` Florian Weimer [this message]
2016-12-15 14:29         ` Nix
2016-12-15 14:33           ` Florian Weimer
2016-12-15 14:40             ` Nix
2016-12-15 17:24               ` Nix
2016-12-15 18:22                 ` Florian Weimer
2016-12-15 20:00                   ` Nix
2016-12-15 20:22                     ` Florian Weimer
2016-12-15 20:44                       ` Florian Weimer
2016-12-15 20:49                         ` Nix
2016-12-15 20:58                           ` Florian Weimer
2016-12-16 11:39                       ` Florian Weimer
2016-12-16 11:44                         ` Nix
2016-11-28 13:25 ` [PATCH 09/12] Link various tests with -fno-stack-protector Nix
2016-12-15 14:43   ` Florian Weimer
2016-12-15 14:54     ` Nix
2016-12-15 15:54       ` Florian Weimer
2016-12-15 15:56         ` Nix
2016-12-15 15:55       ` Nix
2016-11-28 13:26 ` [PATCH 05/12] Prevent the rtld mapfile computation from dragging in __stack_chk_fail* Nix
2016-11-28 13:26 ` [PATCH 02/12] Do not stack-protect ifunc resolvers Nix
2016-12-15 12:18   ` Florian Weimer
2016-12-15 12:34     ` Nick Alcock
2016-12-15 12:58       ` Florian Weimer
2016-11-28 13:26 ` [PATCH 01/12] Initialize the stack guard earlier when linking statically Nix
2016-11-28 13:26 ` [PATCH 11/12] Do not stack-protect sigreturn stubs Nix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78b1f109-91e5-4150-4c00-15a86aacb2f7@redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=nix@esperi.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).