This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[RFC] [MIPS] Enable non-executable PT_GNU_STACK support


Currently the MIPS FPU emulator uses eXecute Out of Line (XOL) on the stack to
handle instructions in the delay slots of FPU branches.  Because of this MIPS
cannot have a non-executable stack. While the solution on the kernel side is
not yet finalized, we propose changes required on the tools-side to make them
ready for a seamless transition whenever a fixed kernel becomes available.

glibc/dynamic linker:
----
* When non-executable stack is requested, first check AT_FLAGS in the
  auxiliary vector to decide if this kernel supports a non-executable
  stack. Persist with the non-executable mode specified on the
  PT_GNU_STACK segment only if kernel supports it, else revert to an
  executable stack.

* The 25th bit (1<<24) in AT_FLAGS is reserved for use by the kernel to
  indicate that it supports a non-executable stack on MIPS.

* glibc's ABIVERSION is incremented from 3 to 5, so that applications linked
  for this glibc can't be accidentally run against older versions. ABIVERSION
  4 has been skipped over because it was chosen for IFUNC support, which is
  still under review.

binutils:
----
* Increment the ABIVERSION to 5 for objects with non-executable stacks.

gcc:
----
* Check if assembler/dynamic linker support the new behaviour
  (ABIVERSION >= 5). If yes, enable non-executable stack by default
  for all objects.

Faraz Shahbazker (1):
  Enable non-executable PT_GNU_STACK support

 csu/init-first.c                                 |    4 ++
 elf/Makefile                                     |   11 +++--
 elf/dl-execstack-ovrd.c                          |   25 +++++++++++
 elf/dl-load.c                                    |    8 ++++
 elf/dl-support.c                                 |    4 ++
 elf/rtld.c                                       |    1 +
 elf/tst-execstack-ovrd-static.c                  |    1 +
 elf/tst-execstack-ovrd.c                         |    1 +
 sysdeps/generic/ldsodefs.h                       |    8 ++++
 sysdeps/unix/sysv/linux/mips/dl-execstack-ovrd.c |   50 ++++++++++++++++++++++
 sysdeps/unix/sysv/linux/mips/init-first.c        |   26 +++++++++++
 sysdeps/unix/sysv/linux/mips/ldsodefs.h          |    2 +-
 sysdeps/unix/sysv/linux/mips/libc-abis           |    6 +++
 13 files changed, 143 insertions(+), 4 deletions(-)
 create mode 100644 elf/dl-execstack-ovrd.c
 create mode 100644 elf/tst-execstack-ovrd-static.c
 create mode 100644 elf/tst-execstack-ovrd.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/dl-execstack-ovrd.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/init-first.c

-- 
1.7.9.5


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