[dpdk-stable] patch 'event/opdl: replace sprintf with snprintf' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Tue Apr 16 16:36:24 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.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 04/24/19. 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.

Thanks.

Kevin Traynor

---
>From 5f05c4e500feb449d6744d54a8b62c19734ae386 Mon Sep 17 00:00:00 2001
From: Pallantla Poornima <pallantlax.poornima at intel.com>
Date: Mon, 4 Feb 2019 07:18:02 +0000
Subject: [PATCH] event/opdl: replace sprintf with snprintf

[ upstream commit 57362ddf4262d0440ae1bddc6eaf69e9f94f9c85 ]

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: 3c7f3dcfb0 ("event/opdl: add PMD main body and helper function")

Signed-off-by: Pallantla Poornima <pallantlax.poornima at intel.com>
---
 drivers/event/opdl/opdl_evdev.c        | 7 ++++---
 drivers/event/opdl/opdl_evdev_xstats.c | 7 +++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
index a4f0bc8b6..d2d2be44b 100644
--- a/drivers/event/opdl/opdl_evdev.c
+++ b/drivers/event/opdl/opdl_evdev.c
@@ -423,8 +423,9 @@ opdl_dump(struct rte_eventdev *dev, FILE *f)
 				p_type = "????";
 
-			sprintf(queue_id, "%02u", port->external_qid);
+			snprintf(queue_id, sizeof(queue_id), "%02u",
+					port->external_qid);
 			if (port->p_type == OPDL_REGULAR_PORT ||
 					port->p_type == OPDL_ASYNC_PORT)
-				sprintf(total_cyc,
+				snprintf(total_cyc, sizeof(total_cyc),
 					" %'16"PRIu64"",
 					(cpg != 0 ?
@@ -432,5 +433,5 @@ opdl_dump(struct rte_eventdev *dev, FILE *f)
 					 : 0));
 			else
-				sprintf(total_cyc,
+				snprintf(total_cyc, sizeof(total_cyc),
 					"             ----");
 			fprintf(f,
diff --git a/drivers/event/opdl/opdl_evdev_xstats.c b/drivers/event/opdl/opdl_evdev_xstats.c
index 0e6c6bd5e..27b3d8802 100644
--- a/drivers/event/opdl/opdl_evdev_xstats.c
+++ b/drivers/event/opdl/opdl_evdev_xstats.c
@@ -33,8 +33,7 @@ opdl_xstats_init(struct rte_eventdev *dev)
 
 			/* Name */
-			sprintf(device->port_xstat[index].stat.name,
-			       "port_%02u_%s",
-			       i,
-			       port_xstat_str[j]);
+			snprintf(device->port_xstat[index].stat.name,
+				sizeof(device->port_xstat[index].stat.name),
+				"port_%02u_%s", i, port_xstat_str[j]);
 
 			/* ID */
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-16 15:34:25.481144220 +0100
+++ 0006-event-opdl-replace-sprintf-with-snprintf.patch	2019-04-16 15:34:25.109181525 +0100
@@ -1,13 +1,14 @@
-From 57362ddf4262d0440ae1bddc6eaf69e9f94f9c85 Mon Sep 17 00:00:00 2001
+From 5f05c4e500feb449d6744d54a8b62c19734ae386 Mon Sep 17 00:00:00 2001
 From: Pallantla Poornima <pallantlax.poornima at intel.com>
 Date: Mon, 4 Feb 2019 07:18:02 +0000
 Subject: [PATCH] event/opdl: replace sprintf with snprintf
 
+[ upstream commit 57362ddf4262d0440ae1bddc6eaf69e9f94f9c85 ]
+
 sprintf function is not secure as it doesn't check the length of string.
 More secure function snprintf is used.
 
 Fixes: 3c7f3dcfb0 ("event/opdl: add PMD main body and helper function")
-Cc: stable at dpdk.org
 
 Signed-off-by: Pallantla Poornima <pallantlax.poornima at intel.com>
 ---


More information about the stable mailing list