From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6233 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: A running list of questions from "porting" Slackware to musl Date: Wed, 1 Oct 2014 09:30:50 -0400 Message-ID: <20141001133050.GK23797@brightrain.aerifal.cx> References: <542AA579.2040304@langurwallah.org> <20140930153216.GA1785@newbook> <20140930155023.GC23797@brightrain.aerifal.cx> <542B41C4.1040701@amacapital.net> <20141001074817.GL21835@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1412170270 23593 80.91.229.3 (1 Oct 2014 13:31:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2014 13:31:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6246-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 01 15:31:04 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XZJzj-0006Jm-Pt for gllmg-musl@plane.gmane.org; Wed, 01 Oct 2014 15:31:03 +0200 Original-Received: (qmail 26357 invoked by uid 550); 1 Oct 2014 13:31:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26349 invoked from network); 1 Oct 2014 13:31:02 -0000 Content-Disposition: inline In-Reply-To: <20141001074817.GL21835@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6233 Archived-At: On Wed, Oct 01, 2014 at 09:48:17AM +0200, Szabolcs Nagy wrote: > * Andy Lutomirski [2014-09-30 16:50:28 -0700]: > > On 09/30/2014 08:50 AM, Rich Felker wrote: > > > When gcc generates the canary-check code, on failure it normally > > > calls/jumps to __stack_chk_fail. But for shared libraries, that call > > > would go to a thunk in the library's PLT, which depends on the GOT > > > register being initialized (actually this varies by arch; x86_64 > .... > > > > On x86_64, this would be call *whatever@gotoff(%rip) instead of call > > whatever@plt. > > > > (Even better: the loader could patch the PLT with a direct jump. Could > .... > > hm this seems to be a lot of complication just to crash > > if gcc had a -fcrash-on-ssp-chk-fail flag that simply generated > a crash instruction that would be simpler/smaller/more secure > > (actually i think that should be the default behaviour) Yes, it really should. Perhaps we could post a GCC bug report requesting this with a link to one or more of the articles on exploiting the introspective debug code in gcc/glibc crash handlers. Rich