[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260107130736.22775042@canb.auug.org.au>
Date: Wed, 7 Jan 2026 13:07:36 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Peter Zijlstra <peterz@...radead.org>,
Herbert Xu <herbert@...dor.apana.org.au>
Cc: Linux Crypto List <linux-crypto@...r.kernel.org>, Linux Kernel Mailing
List <linux-kernel@...r.kernel.org>, Linux Next Mailing List
<linux-next@...r.kernel.org>, Marco Elver <elver@...gle.com>, Sergey
Shtylyov <s.shtylyov@....ru>
Subject: linux-next: manual merge of the tip tree with the crypto tree
Hi all,
Today's linux-next merge of the tip tree got a conflict in:
crypto/drbg.c
between commits:
6acd394367ab ("crypto: drbg - make drbg_fips_continuous_test() return bool")
c904e459cf73 ("crypto: drbg - make drbg_get_random_bytes() return *void*")
from the crypto tree and commit:
dc36d55d4e72 ("crypto: Enable context analysis")
from the tip tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc crypto/drbg.c
index 9a2af599ead1,0a6f6c05a78f..000000000000
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@@ -226,16 -226,19 +226,17 @@@ static inline unsigned short drbg_sec_s
* @entropy buffer of seed data to be checked
*
* return:
- * 0 on success
- * -EAGAIN on when the CTRNG is not yet primed
- * < 0 on error
+ * %true on success
+ * %false when the CTRNG is not yet primed
*/
-static int drbg_fips_continuous_test(struct drbg_state *drbg,
- const unsigned char *entropy)
+static bool drbg_fips_continuous_test(struct drbg_state *drbg,
+ const unsigned char *entropy)
+ __must_hold(&drbg->drbg_mutex)
{
unsigned short entropylen = drbg_sec_strength(drbg->core->flags);
- int ret = 0;
if (!IS_ENABLED(CONFIG_CRYPTO_FIPS))
- return 0;
+ return true;
/* skip test if we test the overall system */
if (list_empty(&drbg->test_data.list))
@@@ -842,13 -846,21 +843,14 @@@ static inline int __drbg_seed(struct dr
return ret;
}
-static inline int drbg_get_random_bytes(struct drbg_state *drbg,
- unsigned char *entropy,
- unsigned int entropylen)
+static inline void drbg_get_random_bytes(struct drbg_state *drbg,
+ unsigned char *entropy,
+ unsigned int entropylen)
+ __must_hold(&drbg->drbg_mutex)
{
- int ret;
-
- do {
+ do
get_random_bytes(entropy, entropylen);
- ret = drbg_fips_continuous_test(drbg, entropy);
- if (ret && ret != -EAGAIN)
- return ret;
- } while (ret);
-
- return 0;
+ while (!drbg_fips_continuous_test(drbg, entropy));
}
static int drbg_seed_from_random(struct drbg_state *drbg)
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists