This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Enable no-exec stacks for more targets using the Linux kernel


> -----Original Message-----
> From: Joseph Myers [mailto:joseph@codesourcery.com]
> Sent: Wednesday, September 20, 2017 5:52 PM
> To: Nagaraju Mekala <nmekala@xilinx.com>
> Cc: schwab@suse.de; gcc-patches@gcc.gnu.org; law@redhat.com;
> dave@anglin.bell.net; wilson@tuliptree.org; Michael Eager
> <eager@eagercon.com>
> Subject: Re: Enable no-exec stacks for more targets using the Linux kernel
> 
> On Wed, 20 Sep 2017, Nagaraju Mekala wrote:
> 
> > > I've sent a glibc patch
> > > <https://sourceware.org/ml/libc-alpha/2017-09/msg00734.html>.  I
> > >think the key questions for architecture experts now are: on each of
> > >those three architectures, do trampolines ever require executable
> > >stacks, and, if they do, how does this work at present when the
> > >kernel defaults to non-executable and my understanding at
> > ><https://sourceware.org/ml/libc-alpha/2017-09/msg00747.html> would be
> > >that glibc would only make thread stacks executable on those
> > >architectures, not the main process stacks, and GCC will never
> > >generate an explicit marker on those architectures to request an executable
> stack?
> >
> > Microblaze is a soft processor with many configuration options. If we
> > don't use the MMU, there is nothing preventing execution of code on
> > the stack in the MicroBlaze architecture.
> >  With the MMU, you have the option to make any page, including the
> > stack  pages, executable or not.
> >
> > It is recommended to prevent execution on the stack by defining those
> > pages as non-executable in the MMU. In particular, trampolines would
> > have to be possible to code without execution on the stack
> 
> No-MMU configurations are not relevant to a glibc change; the question is
> how things work for configurations using glibc, with the Linux kernel, with an
> MMU.  In such a configuration, for MicroBlaze: (a) is the stack in fact
> executable, now; (b) if it is, what makes it so given the kernel default to non-
> executable (where does my reasoning about what the kernel and glibc do go
> wrong); (c) if it is not executable, do trampolines work anyway?

The MMU configuration doesn't need stack to be executable.
The glibc patch related to Microblaze looks correct and it should solve the issue.
We will verify the change in a day or two and get back to you.

Thanks,
Nagaraju 

> --
> Joseph S. Myers
> joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]