Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 5 Feb 2018 11:50:45 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH v2] track pthread stack guard sizes

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

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ