net/iavf: fix SPI check
PATCH 1/1 net/iavf: fix SPI check
Return error if SPI from the flow spec doesn't match the one from the crypto session.
Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Signed-off-by Radu Nicolau <[email protected]>
--- drivers/net/iavf/iavf_ipsec_crypto.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/net/iavf/iavf_ipsec_crypto.c +3 -11
@@ -697,19 +697,11 @@ iavf_ipsec_crypto_action_valid(struct rte_eth_dev *ethdev,if (unlikely (sess ==NULL || sess->adapter != adapter))return false; -/* SPI value must be non-zero */ -if (spi ==0 ) +/* SPI value must be non-zero and must match flow SPI*/ +if (spi ==0 || (htonl (sess->sa.spi) != spi))return false; -/* Session SPI must patch flow SPI*/ -else if (sess->sa.spi == spi) { -return true; -/** -* TODO: We should add a way of tracking valid hw SA indices to -* make validation less brittle -*/ - } -return true; +return true; }/**
Signature · 1 line
2.25.1
Quoted 10 lines
-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Friday, October 14, 2022 5:51 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Nicolau, Radu <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix SPI check
Quoted 7 lines
Return error if SPI from the flow spec doesn't match the one from the crypto session.
Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")Signed-off-by Radu Nicolau <[email protected]>
Acked-by Qi Zhang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi