You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make Kani reject mutable pointer casts if padding is incompatible and memory initialization is checked (rust-lang#3332)
This PR introduces layout checks for types to instrument mutable pointer
casts. If two types have incompatible padding (e.g. a padding byte in
one is a data byte in the other or vice-versa), an "unsupported check"
assertion is inserted. This overapproximates for soundness, since the
casts do not cause UB themselves, but an alternative solution involves
tracking every MIR place, which is costly.
Resolvesrust-lang#3324
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
// If casting from a mutable pointer to a mutable pointer with
565
+
// different layouts, delayed UB could occur.
566
+
self.push_target(MemoryInitOp::Unsupported{
567
+
reason:"Kani does not support reasoning about memory initialization in presence of mutable raw pointer casts that could cause delayed UB.".to_string(),
0 commit comments