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: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Andreas Schwab
> Sent: Wednesday, September 20, 2017 12:19 PM
> To: Joseph Myers <joseph@codesourcery.com>
> Cc: gcc-patches@gcc.gnu.org; law@redhat.com; dave.anglin@bell.net;
> wilson@tuliptree.org; eager@eagercon.com
> Subject: Re: Enable no-exec stacks for more targets using the Linux kernel
> 
> On Sep 19 2017, Joseph Myers <joseph@codesourcery.com> 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?
> 
> For ia64 on linux there is EF_IA_64_LINUX_EXECUTABLE_STACK to request
> executable heap and stack.  But since ia64 uses function descriptors,
> trampolines never need that.
> 
> Andreas.
Sorry somehow mail thread was missed in my earlier mail.
Resending the same reply again:
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

Thanks,
Nagaraju

> --
> Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196
> BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7 "And now for something
> completely different."


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