-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Unsound implementation created misaligned pointer #1526
Comments
Great find, thanks! Can you please take a look at #1530 if this would be an okay fix? |
@domenukk thanks for the response. I just saw the code and considered it should be fixed! |
Another question: LibAFL/libafl_bolts/src/staterestore.rs Lines 215 to 220 in 0e149af
The safety of this function depends on the usage of internal library. The comments mentioned that "Beginning of the page will always be aligned": Is that guaranteed because the start address is 0x0 and could be multiple of any alignments? |
For all shmem implementations I know the start of the page will be aligned, but I'll happily replace this with a read_unaligned |
Ah no, it's not that easy |
I think it's fine if the address is 0x0. |
I'll add a debug_assert |
I have another issue about |
Yes please open another issue :) |
Would you mind help me report it to RUSTSEC so that we could remind users to update to the latest version? |
Yes 👍 |
@tokatoka I just send the PR to the advisory-db (please see the link: rustsec/advisory-db@03f3cea). What I can do now is that update the information of patched version. Is it patched and release in a new version, and which version? |
no there's no new version released yet |
Maybe we should do a release then, cc @andreafioraldi |
Hi @domenukk , do you agree to create a security policy under the repo? Then I can send the advisory that all users can check the dependencies on Github. |
Hi @shinmao , thanks for the report! |
@andreafioraldi thanks for the response. |
Not yet, but if they want to email users with things like dependabot i will not let them proceed, this is not a security vulnerability and users must not receive ambiguos alerts on their mailboxes. |
Understood. It is just something like undefined behavior from the perspective of Rust's language model. |
The source of unsoundness
Hi, we found that
<observers::map::HitcountsMapObserver<M> as observers::Observer<S>>::post_exec
could create a misaligned pointer:LibAFL/libafl/src/observers/map.rs
Line 1246 in 3625e88
At this line, the
u8
raw pointer was cast tou16
pointer and passed to core::slice::from_raw_parts_mut which requires the pointer to be aligned. Otherwise, it could lead to undefined behavior.The text was updated successfully, but these errors were encountered: