The following commit has been merged in the master branch: commit 43570f0383d6d5879ae585e6c3cf027ba321546f Merge: 43f462f1c2e111d2882b48baeeff774ae42e7c56 c14ca8386539a298c1c19b003fe55e37d0f0e89c Author: Linus Torvalds torvalds@linux-foundation.org Date: Tue Nov 28 16:22:10 2017 -0800
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
- avoid potential bogus alignment for some AEAD operations
- fix crash in algif_aead
- avoid sleeping in softirq context with async af_alg
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: skcipher - Fix skcipher_walk_aead_common crypto: af_alg - remove locking in async callback crypto: algif_aead - skip SGL entries with NULL page
diff --combined crypto/skcipher.c index d5692e35fab1,6c45ed536664..778e0ff42bfa --- a/crypto/skcipher.c +++ b/crypto/skcipher.c @@@ -426,9 -426,14 +426,9 @@@ static int skcipher_copy_iv(struct skci
static int skcipher_walk_first(struct skcipher_walk *walk) { - walk->nbytes = 0; - if (WARN_ON_ONCE(in_irq())) return -EDEADLK;
- if (unlikely(!walk->total)) - return 0; - walk->buffer = NULL; if (unlikely(((unsigned long)walk->iv & walk->alignmask))) { int err = skcipher_copy_iv(walk); @@@ -447,15 -452,10 +447,15 @@@ static int skcipher_walk_skcipher(struc { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ walk->total = req->cryptlen; + walk->nbytes = 0; + + if (unlikely(!walk->total)) + return 0; + scatterwalk_start(&walk->in, req->src); scatterwalk_start(&walk->out, req->dst);
- walk->total = req->cryptlen; walk->iv = req->iv; walk->oiv = req->iv;
@@@ -509,11 -509,6 +509,11 @@@ static int skcipher_walk_aead_common(st struct crypto_aead *tfm = crypto_aead_reqtfm(req); int err;
+ walk->nbytes = 0; + + if (unlikely(!walk->total)) + return 0; + walk->flags &= ~SKCIPHER_WALK_PHYS;
scatterwalk_start(&walk->in, req->src); @@@ -522,6 -517,9 +522,9 @@@ scatterwalk_copychunks(NULL, &walk->in, req->assoclen, 2); scatterwalk_copychunks(NULL, &walk->out, req->assoclen, 2);
+ scatterwalk_done(&walk->in, 0, walk->total); + scatterwalk_done(&walk->out, 0, walk->total); + walk->iv = req->iv; walk->oiv = req->iv;