[dpdk-stable] patch 'examples/ipsec-secgw: fix IP version check' has been queued to stable release 17.08.1

Yuanhan Liu yliu at fridaylinux.org
Tue Nov 21 14:17:53 CET 2017


Hi,

FYI, your patch has been queued to stable release 17.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 9c69c762a3857fac47f1769332337215bbc1ad9b Mon Sep 17 00:00:00 2001
From: Tomasz Duszynski <tdu at semihalf.com>
Date: Fri, 13 Oct 2017 14:50:09 +0200
Subject: [PATCH] examples/ipsec-secgw: fix IP version check

[ upstream commit 3417350e7f1726d6495e0d85e2212f6d4f959e4e ]

Since new_ip and ip4 are overlapping buffers copying ip4 over new_ip
using memmove() might overwrite memory at ip4. This could happen if
following condition holds:

ip_hdr_len > sizeof(struct esp_hdr) + sa->iv_len

Thus using ip4 to check ip version is wrong as it might not contain
proper value.

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")

Signed-off-by: Tomasz Duszynski <tdu at semihalf.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy at intel.com>
Reviewed-by: Aviad Yehezkel <aviadye at mellanox.com>
---
 examples/ipsec-secgw/esp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
index 70bb81f..56ad7a0 100644
--- a/examples/ipsec-secgw/esp.c
+++ b/examples/ipsec-secgw/esp.c
@@ -306,8 +306,8 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
 				sizeof(struct esp_hdr) + sa->iv_len);
 		memmove(new_ip, ip4, ip_hdr_len);
 		esp = (struct esp_hdr *)(new_ip + ip_hdr_len);
+		ip4 = (struct ip *)new_ip;
 		if (likely(ip4->ip_v == IPVERSION)) {
-			ip4 = (struct ip *)new_ip;
 			ip4->ip_p = IPPROTO_ESP;
 			ip4->ip_len = htons(rte_pktmbuf_data_len(m));
 		} else {
-- 
2.7.4



More information about the stable mailing list