diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-06-28 12:20:58 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-06-28 12:27:01 -0400 |
commit | 193338e619de7c993efa2c0e1a87240bd732c181 (patch) | |
tree | 1ecbb218d7c513cb41f3a0174762d8adb07e55b8 /src/string/memccpy.c | |
parent | f6870d6b4f32c99fdbf4367422820218b2f638bb (diff) | |
download | musl-193338e619de7c993efa2c0e1a87240bd732c181.tar.gz musl-193338e619de7c993efa2c0e1a87240bd732c181.tar.bz2 musl-193338e619de7c993efa2c0e1a87240bd732c181.tar.xz musl-193338e619de7c993efa2c0e1a87240bd732c181.zip |
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.
Diffstat (limited to 'src/string/memccpy.c')
0 files changed, 0 insertions, 0 deletions