From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12460 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v2] track pthread stack guard sizes Date: Mon, 5 Feb 2018 11:50:45 -0500 Message-ID: <20180205165045.GX1627@brightrain.aerifal.cx> References: <20180202200855.1514-1-nenolod@dereferenced.org> <20180205162403.GV1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1517849362 24162 195.159.176.226 (5 Feb 2018 16:49:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Feb 2018 16:49:22 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12476-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 05 17:49:18 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eijx8-0005O8-Ip for gllmg-musl@m.gmane.org; Mon, 05 Feb 2018 17:49:10 +0100 Original-Received: (qmail 30577 invoked by uid 550); 5 Feb 2018 16:50:58 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30543 invoked from network); 5 Feb 2018 16:50:57 -0000 Content-Disposition: inline In-Reply-To: <20180205162403.GV1627@brightrain.aerifal.cx> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12460 Archived-At: On Mon, Feb 05, 2018 at 11:24:03AM -0500, Rich Felker wrote: > On Mon, Feb 05, 2018 at 07:18:44PM +0300, Alexander Monakov wrote: > > On Fri, 2 Feb 2018, William Pitcock wrote: > > > --- a/src/internal/pthread_impl.h > > > +++ b/src/internal/pthread_impl.h > > > @@ -46,6 +46,7 @@ struct pthread { > > > char *dlerror_buf; > > > int dlerror_flag; > > > void *stdio_locks; > > > + size_t guard_size; > > > uintptr_t canary_at_end; > > > void **dtv_copy; > > > }; > > > > Doesn't this break SSP on powerpc and powerpc64 by changing offset of > > 'canary_at_end'? If not, can you please mention why in the commit message? > > The "_at_end" means it's at a fixed negative offset from the end of > the structure. I already have this patch pending push in my tree, but > I can add a separate commit commenting the ABI-mandated layout of the > structure. Done, pending push. BTW I wonder if we should also add static asserts for this sort of thing, e.g. _Static_assert(offsetof(struct pthread, canary_at_end) == sizeof(struct pthread) - 2*sizeof(size_t)) It would probably have to be implemented without actually using the _Static_assert keyword since we don't depend on a C11 compiler, but of course the usual tricks apply just fine. Rich