-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[asan] Re-exec without ASLR if needed on 32-bit Linux #131975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,13 @@ void InitializeShadowMemory() { | |
ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1); | ||
ProtectGap(kShadowGap3Beg, kShadowGap3End - kShadowGap3Beg + 1); | ||
} else { | ||
// The shadow mappings can shadow the entire user address space. However, | ||
// on 32-bit systems, the maximum ASLR entropy (currently up to 16-bits | ||
// == 256MB) is a significant chunk of the address space; reclaiming it by | ||
// disabling ASLR might allow chonky binaries to run. | ||
if (sizeof(uptr) == 32) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct? From what I can see, uptr is an alias of uintptr_t, meaning sizeof is 4 on 32bit systems and this branch is never taken on any platform. (Yes, I'm late.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...oh, #132682 deleted that check. This question no longer matters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're right, that was a bug. Nice catch :-) |
||
TryReExecWithoutASLR(); | ||
|
||
Report( | ||
"Shadow memory range interleaves with an existing memory mapping. " | ||
"ASan cannot proceed correctly. ABORTING.\n"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done