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

Protect passphrase MAC hasher with mutex #2067

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Conversation

jrick
Copy link
Member

@jrick jrick commented Jul 1, 2021

Using the hasher mutates its state, but it was being used by the
UnlockedWithPassphrase method with the manager's read mutex held.
This adds an additional mutex for protecting just the hasher.

This fixes a data race caused when concurrently unlocking the wallet
from several goroutines, and the invalid passphrase errors that were
caused by racing on the hasher.

Using the hasher mutates its state, but it was being used by the
UnlockedWithPassphrase method with the manager's read mutex held.
This adds an additional mutex for protecting just the hasher.

This fixes a data race caused when concurrently unlocking the wallet
from several goroutines, and the invalid passphrase errors that were
caused by racing on the hasher.
Copy link
Member

@alexlyp alexlyp left a comment

Choose a reason for hiding this comment

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

tACK

@jrick jrick merged commit 6c62324 into decred:master Jul 2, 2021
@jrick jrick deleted the hashermutex branch July 2, 2021 17:13
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.

2 participants