-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Exclude non-user portions of the main thread stack from stack scanning on 32 bits. #46034
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
base: main
Are you sure you want to change the base?
Conversation
EWS run on previous version of this PR (hash 3f2163b) |
3f2163b
to
507ad76
Compare
EWS run on previous version of this PR (hash 507ad76) |
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.
Let's make this optionally: if this is not called, use environ. And when this is called and if this narrows down the stack further, do it with this.
507ad76
to
5fbc49d
Compare
EWS run on previous version of this PR (hash 5fbc49d) |
5fbc49d
to
da4a741
Compare
EWS run on previous version of this PR (hash da4a741) |
…g on 32 bits. https://bugs.webkit.org/show_bug.cgi?id=293720 Reviewed by NOBODY (OOPS!). On 32-bit armv7/linux we run into an issue where the environment strings located at the bottom of the stack, as well as some random bits inside the libc portion of the stack are interpreted as cells pointing into the heap, keeping actually dead objects alive. Yusuke previously attempted to fix this by excluding environ and before, but there are additional fake roots only a few hundred bytes below that. This patch excludes the caller of main entirely. * Source/JavaScriptCore/jsc.cpp: (jscmain): * Source/WTF/wtf/StackBounds.cpp: (WTF::StackBounds::setBottomOfMainThreadMain): (WTF::StackBounds::currentThreadStackBoundsInternal): * Source/WTF/wtf/StackBounds.h: * Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp: * Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp:
da4a741
to
e63393f
Compare
EWS run on current version of this PR (hash e63393f) |
bool currentThreadIsHoldingAPILock() const { return m_apiLock->currentThreadIsHoldingLock(); } | ||
bool currentThreadIsHoldingAPILock() const | ||
{ | ||
#if ASSERT_ENABLED || OS(LINUX) |
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 have extended this to release builds to ensure this doesn't cause new UAFs
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.
But only on non-Apple platforms
3f2163b
e63393f