mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: New gcc wrapper to try
Date: Tue, 24 Apr 2012 18:10:40 -0400	[thread overview]
Message-ID: <20120424221040.GS14673@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120424214127.GQ14673@brightrain.aerifal.cx>

On Tue, Apr 24, 2012 at 05:41:27PM -0400, Rich Felker wrote:
> On Wed, Apr 25, 2012 at 01:28:40AM +0400, Solar Designer wrote:
> > Rich, Isaac -
> > 
> > On Tue, Apr 24, 2012 at 12:28:28PM -0700, Isaac Dunham wrote:
> > > On Mon, 23 Apr 2012 05:19:05 -0400 Rich Felker <dalias@aerifal.cx> wrote:
> > > > Somebody has enabled stack protector. Either your distro (what distro
> > > > are you using) has hacked gcc in a way different from what musl-gcc
> > > > expects, or wireless-tools' makefile is adding -fstack-protector...
> > > 
> > > There's no -fstack-protector, so it's Ubuntu's fault.
> > 
> > Several distros do it these days (and Owl will start doing it soon as
> > well), so it's becoming standard and needs to be supported.
> > Technically, -fno-stack-protector in the musl-gcc wrapper would probably
> > make things appear to work, but it's not necessarily a good thing to do
> > since it might violate reasonable expectations of the user.  I think
> > it'd be better for musl to start providing the necessary symbols.
> 
> The problem is that the default gcc build incorporates glibc ABI
> knowledge (layout of the thread structure) and the assumption that the
> thread pointer has been initialized into any binary built with stack
> protector. Just adding symbols will not fix anything.
> 
> If gcc's stack protector support is built without TLS support so that
> it uses a global variable for the canary, instead of a thread-local
> variable, then we could support it with no work at all. Unfortunately
> I don't believe there's any way to override the type of canary access
> gcc does via command line options; you have to rebuild gcc. Thus, for
> the time being (until/unless we do TLS and mimic glibc's structure
> layout), disabling stack protector is the only option for the wrapper
> to use. For our own native gcc builds, we can already support it if I
> just add the symbol it needs.

......but since you requested it, I'm working on trying to make it
work anyway. We'll see how it goes. Preliminary support was just
committed.

Rich


  reply	other threads:[~2012-04-24 22:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  6:49 Rich Felker
2012-04-21 20:37 ` Rich Felker
2012-04-23  5:57   ` Isaac Dunham
2012-04-23  9:19     ` Rich Felker
2012-04-24 19:28       ` Isaac Dunham
2012-04-24 19:45         ` Isaac Dunham
2012-04-24 21:28         ` Solar Designer
2012-04-24 21:41           ` Rich Felker
2012-04-24 22:10             ` Rich Felker [this message]
2012-04-24 22:14               ` Solar Designer
2012-04-24 23:53                 ` Szabolcs Nagy
2012-04-25  1:21                   ` Solar Designer
2012-04-21 22:45 ` Isaac Dunham

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=20120424221040.GS14673@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).