Re: [PATCH] crypto: api - Fix built-in testing dependency failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 13, 2021 at 11:16:03AM -0700, Eric Biggers wrote:
>
> Are there any specific examples that you could give?

The one that triggered this was ecdh-nist-p256-generic, which
calls into drbg.  Both ecdh and drbg are at level subsys_initcall
so the order between them is random.

Beyond this, obviously we have already moved many algorithms
ot subsys_initcall precisely for this purpose and with this
patch, they can all be moved back to module_init.
 
> 'tested' is set before the algorithm has actually been tested, and it sounds
> like the same as CRYPTO_ALG_TESTED which already exists.  Maybe it should be
> called something else, like 'test_started'?

Sure, I can rename that.
 
> Is there a way to continue iterating from the previous algorithm, so that this
> doesn't take quadratic time?

It's certainly possible to optimise this, but I'm not inclined
to do it unless someone can show me that it's a real issue :)

The simplest way to optimise this would be to create a separate
list for the test larvae.

> A comment explaining why the tests aren't run until late_initcall would be
> helpful.  People shouldn't have to dig through commit messages to understand the
> code.

Sure.

> Also, did you check whether there is anything that relies on the crypto API
> being available before or during late_initcall?  That wouldn't work with this
> new approach, right?

The patch is supposed to deal with that scenario by starting the
test on-demand should someone request for it before late_initcall.

Cheers,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux