aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-25 09:15:03 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-25 09:15:03 -0700
commitf6f3e747454fc539bbd7904cf70672368289d820 (patch)
tree3eaf09808e449c370cf7c3e81d9aa6ea2f414099
parentcd8dead0c39457e58ec1d36db93aedca811d48f1 (diff)
parentb257b48cd5830c5b1d0c347eb281f9c28056f881 (diff)
downloadriscv-linux-f6f3e747454fc539bbd7904cf70672368289d820.tar.gz
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes a bug in xts and lrw where they may sleep in an atomic context" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: lrw - Fix atomic sleep when walking skcipher crypto: xts - Fix atomic sleep when walking skcipher
-rw-r--r--crypto/lrw.c6
-rw-r--r--crypto/xts.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c
index 0430ccd0872865..08a0e458bc3e62 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -212,8 +212,12 @@ static void crypt_done(struct crypto_async_request *areq, int err)
{
struct skcipher_request *req = areq->data;
- if (!err)
+ if (!err) {
+ struct rctx *rctx = skcipher_request_ctx(req);
+
+ rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
err = xor_tweak_post(req);
+ }
skcipher_request_complete(req, err);
}
diff --git a/crypto/xts.c b/crypto/xts.c
index 847f54f7678972..2f948328cabbd9 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -137,8 +137,12 @@ static void crypt_done(struct crypto_async_request *areq, int err)
{
struct skcipher_request *req = areq->data;
- if (!err)
+ if (!err) {
+ struct rctx *rctx = skcipher_request_ctx(req);
+
+ rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
err = xor_tweak_post(req);
+ }
skcipher_request_complete(req, err);
}