Rollup merge of #104647 - RalfJung:alloc-strict-provenance, r=thomcc
enable fuzzy_provenance_casts lint in liballoc and libstd r? ````@thomcc````
This commit is contained in:
commit
316bda89e4
8 changed files with 19 additions and 10 deletions
|
@ -220,6 +220,7 @@
|
|||
#![allow(explicit_outlives_requirements)]
|
||||
#![allow(unused_lifetimes)]
|
||||
#![deny(rustc::existing_doc_keyword)]
|
||||
#![deny(fuzzy_provenance_casts)]
|
||||
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
|
||||
#![deny(ffi_unwind_calls)]
|
||||
// std may use features in a platform-specific way
|
||||
|
@ -598,7 +599,7 @@ mod panicking;
|
|||
mod personality;
|
||||
|
||||
#[path = "../../backtrace/src/lib.rs"]
|
||||
#[allow(dead_code, unused_attributes)]
|
||||
#[allow(dead_code, unused_attributes, fuzzy_provenance_casts)]
|
||||
mod backtrace_rs;
|
||||
|
||||
// Re-export macros defined in libcore.
|
||||
|
|
|
@ -90,6 +90,7 @@ impl OwnedSocket {
|
|||
}
|
||||
|
||||
// FIXME(strict_provenance_magic): we defined RawSocket to be a u64 ;-;
|
||||
#[allow(fuzzy_provenance_casts)]
|
||||
#[cfg(not(target_vendor = "uwp"))]
|
||||
pub(crate) fn set_no_inherit(&self) -> io::Result<()> {
|
||||
cvt(unsafe {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
use super::DwarfReader;
|
||||
use core::mem;
|
||||
use core::ptr;
|
||||
|
||||
pub const DW_EH_PE_omit: u8 = 0xFF;
|
||||
pub const DW_EH_PE_absptr: u8 = 0x00;
|
||||
|
@ -151,7 +152,7 @@ unsafe fn read_encoded_pointer(
|
|||
|
||||
// DW_EH_PE_aligned implies it's an absolute pointer value
|
||||
if encoding == DW_EH_PE_aligned {
|
||||
reader.ptr = round_up(reader.ptr as usize, mem::size_of::<usize>())? as *const u8;
|
||||
reader.ptr = reader.ptr.with_addr(round_up(reader.ptr.addr(), mem::size_of::<usize>())?);
|
||||
return Ok(reader.read::<usize>());
|
||||
}
|
||||
|
||||
|
@ -171,7 +172,7 @@ unsafe fn read_encoded_pointer(
|
|||
result += match encoding & 0x70 {
|
||||
DW_EH_PE_absptr => 0,
|
||||
// relative to address of the encoded value, despite the name
|
||||
DW_EH_PE_pcrel => reader.ptr as usize,
|
||||
DW_EH_PE_pcrel => reader.ptr.expose_addr(),
|
||||
DW_EH_PE_funcrel => {
|
||||
if context.func_start == 0 {
|
||||
return Err(());
|
||||
|
@ -184,7 +185,7 @@ unsafe fn read_encoded_pointer(
|
|||
};
|
||||
|
||||
if encoding & DW_EH_PE_indirect != 0 {
|
||||
result = *(result as *const usize);
|
||||
result = *ptr::from_exposed_addr::<usize>(result);
|
||||
}
|
||||
|
||||
Ok(result)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
//! This module contains the facade (aka platform-specific) implementations of
|
||||
//! OS level functionality for Fortanix SGX.
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![allow(fuzzy_provenance_casts)] // FIXME: this entire module systematically confuses pointers and integers
|
||||
|
||||
use crate::io::ErrorKind;
|
||||
use crate::sync::atomic::{AtomicBool, Ordering};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue