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
This commit is contained in:
Linus Torvalds 2019-04-25 09:15:03 -07:00
commit f6f3e74745
2 changed files with 10 additions and 2 deletions

View File

@ -212,8 +212,12 @@ static void crypt_done(struct crypto_async_request *areq, int err)
{ {
struct skcipher_request *req = areq->data; 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); err = xor_tweak_post(req);
}
skcipher_request_complete(req, err); skcipher_request_complete(req, err);
} }

View File

@ -137,8 +137,12 @@ static void crypt_done(struct crypto_async_request *areq, int err)
{ {
struct skcipher_request *req = areq->data; 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); err = xor_tweak_post(req);
}
skcipher_request_complete(req, err); skcipher_request_complete(req, err);
} }