Closed
Description
Even though the user can now rebuild both core
and std
with CFI enabled (see #90546) using Cargo build-std feature (which is recommended), both have explicit CFI violations that prevent the compiled program from functioning with CFI enabled.
So far, I've identified three CFI violations:
std::sys::unix:thread_local_dtor::register_dtor
weakly links__cxa_thread_atexit_impl
and and the Rust compiler currently omits weakly function definitions and its metadata from LLVM IR.core::fmt::rt::Argument
transmutingformatter
innew
and indirectly branching to/calling it infmt
.- Rust's "try catch" construct (i.e.,
std::panicking::r#try
) use ofFnOnce
explicitly violating CFI . std::sys::unix::weak::syscall
macro weakly links functions and the Rust compiler currently omits weakly function definitions and its metadata from LLVM IR.
I'm not sure if those are all CFI violations, but all core and std tests pass after disabling CFI in those locations with the no_sanitize
attribute.
Metadata
Metadata
Assignees
Labels
Area: Control Flow Integrity (CFI) security mitigationArea: Sanitizers for correctness and code qualityCategory: An issue proposing an enhancement or a PR with one.Project group: Exploit mitigationsRelevant to the library team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.