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
Rust requires that all values have to be valid when assigned to or read from a place, passed to a function/primitive operation or returned from a function/primitive operation. It is UB to produce an invalid bit-pattern of a given type. We do not currently have any checks for this in Kani.
Likelihood:
If code contains this bug, Kani will not detect it. We do not have any data as to how often this occurs in practice.
Mitigation:
Warn users that this class of UB is outside the current scope of Kani.
Path to soundness:
Add a check for this.
Documentation:
The text was updated successfully, but these errors were encountered:
I believe this is addressed by #3085 where we either add validity checks or we ICE. This feature is still unstable and its stabilization will be tracked in #2998
This is still incomplete, but hopefully it can be merged as an unstable
feature. I'll publish an RFC shortly.
This instruments the function body with assertion checks to see if users
are generating invalid values. This covers:
- Union access
- Raw pointer dereference
- Transmute value
- Field assignment of struct with invalid values
- Aggregate assignment
Things not covered today should trigger ICE or a delayed verification
failure due to unsupported feature.
## Design
This change has two main design changes which are inside the new
`kani_compiler::kani_middle::transform` module:
1- Instance body should now be retrieved from the `BodyTransformation`
structure. This structure will run transformation passes on instance
bodies (i.e.: monomorphic instances) and cache the result.
2- Create a new transformation pass that instruments the body of a
function for every potential invalid value generation.
3- Create a body builder which contains all elements of a function body
and mutable functions to modify them accordingly.
Related to #2998Fixes#301
---------
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Rust requires that all values have to be valid when assigned to or read from a place, passed to a function/primitive operation or returned from a function/primitive operation. It is UB to produce an invalid bit-pattern of a given type. We do not currently have any checks for this in Kani.
Likelihood:
If code contains this bug, Kani will not detect it. We do not have any data as to how often this occurs in practice.
Mitigation:
Warn users that this class of UB is outside the current scope of Kani.
Path to soundness:
Add a check for this.
Documentation:
The text was updated successfully, but these errors were encountered: