linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c
Date: Mon, 23 Jul 2018 14:21:01 +0800	[thread overview]
Message-ID: <20180723062101.zzm5royyjfda6jma@gondor.apana.org.au> (raw)
In-Reply-To: <78a7d726-f2fa-3afb-3451-bbd51a41a48a@gmail.com>

On Mon, Jul 23, 2018 at 10:39:40AM +0800, Jia-Ju Bai wrote:
> My tool DCNS reports three unnecessary usages of GFP_ATOMIC in
> crypto/ablkcipher.c:
> crypto/ablkcipher.c, 162: kmalloc(GFP_ATOMIC) in ablkcipher_next_slow
> crypto/ablkcipher.c, 199: kmalloc(GFP_ATOMIC) in ablkcipher_copy_iv
> crypto/ablkcipher.c, 315: kmalloc(GFP_ATOMIC) in setkey_unaligned
> 
> I meant to manually check the code, but I find that there are many functions
> calling ablkcipher_next_slow(),
> ablkcipher_copy_iv() and setkey_unaligned(), so I am not sure whether the
> above three reports are true.
> 
> Could someone help me to validate these reports?
> Thanks a lot in advance :)

They must use GFP_ATOMIC because they can be called from softirq
context, e.g., IPsec.

Cheers,
-- 
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:[~2018-07-23  6:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  2:39 [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c Jia-Ju Bai
2018-07-23  6:21 ` Herbert Xu [this message]
2018-07-23  7:19   ` Jia-Ju Bai

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=20180723062101.zzm5royyjfda6jma@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=baijiaju1990@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).