[PATCH v1 1/6] net/ixgbe: add key length check in IPsec
Anatoly Burakov
anatoly.burakov at intel.com
Tue Aug 18 15:19:27 CEST 2026
The cryptodev API does not check for user parameters being within the
bounds of what the driver supports. Currently, the only key size supported
by ixgbe is 16 bytes, so that is what we will check for. Add the check.
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
drivers/net/intel/ixgbe/ixgbe_ipsec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/intel/ixgbe/ixgbe_ipsec.c
index bdd34344e8..aaf657af5f 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/intel/ixgbe/ixgbe_ipsec.c
@@ -384,6 +384,12 @@ ixgbe_crypto_create_session(void *device,
}
aead_xform = &conf->crypto_xform->aead;
+ /* Only 16-byte keys are supported. */
+ if (aead_xform->key.length != 16) {
+ PMD_DRV_LOG(ERR, "Unsupported key length %u", aead_xform->key.length);
+ return -ENOTSUP;
+ }
+
if (conf->ipsec.direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
if (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
ic_session->op = IXGBE_OP_AUTHENTICATED_DECRYPTION;
--
2.52.0
More information about the dev
mailing list