diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-04-18 09:03:50 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-04-18 09:03:50 -0700 |
commit | a16c8279b123c3467e25511fc553f7ac2ca918bb (patch) | |
tree | d16497db8df2b976c259c5aa481a10bf33e06b1e /crypto/lrw.c | |
parent | 69ef4995da43c512ffa7d4e57d5124489a0b417f (diff) | |
parent | e179633f9e479876cf8339df9f0a9f4e56f46ea0 (diff) | |
download | linux-crypto-a16c8279b123c3467e25511fc553f7ac2ca918bb.tar.gz linux-crypto-a16c8279b123c3467e25511fc553f7ac2ca918bb.zip |
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 the following problems:
- regression in new XTS/LRW code when used with async crypto
- long-standing bug in ahash API when used with certain algos
- bogus memory dereference in async algif_aead with certain algos"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: algif_aead - Fix bogus request dereference in completion function
crypto: ahash - Fix EINPROGRESS notification callback
crypto: lrw - Fix use-after-free on EINPROGRESS
crypto: xts - Fix use-after-free on EINPROGRESS
Diffstat (limited to '')
-rw-r--r-- | crypto/lrw.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c index 3ea095ad..a8bfae44 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -345,6 +345,13 @@ static void encrypt_done(struct crypto_async_request *areq, int err) struct rctx *rctx; rctx = skcipher_request_ctx(req); + + if (err == -EINPROGRESS) { + if (rctx->left != req->cryptlen) + return; + goto out; + } + subreq = &rctx->subreq; subreq->base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG; @@ -352,6 +359,7 @@ static void encrypt_done(struct crypto_async_request *areq, int err) if (rctx->left) return; +out: skcipher_request_complete(req, err); } @@ -389,6 +397,13 @@ static void decrypt_done(struct crypto_async_request *areq, int err) struct rctx *rctx; rctx = skcipher_request_ctx(req); + + if (err == -EINPROGRESS) { + if (rctx->left != req->cryptlen) + return; + goto out; + } + subreq = &rctx->subreq; subreq->base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG; @@ -396,6 +411,7 @@ static void decrypt_done(struct crypto_async_request *areq, int err) if (rctx->left) return; +out: skcipher_request_complete(req, err); } |