]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
349941 di_notify_mmap might create wrong start/size DebugInfoMapping
authorMark Wielaard <mark@klomp.org>
Tue, 7 Jul 2015 13:01:40 +0000 (13:01 +0000)
committerMark Wielaard <mark@klomp.org>
Tue, 7 Jul 2015 13:01:40 +0000 (13:01 +0000)
Use seg->start instead of a as DebugInfoMapping avma. Normally seg->start
equals a. But when it is not then the size of the map might extend beyond
the segment (and not actually cover the start of the segment). When another
ELF file is them mapped right after this then it triggers an overlap purge
of the DebugInfo. In the case the mapping was for libc or ld.so this then
removes all intercepts causing "bad things".

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15398

NEWS
coregrind/m_debuginfo/debuginfo.c

diff --git a/NEWS b/NEWS
index 48fe21c82a97ffe6666563f532988841cbd426d9..035de411e012b06e68386630c2af0d310e76aa5e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -250,6 +250,7 @@ where XXXXXX is the bug number as listed below.
 349626  Implemented additional Xen hypercalls
 349874  Fix typos in source code
 349828  memcpy intercepts memmove causing src/dst overlap error (ppc64 ld.so)
+349941  di_notify_mmap might create wrong start/size DebugInfoMapping
 n-i-bz  Provide implementations of certain compiler builtins to support
         compilers who may not provide those
 n-i-bz  Old STABS code is still being compiled, but never used. Remove it.
index 8f2178e204d97e3678679ade0700ed97a9526866..b69c1c812963bec03a1adcfd8b1375dd5c17bd72 100644 (file)
@@ -1038,7 +1038,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
 
    /* Note the details about the mapping. */
    DebugInfoMapping map;
-   map.avma = a;
+   map.avma = seg->start;
    map.size = seg->end + 1 - seg->start;
    map.foff = seg->offset;
    map.rx   = is_rx_map;