Skip to content
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

Make ValueDrain eagerly collect its extra values #362

Merged
merged 1 commit into from Nov 26, 2019

Conversation

seanmonstar
Copy link
Member

As noted in #355, the ValueDrain iterator has un-synchronized mutation of the extra_values Vec, and using a Drain, a user can get multiple ValueDrains at the same time and use them in scoped threads.

This changes the ValueDrain internals to eagerly drain the extra values when created, instead of lazily, so that calling next is no longer mutating a shared vector internally.

Closes #355

Copy link
Collaborator

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@seanmonstar seanmonstar merged commit 8ffe094 into master Nov 26, 2019
@seanmonstar seanmonstar deleted the drain-valuedrain-eagerly branch November 26, 2019 18:03
roy-work added a commit to roy-work/advisory-db that referenced this pull request Jan 9, 2020
…0.1.20

I believe these two vulnerabilities were patched at 0.1.20.

For RUSTSEC-2019-0033:

The advisory links to the bug: hyperium/http#352
In that bug, the fixing PR was hyperium/http#360
That PR merged the commit 81ceb61 to fix the bug; that commit, according to
GitHub, was first picked up by tag v0.1.20 ([commit][1]).

[1]: hyperium/http@81ceb61

For RUSTSEC-2019-0034:

This advisory is two separate GitHub issues against `HeaderMap::drain`,
http rustsec#354 and http rustsec#355.

For the first: the issue: hyperium/http#354
In that bug, the fixing PR was hyperium/http#357
That PR merged the commit 82d53db to fix the bug; that commit, according to
GitHub, was first picked up by tag v0.1.20 ([commit][2]).

[2]: hyperium/http@82d53db

For the second: the issue: hyperium/http#355
In that bug, the fixing PR was hyperium/http#362
That PR merged the commit 8ffe094 to fix the bug; that commit, according to
GitHub, was first picked up by tag v0.1.20 ([commit][3]).

[3]: hyperium/http@8ffe094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HeaderMap::Drain can cause data race
2 participants