Merge "qcrypto: protect potential integer overflow."

This commit is contained in:
Linux Build Service Account 2017-02-03 22:59:39 -08:00 committed by Gerrit - the friendly Code Review server
commit b1615eab2b

View file

@ -4967,6 +4967,11 @@ int qce_aead_req(void *handle, struct qce_req *q_req)
else
q_req->cryptlen = areq->cryptlen - authsize;
if (q_req->cryptlen > UINT_MAX - areq->assoclen) {
pr_err("Integer overflow on total aead req length.\n");
return -EINVAL;
}
totallen = q_req->cryptlen + areq->assoclen;
if (pce_dev->support_cmd_dscr) {