diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2019-04-15 14:37:34 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-04-18 22:13:46 +0800 |
commit | b257b48cd5830c5b1d0c347eb281f9c28056f881 (patch) | |
tree | 7da49f00e4efbf8f2e136af2b4eddd0a397a167c /crypto/lrw.c | |
parent | 44427c0fbc09b448b22410978a4ef6ee37599d25 (diff) | |
download | linux-stable-b257b48cd5830c5b1d0c347eb281f9c28056f881.tar.gz linux-stable-b257b48cd5830c5b1d0c347eb281f9c28056f881.tar.bz2 linux-stable-b257b48cd5830c5b1d0c347eb281f9c28056f881.zip |
crypto: lrw - Fix atomic sleep when walking skcipher
When we perform a walk in the completion function, we need to ensure
that it is atomic.
Fixes: ac3c8f36c31d ("crypto: lrw - Do not use auxiliary buffer")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/lrw.c')
-rw-r--r-- | crypto/lrw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c index 0430ccd08728..08a0e458bc3e 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); } |