examples/ipsec-secgw: fix access to freed packet

Message ID 1566462535-17425-1-git-send-email-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series examples/ipsec-secgw: fix access to freed packet |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-Compile-Testing success Compile Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail Compilation issues
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Anoob Joseph Aug. 22, 2019, 8:28 a.m. UTC
  For unknown/unsupported packets, the packet would get checked for inline
offloads after the packet is freed.

Fixes: 0ccfd14bc10d ("examples/ipsec-secgw: support inline protocol")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Akhil Goyal Sept. 4, 2019, 10:38 a.m. UTC | #1
> 
> For unknown/unsupported packets, the packet would get checked for inline
> offloads after the packet is freed.
> 
> Fixes: 0ccfd14bc10d ("examples/ipsec-secgw: support inline protocol")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Akhil Goyal Sept. 19, 2019, 3:05 p.m. UTC | #2
> 
> >
> > For unknown/unsupported packets, the packet would get checked for
> inline
> > offloads after the packet is freed.
> >
> > Fixes: 0ccfd14bc10d ("examples/ipsec-secgw: support inline protocol")
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 0d1fd6a..fcd656b 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -353,6 +353,7 @@  prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)
 		RTE_LOG(ERR, IPSEC, "Unsupported packet type 0x%x\n",
 			rte_be_to_cpu_16(eth->ether_type));
 		rte_pktmbuf_free(pkt);
+		return;
 	}
 
 	/* Check if the packet has been processed inline. For inline protocol