mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
f1ab428711
commit
9da75de030
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue