From 3c9996efe053f6101ab930b4eab522651c472581 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 15 Jun 2026 11:44:04 -0500 Subject: [PATCH] fix F-5958: wc_linuxkm_drbg_generate returns untranslated wolfCrypt RNG_FAILURE_E on the slen>0 reseed-failure path --- linuxkm/lkcapi_sha_glue.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/linuxkm/lkcapi_sha_glue.c b/linuxkm/lkcapi_sha_glue.c index a23598927d..55268918cd 100644 --- a/linuxkm/lkcapi_sha_glue.c +++ b/linuxkm/lkcapi_sha_glue.c @@ -1230,10 +1230,16 @@ static int wc_linuxkm_drbg_generate(struct wc_rng_bank *ctx, if (ret == 0) continue; - if (unlikely(ret == WC_NO_ERR_TRACE(RNG_FAILURE_E)) && (! retried)) { - if (slen > 0) + if (unlikely(ret == WC_NO_ERR_TRACE(RNG_FAILURE_E))) { + if (slen > 0) { + ret = -EINVAL; break; + } + if (retried) { + ret = -EINVAL; + break; + } retried = 1; ret = wc_rng_bank_inst_reinit(ctx,