patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Rahul Bhansali <rbhansali@marvell.com>
Cc: Conor Walsh <conor.walsh@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: patch 'examples/l3fwd: fix buffer overflow in Tx' has been queued to stable release 21.11.1
Date: Wed, 16 Mar 2022 15:15:17 +0000	[thread overview]
Message-ID: <20220316151524.1242199-16-ktraynor@redhat.com> (raw)
In-Reply-To: <20220316151524.1242199-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.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 03/21/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/098c1c5d54b547166b8efb3337042bf225783435

Thanks.

Kevin

---
From 098c1c5d54b547166b8efb3337042bf225783435 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Tue, 11 Jan 2022 18:20:05 +0530
Subject: [PATCH] examples/l3fwd: fix buffer overflow in Tx

[ upstream commit 0490d69d58d9d75c37e780966c837a062658f528 ]

This patch fixes the stack buffer overflow error reported
from AddressSanitizer.
Function send_packetsx4() tries to access out of bound data
from rte_mbuf and fill it into TX buffer even in the case
where no pending packets (len = 0).
Performance impact:- No

ASAN error report:-
==819==ERROR: AddressSanitizer: stack-buffer-overflow on address
0xffffe2c0dcf0 at pc 0x0000005e791c bp 0xffffe2c0d7e0 sp 0xffffe2c0d800
READ of size 8 at 0xffffe2c0dcf0 thread T0
 #0 0x5e7918 in send_packetsx4 ../examples/l3fwd/l3fwd_common.h:251
 #1 0x5e7918 in send_packets_multi ../examples/l3fwd/l3fwd_neon.h:226

Fixes: 96ff445371e0 ("examples/l3fwd: reorganise and optimize LPM code path")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 examples/l3fwd/l3fwd_common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h
index cbaab79f5b..8e4c27218f 100644
--- a/examples/l3fwd/l3fwd_common.h
+++ b/examples/l3fwd/l3fwd_common.h
@@ -237,4 +237,7 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[],
 		/* copy rest of the packets into the TX buffer. */
 		len = num - n;
+		if (len == 0)
+			goto exit;
+
 		j = 0;
 		switch (len % FWDSTEP) {
@@ -259,4 +262,5 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[],
 	}
 
+exit:
 	qconf->tx_mbufs[port].len = len;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-16 15:14:12.520474723 +0000
+++ 0016-examples-l3fwd-fix-buffer-overflow-in-Tx.patch	2022-03-16 15:14:12.124847656 +0000
@@ -1 +1 @@
-From 0490d69d58d9d75c37e780966c837a062658f528 Mon Sep 17 00:00:00 2001
+From 098c1c5d54b547166b8efb3337042bf225783435 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0490d69d58d9d75c37e780966c837a062658f528 ]
+
@@ -21 +22,0 @@
-Cc: stable@dpdk.org


  parent reply	other threads:[~2022-03-16 15:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 15:15 patch 'net/mlx5: fix VLAN push action validation' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/mlx5: fix sample flow action on trusted device' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/mlx5: forbid multiple ASO actions in a single rule' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/mlx5: fix implicit tag insertion with sample action' " Kevin Traynor
2022-03-16 15:15 ` patch 'doc: fix modify field action description for mlx5' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/qede: fix Tx completion' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/qede: fix Rx bulk' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/qede: fix maximum Rx packet length' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/af_xdp: fix custom program loading with multiple queues' " Kevin Traynor
2022-03-16 15:15 ` patch 'crypto/ipsec_mb: fix GCM requested digest length' " Kevin Traynor
2022-03-16 15:15 ` patch 'bpf: fix build with some libpcap version on FreeBSD' " Kevin Traynor
2022-03-16 15:15 ` patch 'app/regex: fix number of matches' " Kevin Traynor
2022-03-16 15:15 ` patch 'app/testpmd: fix show RSS RETA on Windows' " Kevin Traynor
2022-03-16 15:15 ` patch 'app/testpmd: fix GTP header parsing in checksum engine' " Kevin Traynor
2022-03-16 15:15 ` patch 'app/testpmd: fix flow rule with flex input link' " Kevin Traynor
2022-03-16 15:15 ` Kevin Traynor [this message]
2022-03-16 15:15 ` patch 'eal/freebsd: add missing C++ include guards' " Kevin Traynor
2022-03-16 15:15 ` patch 'compressdev: fix missing space in log macro' " Kevin Traynor
2022-03-16 15:15 ` patch 'cryptodev: fix clang C++ include' " Kevin Traynor
2022-03-16 15:15 ` patch 'eventdev: " Kevin Traynor
2022-03-16 15:15 ` patch 'build: suppress rte_crypto_asym_op abi check' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/mlx5: fix port matching in sample flow rule' " Kevin Traynor
2022-03-16 15:15 ` patch 'net/mlx5: fix CPU socket ID for Rx queue creation' " Kevin Traynor

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=20220316151524.1242199-16-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=conor.walsh@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=rbhansali@marvell.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).