viralcode / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
1 stars 0 forks source link

Need to check that the shadow memory does not overlap with existing mappings #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes hard-to-debug errors arise if the runtime library maps the shadow 
memory regions over the existing mappings (those are usually code segments; 
this may occur if ASLR is on (see issue 29) or any of the libraries is forced 
to have a fixed load address (see issue 38)).

We need to detect such situations and report them, because otherwise mmap() 
call may silently pass.

This can be easily done by querying the list of existing mappings, but this is 
generally thread-unsafe, so we may need to add locking to prevent libraries 
from being loaded or unloaded at this time (see man 3 dyld, 
_dyld_register_func_for_add_image() and _dyld_register_func_for_remove_image())

I am assuming this is a Mac-only problem for now, although some variations may 
occur on other systems.

Original issue reported on code.google.com by ramosian.glider@gmail.com on 13 Feb 2012 at 11:41

GoogleCodeExporter commented 9 years ago
Fixed in r150391

Original comment by ramosian.glider@gmail.com on 13 Feb 2012 at 3:32