-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
GH-130397: use __stack_high and __stack_low LLVM WASM attributes #131855
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
FFY00
commented
Mar 28, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Implement stack overflow protection for webassembly #130397
Signed-off-by: Filipe Laíns <[email protected]>
This same approach would also work on emscripten but instead I think we're going the route of making |
@@ -429,6 +429,10 @@ int pthread_attr_destroy(pthread_attr_t *a) | |||
|
|||
#endif | |||
|
|||
#if defined(__wasi__) & _Py__has_attribute(weak) | |||
extern __attribute__((weak)) unsigned char __stack_high; |
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.
This should be size_t
, not char
right?
CI suggests this isn't enough to fix the issue. Do we need to manually set the stack size, roll back the stack checking changes that are causing the issue, or something else? |
I was just looking into this today and I think a big part of the problem is that Not only does it get nowhere close to exhausting the 5mb of shadow stack, the shadow stack pointer only seems to move up/down by about ~4000. I am not sure if you'll get the same results on WASI, but if this is true and not just some measurement artifact, the whole approach to stack checks might not be workable at all.
|