From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F91C48BAC for ; Tue, 25 Nov 2025 19:11:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0974240615; Tue, 25 Nov 2025 19:11:01 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id D98C440615 for ; Tue, 25 Nov 2025 19:10:57 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-47775fb6c56so48717245e9.1 for ; Tue, 25 Nov 2025 10:10:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764094257; x=1764699057; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fXI6v2PZyIOV2jiBEtxoHFPqveZjXw4uJPcb9ENW/VE=; b=giULSbiaJpGK0nRPrd+jp6/VO86SYvPiEO8st9XRMaNyonpza6SQEA/AMl66EGM2MJ 0iMGhGf+Fm+rHK6ySLy3xz/RAk+s5RZLb32KFV0RnF4Z+6I1B67C6Bys5jhUYPSCC9Hm wjRBCAviM4ee4mE/7yz9v8pCvym/kLdruAQowKSFR+LJGPa46JIkPFVAUhdh31WuXGR4 KVoMb3pqv6aTnlQuoF2vgHh6I0Ouvaq8uNmHtXqHMntYx7ErlV+OiFIvk9SyEc4+l4vd jAZKFvQ/xWhpIAGGc5nJxCTCEOvOgyll2CM4k+PBg4qCBhXLCkcuQXbJK8wxH+xPooDz PZKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764094257; x=1764699057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fXI6v2PZyIOV2jiBEtxoHFPqveZjXw4uJPcb9ENW/VE=; b=RWFMhhFVMr9so2zad4d+QO6lX1OYdDK0RDVNrU2OMYEM++p0jxVgprJRMbioO6UnfU E6ltsl8G9da/vU/s9ExXo5/cSPKXg4OyXBJygNkRuwI66n9Fz8czmOqvUMuyoaBoofWY butP5sIWr7Cnd2u3WGNOKAutuYgzIfGEG7rtuUl10q7CtT5cCiUE1xWaayTgtYnG95au cC/6mGHK/m1IHZ/nX7Q1vcHVw/ZKM7rfRwIdp2LWGc1/f2ADtHke3glOAcMojnIjdS5W xejGHO4Qn3OEh5yzEXgwHQvkO4g7njxt3K+awQaOHZcaIN61K6tnMjGxrzRuX1l8gxWm qySA== X-Forwarded-Encrypted: i=1; AJvYcCVDD5bf2CL1jJS2XQeyyN+qUpDwp4woDnSU5JxmAiFJctD60ge+aj45SEEy5V7ONhocq5WYv18=@dpdk.org X-Gm-Message-State: AOJu0YxBDcBDNCx8gc7avKKns+Lrvi49pv2tVrmZYDUhGR5UHjcg5h/F UaA2F+dH1YEJTahCNXeXGH/8sitIyuCb1KmrEew1m2x+Yh+n3EGOYfkY X-Gm-Gg: ASbGncsp9NYoCuMxG+p9YnjQJqMLEYfa1hCFqqWpniusUekKizJoWaPHepvx8vcJ3lW 8NO93uBtP4EMa+8reCkrkIxZD9ukvJ1QStW6qPmSgfUDuHsca9jrilLkkjOTff6ofagZE+3MHGU Zr4zAPKvLyLVAeE86Cyr4HW217KrONZN0KvZdLgm47qOBGvvlC6Ck3Ysyf/ZnYZUWEHfayZRRoV 7c51uIKTzK/4gPGabSP5s+9wM+zmsJnPwLRbL7+yqQAzSitWh3BOHFxewyvwrUyRjiRrKpZhhfk +2Xn+xRl6C/ozBap9uoOkjo9HHXg3X2qAVYiBkBh89W80GS6etNpW5IkvWaLRKzj3vkN34lYbv4 SESX/OLrIMQo1wBiyScbl8U/QS33tY190gyVbTDCnVXGvdIK0xvvhn/0QQEKz2FvMULooIr91sJ Kg8WiIqG8aguQM X-Google-Smtp-Source: AGHT+IEdtTkOAtJHW11BP3O12T5GTapmOkf+pxhJ7mUq7pR/zdZMrecENklM2DRD2wEYWFOy40Ie1A== X-Received: by 2002:a05:600c:c8c:b0:477:9fcf:3fe3 with SMTP id 5b1f17b1804b1-47904a6bd48mr43241195e9.0.1764094257262; Tue, 25 Nov 2025 10:10:57 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:e128:6b49:7104:a117]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-479040c5f89sm25336975e9.2.2025.11.25.10.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 10:10:56 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Bruce Richardson , dpdk stable Subject: patch 'examples/vdpa: fix format overflow' has been queued to stable release 22.11.11 Date: Tue, 25 Nov 2025 18:10:27 +0000 Message-ID: <20251125181053.1783870-2-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251125181053.1783870-1-luca.boccassi@gmail.com> References: <20251120124514.757933-17-luca.boccassi@gmail.com> <20251125181053.1783870-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.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/27/25. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/5978cc8d20b78b27d554febf0e5d24153b962606 Thanks. Luca Boccassi --- >From 5978cc8d20b78b27d554febf0e5d24153b962606 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 20 Nov 2025 08:22:00 -0800 Subject: [PATCH] examples/vdpa: fix format overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 66052657fcb810c47cbbe52762c9ad0ad7828821 ] The ifname is limited to 128 characters, but it would allow up to 128 characters as prefix then could overflow creating ifname. Change to limit path prefix (iface) to 123 (128 - sizeof("1024")) to avoid possible format overflow ../examples/vdpa/main.c:501:76: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] 501 | snprintf(vports[devcnt].ifname, MAX_PATH_LEN, "%s%d", | ^ ../examples/vdpa/main.c:501:25: note: ‘snprintf’ output between 2 and 139 bytes into a destination of size 128 501 | snprintf(vports[devcnt].ifname, MAX_PATH_LEN, "%s%d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 502 | iface, devcnt); | Fixes: 38f8ab0bbc8d ("vhost: make vDPA framework bus agnostic") Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- examples/vdpa/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 4c7e81d7b6..b473321071 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -25,6 +25,7 @@ #define MAX_PATH_LEN 128 #define MAX_VDPA_SAMPLE_PORTS 1024 +#define MAX_VDPA_STR_LEN sizeof(RTE_STR(MAX_VDPA_SAMPLE_PORTS)) #define RTE_LOGTYPE_VDPA RTE_LOGTYPE_USER1 struct vdpa_port { @@ -39,7 +40,7 @@ struct vdpa_port { static struct vdpa_port vports[MAX_VDPA_SAMPLE_PORTS]; -static char iface[MAX_PATH_LEN]; +static char iface[MAX_PATH_LEN - MAX_VDPA_STR_LEN]; static int devcnt; static int interactive; static int client_mode; @@ -77,9 +78,8 @@ parse_args(int argc, char **argv) break; /* long options */ case 0: - if (strncmp(long_option[idx].name, "iface", - MAX_PATH_LEN) == 0) { - rte_strscpy(iface, optarg, MAX_PATH_LEN); + if (!strcmp(long_option[idx].name, "iface")) { + rte_strscpy(iface, optarg, sizeof(iface)); printf("iface %s\n", iface); } if (!strcmp(long_option[idx].name, "interactive")) { -- 2.47.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-25 18:10:03.630891002 +0000 +++ 0002-examples-vdpa-fix-format-overflow.patch 2025-11-25 18:10:03.554456728 +0000 @@ -1 +1 @@ -From 66052657fcb810c47cbbe52762c9ad0ad7828821 Mon Sep 17 00:00:00 2001 +From 5978cc8d20b78b27d554febf0e5d24153b962606 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 66052657fcb810c47cbbe52762c9ad0ad7828821 ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index 289db26498..08aa933272 100644 +index 4c7e81d7b6..b473321071 100644 @@ -37 +38 @@ -@@ -22,6 +22,7 @@ +@@ -25,6 +25,7 @@ @@ -45 +46 @@ -@@ -36,7 +37,7 @@ struct vdpa_port { +@@ -39,7 +40,7 @@ struct vdpa_port { @@ -54 +55 @@ -@@ -74,9 +75,8 @@ parse_args(int argc, char **argv) +@@ -77,9 +78,8 @@ parse_args(int argc, char **argv)