From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AB982A1B2 for ; Wed, 15 Jul 2026 10:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784110745; cv=none; b=rlbhq8NlYr5sBg17FfzHAipXbeQKwaj+Ck2oDRaSftQITSmgj0cdBco4qZJEGxVyCMf4/rbB8ap7A1Vokm2LpJWl2ycvJ82+ZEPeffUKOokPsmih0jDUadm71w+L1bazWHeKnNjZTIvDfd3NCwJUKrsTOuuCU9jbrgBuaLGKxOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784110745; c=relaxed/simple; bh=45VDqMdeouAblNk1t//6odC1d5sUvbBgmzAYESOVSJI=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=WUptdxKQ+ImffZF7DlnnRtsnP6QfhFTCj3iiXZkgHsdzsebgwAPw/2FicXV2efulVUUq+RR37X2JY76bL6lv0SuXasz0t7fHQP5XB6+qFFKndEcv//Mv3PfBhi4JRPuPCpIzzmCoNRlCGOiPtJD2ctorN2gOBSeFbz8tv9jMkNg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=P81YGarM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="P81YGarM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A84C31F000E9; Wed, 15 Jul 2026 10:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784110744; bh=WEiYwtcxEFBtyW0rILN3HyHPKNcf3UP7N6owE0TNJHU=; h=Subject:To:Cc:From:Date; b=P81YGarM7gijnvCfsvytTKwIx0no3F1JqztKhTq26WZls88waYII9sll4QQbv0Goc JL434ZLB9chTeDpdMEq2zQDSoxe+WG4pkyuHlYM76Lu36dpODtDiqjfZsGEJVEl2Y6 Dj/ox1neZ82oAlJ6HUdb0qZGztFH2PxWb1/Oh2G4= Subject: FAILED: patch "[PATCH] crypto: drbg - Fix ineffective sanity check" failed to apply to 6.12-stable tree To: ebiggers@kernel.org,herbert@gondor.apana.org.au Cc: From: Date: Wed, 15 Jul 2026 12:18:33 +0200 Message-ID: <2026071532-mutual-applause-01cd@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 040ad83b0e8aa065fd2fc641cacba8491a8b186d # git commit -s git send-email --to '' --in-reply-to '2026071532-mutual-applause-01cd@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 040ad83b0e8aa065fd2fc641cacba8491a8b186d Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 19 Apr 2026 23:33:47 -0700 Subject: [PATCH] crypto: drbg - Fix ineffective sanity check Fix drbg_healthcheck_sanity() to correctly check the return value of drbg_generate(). drbg_generate() returns 0 on success, or a negative errno value on failure. drbg_healthcheck_sanity() incorrectly assumed that it returned a positive value on success. This didn't make the sanity check fail, but it made it ineffective. Fixes: cde001e4c3c3 ("crypto: rng - RNGs must return 0 in success case") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu diff --git a/crypto/drbg.c b/crypto/drbg.c index de4c69032155..f23b431bd490 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1737,7 +1737,6 @@ static int drbg_kcapi_seed(struct crypto_rng *tfm, */ static inline int __init drbg_healthcheck_sanity(void) { - int len = 0; #define OUTBUFLEN 16 unsigned char buf[OUTBUFLEN]; struct drbg_state *drbg = NULL; @@ -1782,11 +1781,11 @@ static inline int __init drbg_healthcheck_sanity(void) max_request_bytes = drbg_max_request_bytes(drbg); drbg_string_fill(&addtl, buf, max_addtllen + 1); /* overflow addtllen with additional info string */ - len = drbg_generate(drbg, buf, OUTBUFLEN, &addtl); - BUG_ON(0 < len); + ret = drbg_generate(drbg, buf, OUTBUFLEN, &addtl); + BUG_ON(ret == 0); /* overflow max_bits */ - len = drbg_generate(drbg, buf, (max_request_bytes + 1), NULL); - BUG_ON(0 < len); + ret = drbg_generate(drbg, buf, max_request_bytes + 1, NULL); + BUG_ON(ret == 0); /* overflow max addtllen with personalization string */ ret = drbg_seed(drbg, &addtl, false);