-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined behaviour in ctr32_encrypt_blocks #2162
Comments
Could you provide a reference for this rule, other than Miri? |
I guess the line However, IDK that it makes sense for |
I'll need to check whether |
PR #2164 addresses this. |
Tree Borrows also considers this a UB. As for the reasoning behind this, we had better consult people working on those aliasing models. They might also be interested in seeing more cases to help refine the models. Correction: Tree Borrows considers this to be okay as long as |
Hi! It looks like this code in
ctr32_encrypt_blocks
has undefined behaviours.ring/src/aead/aes/ffi.rs
Lines 174 to 202 in befdc87
I reproduced the same logic with the FFI replaced with unsafe Rust and MIRI reports undefined behaviours: https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=2b08f1fac9a144fee06c956f14ff598e
The issue is that
in_out
is borrowed twice, first as&in_out
and then as&mut in_out
(throughin_out.as_mut_ptr()
). The latter invalidates anything derived from the former, includinginput
.The text was updated successfully, but these errors were encountered: