Skip to contentSkip to conversation

examples/ipsec-secgw: add check for unprotected port mask

PATCH Applied Volodymyr Fialko 3 participants 3 messages Feb 9, 2022 – Feb 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/ipsec-secgw: add check for unprotected port mask

Usage of unprotected port mask without any configured SA inbound, will cause use of uninitialized SA context, so disallow such configuration.

---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
 1 file changed, 3 insertions(+)
examples/ipsec-secgw/ipsec-secgw.c +3 -0
index a643eb3aa7..602e170c96 100644
@@ -3321,6 +3321,9 @@ main(int32_t argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Invalid unprotected portmask 0x%x\n",
 				unprotected_port_mask);
 
+	if (unprotected_port_mask && !nb_sa_in)
+		rte_exit(EXIT_FAILURE, "Cannot use unprotected portmask without configured SA inbound\n");
+
 	if (check_poll_mode_params(eh_conf) < 0)
 		rte_exit(EXIT_FAILURE, "check_poll_mode_params failed\n");
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines

----------------------------------------------------------------------
Usage of unprotected port mask without any configured SA inbound, will cause use of uninitialized SA context, so disallow such configuration.

---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
 1 file changed, 3 insertions(+)
Applied
#2 lore raw
Quoted 4 lines
Quoted 1 line

Usage of unprotected port mask without any configured SA inbound, will

cause

Quoted 2 lines

use of uninitialized SA context, so disallow such configuration.

Quoted 8 lines
Quoted 6 lines
---
 examples/ipsec-secgw/ipsec-secgw.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to dpdk-next-crypto
Thanks.