rust/library/std/src/sys
Yuki Okushi ea1a0d76af
Rollup merge of #111139 - fortanix:raoul/fix_mxcsr_configuration_dependent_timing, r=thomcc
Fix MXCSR configuration dependent timing

Dependent on the (potentially secret) data some vector instructions operate on, and the content in MXCSR, instruction retirement may be delayed by one cycle. This is a potential side channel.

This PR fixes this vulnerability for the `x86_64-fortanix-unknown-sgx` platform by loading MXCSR with `0x1fbf` through an `xrstor` instruction when the enclave is entered and executing an `lfence` immediately after. Other changes of the MXCSR happen only when the enclave is about to be exited and no vector instructions will be executed before it will actually do so. Users of EDP who change the MXCSR and do wish to defend against this side channel, will need to implement the software mitigation described [here](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/mxcsr-configuration-dependent-timing.html).

cc: `@jethrogb` `@monokles`
2023-05-06 09:09:32 +09:00
..
common Rollup merge of #110946 - RalfJung:tls-realstd, r=m-ou-se 2023-05-05 12:46:25 +09:00
hermit Rollup merge of #103056 - beetrees:timespec-bug-fix, r=thomcc 2023-05-05 18:40:32 +05:30
itron Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00
sgx Fix MXCSR configuration dependent timing 2023-05-03 17:11:15 +02:00
solid Rollup merge of #103056 - beetrees:timespec-bug-fix, r=thomcc 2023-05-05 18:40:32 +05:30
unix Rollup merge of #110830 - Freaky:freebsd-cpuset, r=thomcc 2023-05-06 09:09:32 +09:00
unsupported Rollup merge of #105695 - joboet:remove_generic_parker, r=m-ou-se 2023-05-03 16:42:48 -07:00
wasi Rollup merge of #105695 - joboet:remove_generic_parker, r=m-ou-se 2023-05-03 16:42:48 -07:00
wasm std: replace generic thread parker with explicit no-op parker 2023-02-16 15:06:45 +01:00
windows Use from_wide_to_user_path in read_link 2023-05-03 11:31:41 +01:00
mod.rs review 2023-03-17 21:00:10 -07:00