Message ID | 20220506082327.21605-10-giovanni.cabiddu@intel.com |
---|---|
State | Accepted |
Commit | 2acbb8771f6ac82422886e63832ee7a0f4b1635b |
Headers | show |
Series | [01/12] crypto: qat - use pre-allocated buffers in datapath | expand |
diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c index 2b2adeee5eee..b3badc5bd224 100644 --- a/drivers/crypto/qat/qat_common/qat_asym_algs.c +++ b/drivers/crypto/qat/qat_common/qat_asym_algs.c @@ -235,6 +235,10 @@ static int qat_dh_compute_value(struct kpp_request *req) req->dst_len = ctx->p_size; return -EOVERFLOW; } + + if (req->src_len > ctx->p_size) + return -EINVAL; + memset(msg, '\0', sizeof(*msg)); ICP_QAT_FW_PKE_HDR_VALID_FLAG_SET(msg->pke_hdr, ICP_QAT_FW_COMN_REQ_FLAG_SET);