This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC PATCH V2 02/10] C-SKY: TLS support
On Thu, 26 Apr 2018, Mao Han wrote:
> Hi,
> On Tue, Apr 17, 2018 at 08:50:03PM +0000, Joseph Myers wrote:
> > On Sun, 8 Apr 2018, Mao Han wrote:
> >
> > > +/* Default to an executable stack. PF_X can be overridden if PT_GNU_STACK is
> > > + * present, but it is presumed absent. */
> > > +#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X)
> >
> > This is not an appropriate default for a new port. (Of course you need to
> > fix your kernel port accordingly so it doesn't default to an executable
> > stack either.)
> >
> > Also, globally in the port, no leading '*' on second and subsequent lines
> > of comments.
> >
> So just define to #define DEFAULT_STACK_PERMS (PF_R|PF_W). We have no
> memory executable on our hardware. So seems not need to change on the
> kernel side?
I believe the relevant kernel definitions to check, to make sure that the
kernel does not give execute permissions to stack pages by default, are
elf_read_implies_exec and VM_STACK_DEFAULT_FLAGS / VM_DATA_DEFAULT_FLAGS.
--
Joseph S. Myers
joseph@codesourcery.com