Tested-by: Yu Jiang <[email protected]>

Best Regards
Yu Jiang

> -----Original Message-----
> From: Kai Ji <[email protected]>
> Sent: Wednesday, March 25, 2026 11:51 PM
> To: [email protected]
> Cc: [email protected]; [email protected]; Ji, Kai <[email protected]>;
> [email protected]
> 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: [email protected]
> 
> Signed-off-by: Kai Ji <[email protected]>
> ---

Reply via email to