]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett
authorbors <bors@rust-lang.org>
Wed, 3 Mar 2021 05:45:50 +0000 (05:45 +0000)
committerbors <bors@rust-lang.org>
Wed, 3 Mar 2021 05:45:50 +0000 (05:45 +0000)
Add is_enclave_range/is_user_range overflow checks

Fixes #76343.

This adds overflow checking to `is_enclave_range` and `is_user_range` in `sgx::os::fortanix_sgx::mem` in order to mitigate possible security issues with enclave code. It also accounts for an edge case where the memory range provided ends exactly at the end of the address space, where calculating `p + len` would overflow back to zero despite the range potentially being valid.

1  2 
library/std/src/sys/sgx/abi/mem.rs

Simple merge