Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4ef1279 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "crypto: msm: check potential integer overflow"

parents 2ac9ed35 9f71e2eb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1881,12 +1881,12 @@ static int _qcrypto_process_aead(struct crypto_engine *pengine,
			rctx->orig_src = req->src;
			rctx->orig_dst = req->dst;

			if ((MAX_ALIGN_SIZE*2 > ULONG_MAX - req->assoclen) ||
				((MAX_ALIGN_SIZE*2 + req->assoclen) >
						ULONG_MAX - qreq.authsize) ||
				((MAX_ALIGN_SIZE*2 + req->assoclen +
			if ((MAX_ALIGN_SIZE*2 > UINT_MAX - qreq.assoclen) ||
				((MAX_ALIGN_SIZE*2 + qreq.assoclen) >
						UINT_MAX - qreq.authsize) ||
				((MAX_ALIGN_SIZE*2 + qreq.assoclen +
						qreq.authsize) >
						ULONG_MAX - req->cryptlen)) {
						UINT_MAX - req->cryptlen)) {
				pr_err("Integer overflow on aead req length.\n");
				return -EINVAL;
			}