Repository navigation
Use the core libctx when wolfProvider replaces the default provider to fix a deadlock on musl - #530
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded that would block approval.
No open issues 🎉
What changed in this PR
This PR addresses the musl deadlock when wolfProvider is activated as OpenSSL’s fallback default provider, while preserving child-context behavior in standard builds.
Changes:
- Borrow the core library context in replace-default builds to avoid recursive locking.
- Free only provider-owned child contexts during teardown, addressing the ownership concern described in #519.
- Add Alpine CI covering standard and replace-default builds, command-line tests, and no-config fallback activation.
| File | Description |
|---|---|
src/wp_wolfprov.c |
Selects the appropriate library context and frees only owned contexts. |
.github/workflows/README.md |
Documents the new musl test coverage. |
.github/workflows/musl.yml |
Adds Alpine build and regression tests against latest OpenSSL and 3.0.17. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #530
Scan targets checked: wolfprovider-src, wolfprovider-bugs
Not reviewed (no scan target covers them): .github/workflows/README.md, .github/workflows/musl.yml
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
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.
Review tier: Max
1d28980 to
ad453cf
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #530
Scan targets checked: wolfprovider-src, wolfprovider-bugs
Not reviewed (no scan target covers them): .github/workflows/README.md, .github/workflows/musl.yml, .github/workflows/nightly-osp.yml, .github/workflows/pr-osp-select.yml
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: include/wolfprovider/internal.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
provider_activate_fallbacks(). That function holds the provider store write lock while it calls the provider's init.OpenSSL's comment there assumes fallbacks are never third-party providers.
wolfssl_provider_init()callsOSSL_LIB_CTX_new_child(). Registering the child's callbacks with the parent takes thatsame store lock again.
EDEADLK, so the child libctx creation fails and the libctx stays NULL. musl blocks in futexforever.
libctx. For example,
OPENSSL_CONF=/dev/null openssl list -providershangs on OpenWrt 23.05 ARM32, and the build script'sown
openssl list -providerscheck hangs on Alpine.WOLFPROV_REPLACE_DEFAULTbuilds, init takesOSSL_FUNC_core_get_libctxand uses the core's libctx. This is whatOpenSSL's built-in default provider does (
providers/defltprov.c), and with replace-default wolfProvider is registered asthat built-in default. It takes no lock, and internal fetches go to the libctx the provider was started in.
the child we created. This overlaps provider: free the child libctx on teardown #519, whose unconditional free would release the core's libctx under replace-default.
musl.yml: an Alpine 3.20 container builds standard and replace-default against the latest OpenSSL and 3.0.17. Itruns the unit tests, the cmd tests normally and with
WOLFPROV_FORCE_FAIL=1, and a no-config load with a timeout. CurrentCI is glibc only, so it can't catch this.