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

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

Merge "qcdev: Check the digest length during the SHA operations"

parents 1fb11298 2ec4086b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1792,6 +1792,12 @@ static inline long qcedev_ioctl(struct file *file,
			mutex_unlock(&hash_access_lock);
			return err;
		}
		if (handle->sha_ctxt.diglen > QCEDEV_MAX_SHA_DIGEST) {
			pr_err("Invalid sha_ctxt.diglen %d\n",
					handle->sha_ctxt.diglen);
			mutex_unlock(&hash_access_lock);
			return -EINVAL;
		}
		qcedev_areq.sha_op_req.diglen = handle->sha_ctxt.diglen;
		memcpy(&qcedev_areq.sha_op_req.digest[0],
				&handle->sha_ctxt.digest[0],
@@ -1828,6 +1834,12 @@ static inline long qcedev_ioctl(struct file *file,
			mutex_unlock(&hash_access_lock);
			return err;
		}
		if (handle->sha_ctxt.diglen > QCEDEV_MAX_SHA_DIGEST) {
			pr_err("Invalid sha_ctxt.diglen %d\n",
					handle->sha_ctxt.diglen);
			mutex_unlock(&hash_access_lock);
			return -EINVAL;
		}
		qcedev_areq.sha_op_req.diglen =	handle->sha_ctxt.diglen;
		memcpy(&qcedev_areq.sha_op_req.digest[0],
				&handle->sha_ctxt.digest[0],