Fix mem-fail nightly crashes (jenkins-supervisor #501) - #11092
Open
sameehj wants to merge 1 commit into
Open
Conversation
The mem-fail Jenkins job fails allocation N via MEM_FAIL_CNT and treats segfault/abort as product findings. Several unit tests still touched NULL or uninitialised state after an Expect* failure, so the job went red even when the library returned a clean error. - test_wolfSSL_X509_VERIFY_PARAM (shard 2, fail at 2/3 and 3/3): Guard bare paramTo/paramFrom writes after X509_VERIFY_PARAM_new() returns NULL. - test_wc_Sakke_FeatureCoverage / DecisionCoverage (shards 0 and 3): Zero-init rng/key/key2 so FreeSakkeKey is not called on stack garbage when init fails. Make wc_FreeSakkeKey clear freed pointers so a second free after a failed init is safe. - test_wolfSSL_Tls13_ECH_wire_sni (shard 0, fail around 3147/6295): Do not dereference test_ctx.c_ctx when memio setup failed. Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11092
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes crashes found by the mem-fail Jenkins nightly
([open issue 501].
That job fails the Nth allocation via
MEM_FAIL_CNTand treats segfault(139) / abort (134) as product findings. In these cases the library often
returned a clean error (e.g. NULL from
XMALLOC), but the unit tests keptrunning bare statements after an
Expect*failure and touched NULL oruninitialised state.
test_wolfSSL_X509_VERIFY_PARAM(shard 2, fail at 2/3 and 3/3):After
X509_VERIFY_PARAM_new()returns NULL, guard bareparamTo/paramFromwrites (inherit_flags,XMEMSET, etc.).test_wc_Sakke_FeatureCoverage/test_wc_Sakke_DecisionCoverage(shards 0 and 3): Zero-init
rng/key/key2sowc_FreeSakkeKeyis not called on stack garbage when init fails. Also make
wc_FreeSakkeKeyclear freed pointers /mpInitso a second free aftera failed init path is a no-op.
test_wolfSSL_Tls13_ECH_wire_sni(shard 0, fail around 3147/6295):Do not dereference
test_ctx.c_ctxwhentest_ssl_memio_setupfailed.Fixes zd#
Testing
Built with the mem-fail configure line (
--enable-memorylog,WOLFSSL_MEM_FAIL_COUNT).MEM_FAIL_CNT): all four tests pass; alloc/free countsbalance.
test_wolfSSL_X509_VERIFY_PARAM:MEM_FAIL_CNT=1..3→ exit 1 (was139 at 2 and 3).
crash / abort; alloc/free balance OK.
test_wolfSSL_Tls13_ECH_wire_sni: all 484 previously crashing indices(locally 3166–4628) → exit 1; A/B at 3166: without fix 139, with fix 1.
Left for later (not mem-fail NULL-deref class): RPK baseline failures,
LMS Linux-only SIGILL at baseline.
Checklist