mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Qingfang Deng <dqfext@gmail.com>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Antoine Tenart <atenart@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Richard van Schagen <vschagen@icloud.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mieczyslaw Nalewaj <namiltd@yahoo.com>,
	Aleksander Jan Bajkowski <olek2@wp.pl>
Subject: Re: [PATCH] crypto: eip93: fix sleep inside atomic
Date: Fri, 30 Jan 2026 16:04:50 +0800	[thread overview]
Message-ID: <aXxmIuU9PKJiDs7n@gondor.apana.org.au> (raw)
In-Reply-To: <20260120025400.54294-1-dqfext@gmail.com>

On Tue, Jan 20, 2026 at 10:54:00AM +0800, Qingfang Deng wrote:
> A crypto request is allowed to sleep only if CRYPTO_TFM_REQ_MAY_SLEEP is
> set. Avoid GFP_KERNEL and usleep_range() if the flag is absent.
> 
> Fixes: 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support")
> Signed-off-by: Qingfang Deng <dqfext@gmail.com>
> ---
>  .../crypto/inside-secure/eip93/eip93-aead.c   |  2 +-
>  .../crypto/inside-secure/eip93/eip93-cipher.c |  2 +-
>  .../crypto/inside-secure/eip93/eip93-cipher.h |  3 +-
>  .../crypto/inside-secure/eip93/eip93-common.c | 36 ++++++++++++-------
>  .../crypto/inside-secure/eip93/eip93-hash.c   |  9 +++--
>  5 files changed, 35 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/crypto/inside-secure/eip93/eip93-aead.c b/drivers/crypto/inside-secure/eip93/eip93-aead.c
> index 18dd8a9a5165..b5a47b583397 100644
> --- a/drivers/crypto/inside-secure/eip93/eip93-aead.c
> +++ b/drivers/crypto/inside-secure/eip93/eip93-aead.c
> @@ -46,7 +46,7 @@ static int eip93_aead_send_req(struct crypto_async_request *async)
>  	struct eip93_cipher_reqctx *rctx = aead_request_ctx(req);
>  	int err;
>  
> -	err = check_valid_request(rctx);
> +	err = check_valid_request(async, rctx);
>  	if (err) {
>  		aead_request_complete(req, err);

The aead_request_complete call is buggy too as you cannot call it
unless you're in the async path, which this clearly is not since
you're still checking the request flags.

I think a better solution is to add crypto_engine to this driver
which would guarantee a sleepable context for the driver.

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

      reply	other threads:[~2026-01-30  8:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  2:54 Qingfang Deng
2026-01-30  8:04 ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aXxmIuU9PKJiDs7n@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=ansuelsmth@gmail.com \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namiltd@yahoo.com \
    --cc=olek2@wp.pl \
    --cc=vschagen@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®