drbg: add thread-safe option, --disable-threadsafe-drbg to opt out - #11210
drbg: add thread-safe option, --disable-threadsafe-drbg to opt out#11210kaleb-himes wants to merge 12 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
3ac8f4b to
766eee3
Compare
766eee3 to
3474878
Compare
3474878 to
2386d14
Compare
2386d14 to
3a18eb4
Compare
3a18eb4 to
576e283
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
9e04a07 to
25448a5
Compare
dismiss to re-request
Dismiss to re-request.
…with opt-in fork handlers
…the library against dlclose
…se pin by linking it
…in only where Cygwin needs it
… and memory zero checking builds, and link dl only with the pin
…k where the RNG is small
…AND test its own includes
2f5aef4 to
e6e52e5
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11210
Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
| if (ret != 0) | ||
| return ret; | ||
| if (!rngAtForkSet) { | ||
| if (pthread_atfork(RngAtForkPrepare, RngAtForkParent, |
There was a problem hiding this comment.
Fork handlers registered before the dlclose pin, and pin failure is ignored · Use-after-free / double-free
wc_RngAtForkInit() registers the irrevocable pthread_atfork handlers before pinning, and wc_RngPinImage() returns void and only logs on failure (including the build where RTLD_NODELETE/RTLD_NOLOAD are absent). If the pin fails, a dlclosed libwolfssl leaves the handlers pointing into unmapped memory, which the next fork() executes.
Fix: Pin the image before calling pthread_atfork(), have wc_RngPinImage() return a status, and skip registration when the pin fails.
Description
Feature addition
Testing
Test case added in wolfcrypt/test/test.c
Checklist