Comments (9)
Does this mean that on 10.7 the only two choices are --no_pie and fork+exec?
Original comment by [email protected]
on 18 Jan 2012 at 5:45
from address-sanitizer.
Exactly.
Original comment by [email protected]
on 19 Jan 2012 at 8:06
from address-sanitizer.
I completely forgot about another method suggested by Mark Mentovai that works
reliably on all OS X versions. One can unset the MH_PIE bit in an already
linked executable, using e.g. this script:
http://src.chromium.org/viewvc/chrome/trunk/src/build/mac/change_mach_o_flags.py
?view=markup
This method is less convenient to integrate with every build process. To do
that we'll need to make Clang run this script after every ld invocation, which
is in fact similar to adding the --no_pie flag.
Original comment by [email protected]
on 19 Jan 2012 at 8:32
from address-sanitizer.
I'm now considering the following roadmap:
1. Introduce the disable_aslr runtime flag that will tell ASan to do fork+exec.
Set disable_aslr=0 on Snow Leopard and disable_aslr=1 on Lion by default.
2. If MH_PIE bit is set and any of the current mappings is going to intersect
with the shadow, do the following:
-- if disable_aslr is 0, print a warning and die;
-- if disable_aslr is 1, fix ASLR by doing fork+exec
3. Make sure Clang doesn't set MH_PIE for executables built with
-faddress-sanitizer.
Step 1 is mainly needed to start running Chrome on Lion without additional GYP
hackery. We can also skip Step 2 and pass to Step 3 if we finally want to get
rid of disable_aslr.
Original comment by [email protected]
on 1 Feb 2012 at 10:57
- Added labels: OpSys-OSX
from address-sanitizer.
I've spent some time playing with ASLR on Lion and here are two conclusions:
-- doing posix_spawn with POSIX_SPAWN_SETEXEC and _POSIX_SPAWN_DISABLE_ASLR is equal to exec() without fork() and should disable ASLR as well;
-- I haven't managed to trigger any ASLR problems on Lion for the binaries built with -fpie. This is probably because ASLR is much smarter on Lion.
Attached is the patch that disables ASLR on Lion, but I'm not going to commit
it until I notice any problems with ASLR on Lion.
Original comment by [email protected]
on 1 Feb 2012 at 2:21
Attachments:
from address-sanitizer.
As Snow Leopard will be obsolete soon, the issue becomes less (if at all)
important.
The reliable workaround is to set DYLD_NO_PIE=1.
Original comment by [email protected]
on 29 Oct 2012 at 11:11
- Added labels: Priority-Low
- Removed labels: Priority-Medium
from address-sanitizer.
Do we still need to support 10.6?
Can we close this bug?
Original comment by [email protected]
on 18 Feb 2013 at 7:15
from address-sanitizer.
We still need to support 10.6 for some time, yet we don't want to fix ASLR on
10.6.
Will reopen if we ever have problems with newer OS X versions.
Original comment by [email protected]
on 18 Feb 2013 at 11:13
- Changed state: WontFix
from address-sanitizer.
Adding Project:AddressSanitizer as part of GitHub migration.
Original comment by [email protected]
on 30 Jul 2015 at 9:12
- Added labels: ProjectAddressSanitizer
from address-sanitizer.
Related Issues (20)
- ASan shared runtime library on Android re-exports the entire libgcc interface HOT 2
- sigsegv in basic block tracer HOT 3
- Compiling with AddressSanitizer using gcc ≥4.9 breaks printng some variables in gdb on Linux HOT 7
- AddressSanitizer: while reporting a bug found another one. Ignoring. HOT 3
- [android] system property access from native code is going away HOT 2
- Link libasan with -z interpose on Linux HOT 3
- ASan is unable to link TLS arrays HOT 3
- pointer not owned error when calling malloc_usable_size() on array of structs with destructors HOT 4
- Support Android in asan_symbolize HOT 3
- thread_stats.malloced_by_size[class_id] overflow in asan_allocator.cc HOT 4
- Crash on ODR between instrumented and non-instrumented libraries HOT 4
- LSan doesn't work with empty suppressions list HOT 6
- Improve wild-free detection HOT 1
- Please tell us where you are moving due to Google Code shutdown HOT 3
- -fsanitize=address should probably imply -Bsymbolic HOT 2
- Enable LSAN support for 32bit architecture HOT 3
- support relative paths in backlist files HOT 1
- chdir breaks symbolization of dynamic libraries
- leak is only reported about 1/2 of runs
- gcc-asan doesn't work on android/arm32 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from address-sanitizer.