]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #101442 - joboet:null_check_tcs, r=thomcc
authorbors <bors@rust-lang.org>
Sun, 11 Sep 2022 22:19:24 +0000 (22:19 +0000)
committerbors <bors@rust-lang.org>
Sun, 11 Sep 2022 22:19:24 +0000 (22:19 +0000)
commit98e1f041b6e33598a18edb928ec9db93a850c6cb
treee75bb7a5a5a60cc124da5fd38839fd366af20ccc
parent59e7a308e40fbc6b0901c9a8ee8ed51b17f9e772
parent2fa58080cbcdb42bda0438e2d37bdd8a4436a6f4
Auto merge of #101442 - joboet:null_check_tcs, r=thomcc

Check if TCS is a null pointer on SGX

The `EENTER` instruction only checks if the TCS is aligned, not if it zero. Saying the address returned is a `NonNull<u8>` (for which `Tcs` is a type alias) is unsound. As well-behaved runners will not put the TCS at address zero, so the definition of `Tcs` is correct. However, `std` should check the address before casting it to a `NonNull`.

ping `@jethrogb` `@raoulstrackx`
`@rustbot` label I-unsound