From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6401 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: magic constants in some startup code Date: Fri, 31 Oct 2014 12:09:13 -0400 Message-ID: <20141031160913.GC22465@brightrain.aerifal.cx> References: <45BFC4C3-FA51-49B5-8C58-1C1FC075BD28@cognitive-electronics.com> <20141031141844.GA22465@brightrain.aerifal.cx> <8B3E5DDE-2691-4377-8934-362ACC7BEA69@cognitive-electronics.com> 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 1414771774 18145 80.91.229.3 (31 Oct 2014 16:09:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 16:09:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6414-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 31 17:09:28 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XkElU-0006Yb-45 for gllmg-musl@m.gmane.org; Fri, 31 Oct 2014 17:09:28 +0100 Original-Received: (qmail 24240 invoked by uid 550); 31 Oct 2014 16:09:26 -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 24232 invoked from network); 31 Oct 2014 16:09:26 -0000 Content-Disposition: inline In-Reply-To: <8B3E5DDE-2691-4377-8934-362ACC7BEA69@cognitive-electronics.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6401 Archived-At: On Fri, Oct 31, 2014 at 10:31:45AM -0400, Richard Gorton wrote: > Thank you (and a follow up question) - what code looks at this > canary? It is assigned to pthread_self()->canary, but I do not see > any code inside musl itself that checks that value? A work in > progress? Or does other code check this value? It's part of the stack-protector feature at the compiler level. gcc, clang, and any other compilers that implement this feature generate code to read the canary at the start of a function protected by stack protector, store it between the saved return address and local buffers, and check that it hasn't been clobbered before returning. Rich