musl/ldso
Rich Felker 193338e619 avoid spurious dso matches by dladdr outside bounds of load segments
since slack space at the beginning and/or end of writable load maps is
donated to malloc, the application could obtain valid pointers in
these ranges which dladdr would erroneously identify as part of the
shared object whose mapping they came from.

instead of checking the queried address against the mapping base and
length, check it against the load segments from the program headers,
and only match the dso if it lies within the bounds of one of them.

as a shortcut, if the address does match the range of the mapping but
not any of the load segments, we know it cannot match any other dso
and can immediately return failure.
2018-06-28 12:27:01 -04:00
..
dlstart.c fix regression in SH/FDPIC dynamic linker 2016-02-18 04:13:05 +00:00
dynlink.c avoid spurious dso matches by dladdr outside bounds of load segments 2018-06-28 12:27:01 -04:00