Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1221397 > unrolled thread
| Started by | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| First post | 2015-09-09 14:30 +0200 |
| Last post | 2015-09-10 11:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] crypto: sun4i-ss Fix a possible driver hang with ciphers LABBE Corentin <clabbe.montjoie@gmail.com> - 2015-09-09 14:30 +0200
Re: [PATCH] crypto: sun4i-ss Fix a possible driver hang with ciphers Herbert Xu <herbert@gondor.apana.org.au> - 2015-09-10 11:30 +0200
| From | LABBE Corentin <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2015-09-09 14:30 +0200 |
| Subject | [PATCH] crypto: sun4i-ss Fix a possible driver hang with ciphers |
| Message-ID | <q6MFJ-2Ym-17@gated-at.bofh.it> |
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>
---
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
index e070c31..a19ee12 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)
sg_miter_next(&mo);
oo = 0;
}
- } while (mo.length > 0);
+ } while (oleft > 0);
if (areq->info) {
for (i = 0; i < 4 && i < ivsize / 4; i++) {
--
2.4.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Date | 2015-09-10 11:30 +0200 |
| Message-ID | <q76l5-5Jt-7@gated-at.bofh.it> |
| In reply to | #1221397 |
On Wed, Sep 09, 2015 at 02:27:07PM +0200, LABBE Corentin wrote: > 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> Applied. -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web