patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/i40e: fix memory overflow in 32-bit SSE Rx' has been queued to LTS release 16.11.2
Date: Mon,  8 May 2017 13:40:20 +0800	[thread overview]
Message-ID: <1494222024-5222-8-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1494222024-5222-1-git-send-email-yuanhan.liu@linux.intel.com>

Hi,

FYI, your patch has been queued to LTS release 16.11.2

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

Thanks.

	--yliu

---
>From 230b64b61eb82f69cec2e6d6e8c08ed78bef5b67 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Sun, 30 Apr 2017 01:26:49 -0400
Subject: [PATCH] net/i40e: fix memory overflow in 32-bit SSE Rx

[ upstream commit f4afa1a0487fc73055a6d5571a20fdc0ed99866d ]

Return mbuf points of _recv_raw_pkts_vec are modified out of bound.

Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec_sse.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index b95cc8e..9644dd6 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -320,20 +320,26 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		__m128i descs[RTE_I40E_DESCS_PER_LOOP];
 		__m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4;
 		__m128i zero, staterr, sterr_tmp1, sterr_tmp2;
-		__m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */
+		/* 2 64 bit or 4 32 bit mbuf pointers in one XMM reg. */
+		__m128i mbp1;
+#if defined(RTE_ARCH_X86_64)
+		__m128i mbp2;
+#endif
 
-		/* B.1 load 1 mbuf point */
+		/* B.1 load 2 (64 bit) or 4 (32 bit) mbuf points */
 		mbp1 = _mm_loadu_si128((__m128i *)&sw_ring[pos]);
 		/* Read desc statuses backwards to avoid race condition */
 		/* A.1 load 4 pkts desc */
 		descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3));
 		rte_compiler_barrier();
 
-		/* B.2 copy 2 mbuf point into rx_pkts  */
+		/* B.2 copy 2 64 bit or 4 32 bit mbuf point into rx_pkts */
 		_mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1);
 
-		/* B.1 load 1 mbuf point */
+#if defined(RTE_ARCH_X86_64)
+		/* B.1 load 2 64 bit mbuf points */
 		mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]);
+#endif
 
 		descs[2] = _mm_loadu_si128((__m128i *)(rxdp + 2));
 		rte_compiler_barrier();
@@ -342,8 +348,10 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		rte_compiler_barrier();
 		descs[0] = _mm_loadu_si128((__m128i *)(rxdp));
 
+#if defined(RTE_ARCH_X86_64)
 		/* B.2 copy 2 mbuf point into rx_pkts  */
 		_mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2);
+#endif
 
 		if (split_packet) {
 			rte_mbuf_prefetch_part2(rx_pkts[pos]);
-- 
1.9.0

  parent reply	other threads:[~2017-05-08  5:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08  5:40 [dpdk-stable] patch 'kni: fix crash caused by freeing mempool' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net: fix stripped VLAN flag for offload emulation' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net/igb: fix VF MAC address setting' " Yuanhan Liu
2017-05-08  5:40 ` Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net/ixgbe: fix VF Rx mode for allmulticast disabled' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net/ixgbe: fix setting MTU on stopped device' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net/ixgbe: fix memory overflow in 32-bit SSE Rx' " Yuanhan Liu
2017-05-08  5:40 ` Yuanhan Liu [this message]
2017-05-08  5:40 ` [dpdk-stable] patch 'net/fm10k: " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'net/vmxnet3: fix build with gcc 7' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'doc: explain zlib dependency for bnx2x' " Yuanhan Liu
2017-05-08  5:40 ` [dpdk-stable] patch 'test/cmdline: fix missing break in switch' " Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494222024-5222-8-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).