[dpdk-dev v1] crypto/qat: fix EC session segfault on missing pkey/pub key
Jiang, YuX
yux.jiang at intel.com
Tue Mar 31 03:48:21 CEST 2026
Tested-by: Yu Jiang <yux.jiang at intel.com>
Best Regards
Yu Jiang
> -----Original Message-----
> From: Kai Ji <kai.ji at intel.com>
> Sent: Wednesday, March 25, 2026 11:51 PM
> To: dev at dpdk.org
> Cc: gakhil at marvell.com; chiluka at marvell.com; Ji, Kai <kai.ji at intel.com>;
> stable at dpdk.org
> Subject: [dpdk-dev v1] crypto/qat: fix EC session segfault on missing pkey/pub key
>
> session_set_ec() checked qat_session->xform.ec.pkey.length for the NULL-
> allocation guards, but that field is zero (from the preceding memset) at that point, so
> the guards never fired.
> When test_ecpm() created a session the xform had no pkey or public-key fields set
> (ECPM only needs curve_id), so the unchecked memcpy calls received a NULL
> destination and a garbage-length source, causing a segfault.
>
> Fix session_set_ec() to check xform->ec.*.length, the caller- supplied value, before
> allocating and copying each optional field (pkey, q.x, q.y), skipping the allocation
> entirely when the length is zero.
>
> Fix test_ecpm() to zero-initialise the xform with memset so that uninitialised pkey/q
> fields are never passed to the driver.
>
> Also add a QAT_LOG(ERR) in pick_curve() default case so that unsupported curve
> IDs are surfaced immediately rather than producing the misleading 'Unsupported
> xform type' message from qat_asym_session_configure().
>
> Fixes: 064ef1b098d1 (\"test/crypto: remove PMD-specific asym test suites\")
>
> Cc: stable at dpdk.org
>
> Signed-off-by: Kai Ji <kai.ji at intel.com>
> ---
More information about the dev
mailing list