mbox

[v2,0/4] Improved ASLR

Message ID 20201128115945.42732-1-toiwoton@gmail.com
Headers

Message

Topi Miettinen Nov. 28, 2020, 11:59 a.m. UTC
  Problem with using sbrk() for allocations is that the location of the
memory is relatively predicatable since it's always located next to
data segment. This series makes the tunables system, malloc() and TCB
use mmap() instead, except when instructed by tunable
glibc.malloc.use_sbrk.

In this version, mmap() is also used for temporary storage for
tunables environment variable. Since the tunable to select using
sbrk() is unavailable at that point of time, mmap() is always
used. mmap() and mmap_noerrno() (other functions use this suffix) have
been refactored (Adhemerval Zanella), there's also a version for Hurd.

Topi Miettinen (4):
  csu: randomize location of TCB
  malloc: use mmap() to improve ASLR
  dl-sysdep: disable remaining calls to sbrk()
  tunables: use mmap() instead of sbrk()

 csu/libc-tls.c                               | 40 ++++++++++++++++----
 elf/dl-sysdep.c                              | 11 +++++-
 elf/dl-tunables.c                            |  9 +++--
 elf/dl-tunables.list                         |  7 ++++
 include/sys/mman.h                           |  5 +++
 malloc/arena.c                               | 11 +++++-
 malloc/morecore.c                            | 10 +++++
 manual/tunables.texi                         |  5 +++
 sysdeps/mach/hurd/dl-sysdep.c                | 18 +++++++--
 sysdeps/unix/sysv/linux/dl-sysdep.c          | 10 +++++
 sysdeps/unix/sysv/linux/mmap.c               | 30 ++++++++++++---
 sysdeps/unix/sysv/linux/mmap64.c             | 23 ++++++++---
 sysdeps/unix/sysv/linux/mmap_internal.h      |  2 +-
 sysdeps/unix/sysv/linux/s390/mmap_internal.h |  2 +-
 14 files changed, 154 insertions(+), 29 deletions(-)


base-commit: aa69f19a937b679816ef10e8620ea1141bb1734b