This is an archive of the discontinued LLVM Phabricator instance.

Support re-exec of sanitized executable with preloading libasan on Linux
AbandonedPublic

Authored by m.guseva on Oct 23 2014, 2:18 AM.

Details

Summary

Currently if we want to run sanitized shared library in unsanitized executable we have to run executable with LD_PRELOAD=libasan.so which may be inconvenient for users (have to modify startup scripts, etc.). The patch implements reexecuting of the program with modified LD_PRELOAD environment variable on Linux. The same functionality is already supported for Mac Asan.
The corresponding issue link: https://code.google.com/p/address-sanitizer/issues/detail?id=330

Diff Detail

Event Timeline

m.guseva updated this revision to Diff 15308.Oct 23 2014, 2:18 AM
m.guseva retitled this revision from to Support re-exec of sanitized executable with preloading libasan on Linux.
m.guseva updated this object.
m.guseva edited the test plan for this revision. (Show Details)
m.guseva added reviewers: glider, kcc, samsonov.
m.guseva added subscribers: Unknown Object (MLST), ygribov.
kcc edited edge metadata.Oct 27 2014, 11:32 AM

OMG, this is very complex and fragile. Can we find another solution?
I'd like to see more discussion at https://code.google.com/p/address-sanitizer/issues/detail?id=330& before looking at the patch in more detail.

OMG, this is very complex and fragile.

The main complexity comes from save-restore the environment which is in turn necessary so that the reexecuted program does not notice that we've changed LD_PRELOAD/ASAN_OPTIONS.

Kostya, what kind of discussion do you expect in the issue tracker in particular? Do you want us to describe feature design or something?

m.guseva abandoned this revision.Aug 7 2015, 7:30 AM