-
Notifications
You must be signed in to change notification settings - Fork 391
smallvec: Buffer overflow in insert_many #552
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
Conversation
Thank you! |
|
|
In an empty test project with nothing but smallvec 1.4.2 in Cargo.lock, it works correctly:
|
Interesting! It doesn't appear to work for me. Could you post the output of |
|
Have you double-checked your |
I think this was caused by workspace handling in my tests. I have a weird configuration where a binary is both in and not in a workspace. When testing on a stand-alone "hello world" it works fine. I have a report from one other user, but they're using an experimental data extraction pipeline, which is probably the culprit. This leads me to conclude that this advisory is entirely correct, and I've just run into an unrelated usability issue. Thanks for confirming! |
The advisory link that Output of
|
I just regenerated the web site. It should work now. |
There was a vulnerability found in smallvec as described in: * servo/rust-smallvec#252 * rustsec/advisory-db#552 This patch update the package version to 1.6 which is deemed safe to use. Signed-off-by: Fintan Halpenny <[email protected]>
There was a vulnerability found in smallvec as described in: * servo/rust-smallvec#252 * rustsec/advisory-db#552 This patch update the package version to 1.6.1 which is deemed safe to use. Signed-off-by: Fintan Halpenny <[email protected]>
A bug in the
SmallVec::insert_many
method caused it to allocate a buffer that was smaller than needed. It then wrote past the end of the buffer, causing a buffer overflow and memory corruption on the heap.This bug was only triggered if the iterator passed to
insert_many
yielded more items than the lower bound returned from itssize_hint
method.The flaw was corrected in smallvec 0.6.14 and 1.6.1, by ensuring that additional space is always reserved for each item inserted. The fix also simplified the implementation of
insert_many
to use less unsafe code, so it is easier to verify its correctness.Thank you to Yechan Bae (@Qwaz) and the Rust group at Georgia Tech’s SSLab for finding and reporting this bug. See servo/rust-smallvec#252 for more details.