[dpdk-stable] patch 'examples/vm_power: fix build on Ubuntu 20.04' has been queued to LTS release 18.11.11

Kevin Traynor ktraynor at redhat.com
Wed Nov 18 17:35:28 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.11

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/20. 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-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/0c91ae2ac58c6da03616fafa85ff05e69d483312

Thanks.

Kevin.

---
>From 0c91ae2ac58c6da03616fafa85ff05e69d483312 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 28 Oct 2020 16:27:00 +0000
Subject: [PATCH] examples/vm_power: fix build on Ubuntu 20.04
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit a9f57cfc08810a0936bdc4f4766373a9802bca8e ]

When compiling on Ubuntu 20.04, a warning was issued about possible
truncation of the path string for the power management socket.

channel_manager.c: In function ‘add_all_channels’:
channel_manager.c:470:41: warning: ‘%s’ directive output may be
  truncated writing up to 255 bytes into a region of size 90
  [-Wformat-truncation=]
  470 |     sizeof(chan_info->channel_path), "%s%s",
      |                                         ^~

This can be fixed by adding in an explicit truncation check to the code
and handling it appropriately.

Fixes: e8ae9b662506 ("examples/vm_power: channel manager and monitor in host")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: David Hunt <david.hunt at intel.com>
---
 examples/vm_power_manager/channel_manager.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index c53ad4bf1b..acd2896ed2 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -462,7 +462,13 @@ add_all_channels(const char *vm_name)
 		}
 
-		snprintf(chan_info->channel_path,
+		if ((size_t)snprintf(chan_info->channel_path,
 				sizeof(chan_info->channel_path), "%s%s",
-				CHANNEL_MGR_SOCKET_PATH, dir->d_name);
+				CHANNEL_MGR_SOCKET_PATH, dir->d_name)
+					>= sizeof(chan_info->channel_path)) {
+			RTE_LOG(ERR, CHANNEL_MANAGER, "Pathname too long for channel '%s%s'\n",
+					CHANNEL_MGR_SOCKET_PATH, dir->d_name);
+			rte_free(chan_info);
+			continue;
+		}
 
 		if (setup_channel_info(&vm_info, &chan_info, channel_num) < 0) {
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-18 16:33:38.726388854 +0000
+++ 0042-examples-vm_power-fix-build-on-Ubuntu-20.04.patch	2020-11-18 16:33:37.942215070 +0000
@@ -1 +1 @@
-From a9f57cfc08810a0936bdc4f4766373a9802bca8e Mon Sep 17 00:00:00 2001
+From 0c91ae2ac58c6da03616fafa85ff05e69d483312 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit a9f57cfc08810a0936bdc4f4766373a9802bca8e ]
+
@@ -23 +24,0 @@
-Cc: stable at dpdk.org
@@ -32 +33 @@
-index 74a2a677e8..a26315051b 100644
+index c53ad4bf1b..acd2896ed2 100644
@@ -35 +36 @@
-@@ -468,7 +468,13 @@ add_all_channels(const char *vm_name)
+@@ -462,7 +462,13 @@ add_all_channels(const char *vm_name)



More information about the stable mailing list