Re: [PATCH v4 2/7] crypto: aead - disallow en/decrypt for non-task or non-softirq context

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

 



On Wed, May 19, 2021 at 01:22:34PM +0200, Ard Biesheuvel wrote:
>
>  	crypto_stats_get(alg);
> -	if (crypto_aead_get_flags(aead) & CRYPTO_TFM_NEED_KEY)
> +	if (!(alg->cra_flags & CRYPTO_ALG_ASYNC) &&
> +	    WARN_ONCE(!in_task() && !in_serving_softirq(),
> +		      "synchronous call from invalid context\n"))
> +		ret = -EBUSY;

I don't think we've ever supported crypto in hard IRQ contexts.
So this should be done regardless of ASYNC.

Then again, do we really need this since the assumption has
always been that the crypto API can only be invoked in user or
softirq context?

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