-
Notifications
You must be signed in to change notification settings - Fork 99
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
Tcs
should not be a NonNull
pointer
#407
Comments
Not sure I agree? It's always possible to place things at address zero, but we generally adhere to the convention to not do that so that we can use null as a niche or sentinel value. |
Ok. Then this is simply a bug in |
Not sure if it's necessary to do the check in std either, we can just define that TCSes are never placed at address 0? |
No, since |
See discussion at rust-lang/rust#98391 (comment) |
TCSs may be located at logical address zero. Defining
Tcs
to beNonNull
leads to bugs and even soundness issues that may be exposed to attackers. For instance, the internalabi::thread::current()
function in the Rust standard library does not check for zero pointers and unconditionally returns aNonNull
. If the TCS address is null, this leads to immediate undefined behaviour.The text was updated successfully, but these errors were encountered: