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

crypto/internal/fips140/drbg: remove global lock #71155

Open
rsc opened this issue Jan 7, 2025 · 1 comment
Open

crypto/internal/fips140/drbg: remove global lock #71155

rsc opened this issue Jan 7, 2025 · 1 comment
Labels
BugReport Issues describing a possible bug in the Go implementation. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jan 7, 2025

There is still a global lock in the drbg package, so that crypto/rand.Read during fips mode will have significantly more contention than without. Worse, the code is inside the fips140 boundary, meaning it will take years for any change made after the release to be recertified and propagate out into actual (fips140) usage.

I believe we should change the drbg state to be per-P, before the release. This only affects the fips140 code path, not ordinary programs running in the default (non-fips140) mode, so it should be fairly low risk.

I will look into doing this.

/cc @FiloSottile

@rsc rsc added this to the Go1.24 milestone Jan 7, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/641097 mentions this issue: crypto/internal/fips140/drbg: avoid global lock on rand state

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Jan 7, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants