linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c
@ 2018-07-23  2:39 Jia-Ju Bai
  2018-07-23  6:21 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Jia-Ju Bai @ 2018-07-23  2:39 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, linux-kernel

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 :)


Best wishes,
Jia-Ju Bai


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c
  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
  2018-07-23  7:19   ` Jia-Ju Bai
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2018-07-23  6:21 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: linux-crypto, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [REPORT] Possible unnecessary usages of GFP_ATOMIC in crypto/ablkcipher.c
  2018-07-23  6:21 ` Herbert Xu
@ 2018-07-23  7:19   ` Jia-Ju Bai
  0 siblings, 0 replies; 3+ messages in thread
From: Jia-Ju Bai @ 2018-07-23  7:19 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, linux-kernel



On 2018/7/23 14:21, Herbert Xu wrote:
> 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.

Okay, thanks for the reply.


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-23  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-07-23  7:19   ` Jia-Ju Bai

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).