git: rtld: Add stubs to support PT_GNU_STACK

John Marino marino at crater.dragonflybsd.org
Mon Jan 23 08:15:10 PST 2012


commit e9de6dccf96c643b779ee1f2d5de6a19375e7fa8
Author: John Marino <draco at marino.st>
Date:   Sat Jan 21 21:53:12 2012 +0100

    rtld: Add stubs to support PT_GNU_STACK
    
    This functionality requires kernel support to determine the initial stack
    access mode.  This is how it's supposed to work:
    
    If the loaded DSO requires an executable stack as specified by the PF_X
    bit or p_flags on PT_GNU_STACK phdr, yet the current stack protection does
    not permit execution: The map_stacks_exec function should change the
    stack protection mode of all thread stacks.
    
    The PT_GNU_STACK phdr parser has been implemented as well as a private
    interface to _rtld_get_stack_prot() in order to export the stack access
    mode calculated by rtld.
    
    Left to do:
    1) Implement stack protection in the kernel
    2) Add PT_GNU_STACK functionality in the kernel
    3) Add a method to change stack protection mode in libc or libthread
    4) Implement map_stacks_exec function in rtld.

Summary of changes:
 lib/libc/gen/dlfcn.c                   |    7 ++++
 libexec/rtld-elf/i386/rtld_machdep.h   |    3 ++
 libexec/rtld-elf/map_object.c          |    8 ++++-
 libexec/rtld-elf/rtld.c                |   49 ++++++++++++++++++++++++++++++++
 libexec/rtld-elf/rtld.h                |    1 +
 libexec/rtld-elf/x86_64/rtld_machdep.h |    3 ++
 sys/sys/link_elf.h                     |    1 +
 7 files changed, 71 insertions(+), 1 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e9de6dccf96c643b779ee1f2d5de6a19375e7fa8


-- 
DragonFly BSD source repository





More information about the Commits mailing list