732461b4cd
add -Zmiri-strict-provenance This implements [strict provenance](https://github.com/rust-lang/rust/issues/95228) in Miri. The only change is that casting an integer to a pointer does not even attempt to produce a good provenance for the given address; instead, it always uses the invalid provenance. This stricter than even `-Zmiri-tag-raw-pointers` in that it also rejects the following example (which does not even involve Stacked Borrows): ```rust fn main() { let x = 22; let ptr = &x as *const _ as *const u8; let roundtrip = ptr as usize as *const u8; let _ = unsafe { roundtrip.offset(1) }; } ``` The new flag also implies `-Zmiri-tag-raw-pointers` since the only reason one would *not* want to tag raw pointers is to support ptr-int-ptr roundtrips. Note that the flag does *not* check against ptr-to-int *transmutes*; that still requires `-Zmiri-check-number-validity`. You can also check for strict provenance *without* Stacked Borrows by adding `-Zmiri-disable-stacked-borrows`. The new "Miri hard mode" flags for maximal checking are `-Zmiri-strict-provenance -Zmiri-check-number-validity`. (Add `-Zmiri-symbolic-alignment-check` if you feel extra spicy today.) |
||
---|---|---|
.. | ||
alloc | ||
backtrace | ||
concurrency | ||
dangling_pointers | ||
data_race | ||
fs | ||
function_calls | ||
function_pointers | ||
intrinsics | ||
panic | ||
stacked_borrows | ||
sync | ||
unaligned_pointers | ||
validity | ||
abort-terminator.rs | ||
box-cell-alias.rs | ||
branchless-select-i128-pointer.rs | ||
breakpoint.rs | ||
environ-gets-deallocated.rs | ||
erroneous_const.rs | ||
extern_static.rs | ||
fast_math_both.rs | ||
fast_math_first.rs | ||
fast_math_second.rs | ||
generator-pinned-moved.rs | ||
invalid_bool.rs | ||
invalid_char.rs | ||
invalid_enum_tag.rs | ||
invalid_int.rs | ||
issue-miri-1112.rs | ||
memleak_rc.rs | ||
memleak.rs | ||
modifying_constants.rs | ||
never_say_never.rs | ||
never_transmute_humans.rs | ||
never_transmute_void.rs | ||
no_main.rs | ||
null_pointer_deref_zst.rs | ||
null_pointer_deref.rs | ||
null_pointer_write_zst.rs | ||
null_pointer_write.rs | ||
pointer_partial_overwrite.rs | ||
pointer_partial_read.rs | ||
ptr_integer_array_transmute.rs | ||
ptr_integer_transmute.rs | ||
rc_as_ptr.rs | ||
reading_half_a_pointer.rs | ||
rustc-error.rs | ||
shim_arg_size.rs | ||
static_memory_modification1.rs | ||
static_memory_modification2.rs | ||
static_memory_modification3.rs | ||
strict-provenance-offset.rs | ||
too-big-slice.rs | ||
too-big-unsized.rs | ||
transmute_fat1.rs | ||
transmute-pair-uninit.rs | ||
uninit_buffer.rs | ||
uninit_byte_read.rs | ||
uninit_float.rs | ||
uninit_integer_signed.rs | ||
uninit_integer.rs | ||
uninit_raw_ptr.rs | ||
unreachable.rs | ||
unsupported_foreign_function.rs | ||
unsupported_signal.rs | ||
zst1.rs | ||
zst2.rs | ||
zst3.rs |