UPSTREAM: <carry>: Rate-limit concurrent DRBG inits at request entry …#2711
UPSTREAM: <carry>: Rate-limit concurrent DRBG inits at request entry …#2711sdodson wants to merge 1 commit into
Conversation
sdodson
commented
Jul 1, 2026
…point In FIPS/CGo mode, the first crypto/rand call on a new OS thread triggers per-thread DRBG initialization via OpenSSL. Go creates a new OS thread for each concurrent CGo call, so a kubelet watch reconnect storm after apiserver restart can simultaneously trigger thousands of DRBG inits, exhausting the 10k OS thread limit. Add a 64-slot semaphore at APIServerHandler.ServeHTTP that gates each request's initial crypto/rand read. This caps concurrent DRBG inits to 64, staggering thread creation over time rather than allowing an instantaneous burst. Note: a nil or zero-length read does not trigger DRBG init in OpenSSL; at least one byte must be read to force initialization. This approach covers all crypto/rand callers in the request path rather than individual call sites, and is complementary to the WithAuditInit fix (042a4ae). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@sdodson: the contents of this pull request could not be automatically validated. The following commits could not be validated and must be approved by a top-level approver:
Comment |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sdodson The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |