diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-15 10:21:04 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-12-15 10:21:04 -0800 |
commit | 53915e905e07808ea8960fabacafd2d144087bc2 (patch) | |
tree | 918b48b35bf23b02aa20cd4fee9dfa65db185968 | |
parent | b1d13cb9d87a3d25f79388d8db914a482ce5b3b7 (diff) | |
parent | e27bb8291df73746266cd9a706e7d4908ab29297 (diff) | |
download | linux-crypto-53915e905e07808ea8960fabacafd2d144087bc2.tar.gz linux-crypto-53915e905e07808ea8960fabacafd2d144087bc2.zip |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu:
"This fixes a boundary condition in the blkcipher SG walking code that
can lead to a crash when used with the new chacha20 algorithm"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: skcipher - Copy iv from desc even for 0-len walks
Diffstat (limited to '')
-rw-r--r-- | crypto/ablkcipher.c | 2 | ||||
-rw-r--r-- | crypto/blkcipher.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index b4ffc5be..e5b57218 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -277,12 +277,12 @@ static int ablkcipher_walk_first(struct ablkcipher_request *req, if (WARN_ON_ONCE(in_irq())) return -EDEADLK; + walk->iv = req->info; walk->nbytes = walk->total; if (unlikely(!walk->total)) return 0; walk->iv_buffer = NULL; - walk->iv = req->info; if (unlikely(((unsigned long)walk->iv & alignmask))) { int err = ablkcipher_copy_iv(walk, tfm, alignmask); diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 11b98149..8cc1622b 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -326,12 +326,12 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc, if (WARN_ON_ONCE(in_irq())) return -EDEADLK; + walk->iv = desc->info; walk->nbytes = walk->total; if (unlikely(!walk->total)) return 0; walk->buffer = NULL; - walk->iv = desc->info; if (unlikely(((unsigned long)walk->iv & walk->alignmask))) { int err = blkcipher_copy_iv(walk); if (err) |