Merge "msm: crypto: Fix integer over flow check in qce driver"

This commit is contained in:
Linux Build Service Account 2016-10-31 13:04:08 -07:00 committed by Gerrit - the friendly Code Review server
commit 431c8dad69

View file

@ -1,6 +1,6 @@
/* Qualcomm Crypto Engine driver.
*
* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1962,8 +1962,8 @@ int qce_aead_req(void *handle, struct qce_req *q_req)
else
q_req->cryptlen = areq->cryptlen - authsize;
if ((q_req->cryptlen > ULONG_MAX - ivsize) ||
(q_req->cryptlen + ivsize > ULONG_MAX - areq->assoclen)) {
if ((q_req->cryptlen > UINT_MAX - ivsize) ||
(q_req->cryptlen + ivsize > UINT_MAX - areq->assoclen)) {
pr_err("Integer overflow on total aead req length.\n");
return -EINVAL;
}