crypto: skcipher - add might_sleep() to skcipher_walk_virt()
PATCH 1/1 crypto: skcipher - add might_sleep() to skcipher_walk_virt()
From: Eric Biggers <[email protected]>
skcipher_walk_virt() can still sleep even with atomic=true, since that only affects the later calls to skcipher_walk_done(). But, skcipher_walk_virt() only has to allocate memory for some input data layouts, so incorrectly calling it with preemption disabled can go undetected. Use might_sleep() so that it's detected reliably.
--- crypto/skcipher.c | 2 ++ 1 file changed, 2 insertions(+)
crypto/skcipher.c +2 -0
@@ -474,6 +474,8 @@ int skcipher_walk_virt(struct skcipher_walk *walk, {int err; +might_sleep_if (req->base.flags &CRYPTO_TFM_REQ_MAY_SLEEP ); + walk->flags &= ~SKCIPHER_WALK_PHYS ; err =skcipher_walk_skcipher (walk, req);
Signature · 1 line
2.19.2
Herbert Xu
maintainerQuoted 8 lines · Eric Biggers
From: Eric Biggers <[email protected]>
skcipher_walk_virt()can still sleep even with atomic=true, since that only affects the later calls toskcipher_walk_done(). But,skcipher_walk_virt()only has to allocate memory for some input data layouts, so incorrectly calling it with preemption disabled can go undetected. Usemight_sleep()so that it's detected reliably.
Quoted 4 lines
Signed-off-by Eric Biggers <[email protected]>--- crypto/skcipher.c | 2 ++ 1 file changed, 2 insertions(+)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt