diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-09-09 08:27:07 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-09-10 05:22:55 -0400 |
commit | 9da75de030bb6e49475ef37c8495d07e98cfeb33 (patch) | |
tree | 728713e8fbfe7790c480e663fab64d6ce4b9af7b | |
parent | f1ab428711358fbb747ba392c3448462494e6c6a (diff) |
crypto: sunxi-ss - Fix a possible driver hang with ciphers
The sun4i_ss_opti_poll function cipher data until the output miter have
a length of 0.
If the crypto API client, give more SGs than necessary this could result
in an infinite loop.
Fix it by checking for remaining bytes, just like sun4i_ss_cipher_poll().
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index e070c316e8b7..a19ee127edca 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | |||
@@ -104,7 +104,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq) | |||
104 | sg_miter_next(&mo); | 104 | sg_miter_next(&mo); |
105 | oo = 0; | 105 | oo = 0; |
106 | } | 106 | } |
107 | } while (mo.length > 0); | 107 | } while (oleft > 0); |
108 | 108 | ||
109 | if (areq->info) { | 109 | if (areq->info) { |
110 | for (i = 0; i < 4 && i < ivsize / 4; i++) { | 110 | for (i = 0; i < 4 && i < ivsize / 4; i++) { |