[dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD

Ananyev, Konstantin konstantin.ananyev at intel.com
Mon Apr 8 14:09:33 CEST 2019


Hi Bernard,

> 
> While running the IPsec unit test program the following
> segmentation fault is occurring:
> 
> Thread 1 "test" received signal SIGSEGV, Segmentation fault.
> 0x0000000000beaece in qat_sym_build_request(in_op=0x0,
> out_msg=0x100450580 "", op_cookie=0x101c6fd80, qat_dev_gen=QAT_GEN1)
> at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165
> 165  if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
> 
> Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
> Signed-off-by: Bernard Iremonger <bernard.iremonger at intel.com>
> ---
>  drivers/crypto/qat/qat_sym.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index 8801ca5..4a7d11e 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
>  	struct qat_sym_op_cookie *cookie =
>  				(struct qat_sym_op_cookie *)op_cookie;
> 
> +	if (op == NULL) {
> +		QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
> +				"operation requests, op (%p) is NULL", op);
> +		return -EINVAL;
> +	}
> +
>  	if (unlikely(op->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
>  		QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto "
>  				"operation requests, op (%p) is not a "

This is crypto-dev enqueue data-path, if I am not mistaken.
I think in that case it is caller responsibility to make sure that ops[] contain valid crypto-ops
(as in majority of other data-path functions).
Suppose the main question here - why ipsec UT passes NULL as crypto-op here?
Konstantin



More information about the dev mailing list