• R
    treat failure of mprotect in map_library as a fatal load failure · f7d15dcc
    Rich Felker 提交于
    the error will propagate up and be printed to the user at program
    start time; at runtime, dlopen will just fail and leave a message for
    dlerror.
    
    previously, if mprotect failed, subsequent attempts to perform
    relocations would crash the program. this was resulting in an
    increasing number of false bug reports on grsec systems where rwx
    permission is not possible in cases where users were wrongly
    attempting to use non-PIC code in shared libraries. supporting that
    usage is in theory possible, but the x86_64 toolchain does not even
    support textrels, and the cost of keeping around the necessary
    information to handle textrels without rwx permissions is
    disproportionate to the benefit (which is essentially just supporting
    broken library setups on grsec machines).
    
    also, i unified the error-out code in map_library now that there are 3
    places from which munmap might have to be called.
    f7d15dcc
dynlink.c 20.7 KB