This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][GCC 5][PR sanitizer/69147] Fix ASan failures on new Darwin platforms (OS X 10.11+, iOS 9.0+).


On Wed, Jan 13, 2016 at 12:08:25PM +0300, Maxim Ostapenko wrote:
> in OS X 10.11+ or iOS 9.0+, dyld will interpose even if
> DYLD_INSERT_LIBRARIES is not set. This means, that it's not safe to use
> "setenv" function to set DYLD_INSERT_LIBRARIES in MaybeReexec, because ASan
> interceptors already established and we can easily end up with something
> like this:
> 
> AsanInitInternal -> MaybeReexec -> setenv -> some intercepted function (say,
> memmove) -> BOOM.
> 
> In fact, there is no need to reexec at all on such platforms, because we
> already have working interceptors. Thus, for now we have completely broken
> ASan for OS X 10.11+ and iOS 9.0+ with GCC 5.
> 
> Upstream ASan already has a fix for the issue, as well as GCC 6, so the
> proper solution would be just cherry-picking corresponding commits (r224315
> and r241487) from upstream to gcc-5-branch.
> 
> Regtested and bootstrapped on x86_64-unknown-linux-gnu by myself and on
> x86_64-apple-darwin15.2.0 by Dominique
> (https://gcc.gnu.org/ml/gcc-testresults/2016-01/msg01115.html).
> 
> Ok for gcc-5-branch?

Ok, thanks.

> libsanitizer/ChangeLog:
> 
> 2016-01-13  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
> 
> 	* PR sanitizer/69147
> 	* asan/asan_mac.cc: Cherry pick upstream r241487.
> 	* sanitizer_common/sanitizer_mac.cc: Cherry pick upstream r224315.
> 	* sanitizer_common/sanitizer_mac.h: Likewise.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]