diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-11 19:32:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-11 19:32:45 -0500 |
commit | 916b20e02e1579fcca139b04ccfe25d61594faa8 (patch) | |
tree | 5d6be67fd6d49870710736e935a0c6af9b122226 /crypto/af_alg.c | |
parent | 50c4c4e268a2d7a3e58ebb698ac74da0de40ae36 (diff) | |
parent | ecaaab5649781c5a0effdaf298a925063020500e (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu:
"This push fixes the following issues:
- buffer overread in RSA
- potential use after free in algif_aead.
- error path null pointer dereference in af_alg
- forbid combinations such as hmac(hmac(sha3)) which may crash
- crash in salsa20 due to incorrect API usage"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: salsa20 - fix blkcipher_walk API usage
crypto: hmac - require that the underlying hash algorithm is unkeyed
crypto: af_alg - fix NULL pointer dereference in
crypto: algif_aead - fix reference counting of null skcipher
crypto: rsa - fix buffer overread when stripping leading zeroes
Diffstat (limited to 'crypto/af_alg.c')
-rw-r--r-- | crypto/af_alg.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c index 358749c38894..415a54ced4d6 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c | |||
@@ -672,14 +672,15 @@ void af_alg_free_areq_sgls(struct af_alg_async_req *areq) | |||
672 | } | 672 | } |
673 | 673 | ||
674 | tsgl = areq->tsgl; | 674 | tsgl = areq->tsgl; |
675 | for_each_sg(tsgl, sg, areq->tsgl_entries, i) { | 675 | if (tsgl) { |
676 | if (!sg_page(sg)) | 676 | for_each_sg(tsgl, sg, areq->tsgl_entries, i) { |
677 | continue; | 677 | if (!sg_page(sg)) |
678 | put_page(sg_page(sg)); | 678 | continue; |
679 | } | 679 | put_page(sg_page(sg)); |
680 | } | ||
680 | 681 | ||
681 | if (areq->tsgl && areq->tsgl_entries) | ||
682 | sock_kfree_s(sk, tsgl, areq->tsgl_entries * sizeof(*tsgl)); | 682 | sock_kfree_s(sk, tsgl, areq->tsgl_entries * sizeof(*tsgl)); |
683 | } | ||
683 | } | 684 | } |
684 | EXPORT_SYMBOL_GPL(af_alg_free_areq_sgls); | 685 | EXPORT_SYMBOL_GPL(af_alg_free_areq_sgls); |
685 | 686 | ||