[0/3] Convenience function for allocating (alternate signal) stacks

Message ID cover.1621511874.git.fweimer@redhat.com
Headers show
Series
  • Convenience function for allocating (alternate signal) stacks
Related show

Message

Siddhesh Poyarekar via Libc-alpha May 20, 2021, 12:11 p.m.
This complements the _SC_MINSIGSTKSZ changes by wrapping the stack
allocation with its size computation in a helper function.  Guard pages
are also allocated.

If this is acceptable, I'll figure out a way to integrate this with
threads, so that applications can request an alternate signal stack on
thread creation that is automatically deallocated once the thread exits.

Thanks,
Florian

Florian Weimer (3):
  elf: Initialize GLRO (dl_minsigstacksize) after static dlopen
  Hurd: Define ARCH_MIN_GUARD_SIZE in internal <pthread.h>
  Misc: Add <sys/cstack.h> and the cstack_* family of functions

 NEWS                                          |   4 +
 elf/rtld_static_init.c                        |   2 +
 include/sys/cstack.h                          |  39 ++++++
 manual/memory.texi                            |  99 ++++++++++++++
 manual/signal.texi                            |   3 +
 misc/Makefile                                 |   8 +-
 misc/Versions                                 |   5 +
 misc/cstack_allocate.c                        | 125 ++++++++++++++++++
 misc/cstack_free.c                            |  30 +++++
 misc/cstack_get.c                             |  27 ++++
 misc/sys/cstack.h                             |  53 ++++++++
 misc/tst-cstack.c                             | 118 +++++++++++++++++
 sysdeps/htl/include/pthread.h                 |   3 +
 sysdeps/mach/hurd/i386/libc.abilist           |   3 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   3 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |   3 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |   3 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   3 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   3 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   3 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |   3 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |   3 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |   3 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |   3 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   3 +
 .../sysv/linux/microblaze/be/libc.abilist     |   3 +
 .../sysv/linux/microblaze/le/libc.abilist     |   3 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |   3 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |   3 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |   3 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |   3 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   3 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |   3 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |   3 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |   3 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |   3 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |   3 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   3 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |   3 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   3 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |   3 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |   3 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |   3 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |   3 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |   3 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   3 +
 46 files changed, 612 insertions(+), 3 deletions(-)
 create mode 100644 include/sys/cstack.h
 create mode 100644 misc/cstack_allocate.c
 create mode 100644 misc/cstack_free.c
 create mode 100644 misc/cstack_get.c
 create mode 100644 misc/sys/cstack.h
 create mode 100644 misc/tst-cstack.c

-- 
2.31.1