From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD4C0ECD9A6 for ; Thu, 5 Feb 2026 21:30:55 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4A7D402E8; Thu, 5 Feb 2026 22:30:54 +0100 (CET) Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) by mails.dpdk.org (Postfix) with ESMTP id 42005402E4 for ; Thu, 5 Feb 2026 22:30:53 +0100 (CET) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id D92B8EC00AE; Thu, 5 Feb 2026 16:30:52 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 05 Feb 2026 16:30:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1770327052; x= 1770413452; bh=oSUGUyiew/V95szEJCiwNKzQqj61tM3OEqf64KVDn9s=; b=f AL3/t/9Ajq3KQU5E4y04A0wqK9W8iFknKy+ytVrPEYy78CPZsTKeK189+ZgM2nAv mDOE/U5kAQAsbL0+n0V2HqYFNpvE9lEX/47qY8YgWRrs3T1o0kLFOZ5VAEXX4PG1 rYXqFRHIKPr98wC7kHxYg6cMFZRY7vgLicqTNzTnPS7cPIotZ5Oql1wM5w9EBn7n 8GeP8GdpXXKQ4leq88i5ieDqpWrM3JLY1+b31zoahv7iLQvWIoDPq0A02XYnk8SX LzHxphh9fPMsCxHE8qzL/x2pEqjhp3Fct4qVDobVwTQJ5UkBuB3ZbA0TGS1HwqEi y5xfHzjd/QCKQRNzOYdvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1770327052; x=1770413452; bh=o SUGUyiew/V95szEJCiwNKzQqj61tM3OEqf64KVDn9s=; b=sawRexs6FxZQzR5aN UwcONQOSs0rOxo+7V1M9xpAa+blHjoAfhFL5M8D0Jb9MjY3YBUG7/NOI/dciGWIM 4LNdbo8bmthTai8gUDq8Esw8EbwwceNqPQu+ANvUvaXHl0OZj7SK57KNX+aJ7Ajj V2zruz7KQrPx0LBRfvqTkgxW+l/P76cCooVHNXCbTipHW6FlChEyooZAB3R6VYfd fufMIQiQCcmQmRMcFh0gZDq63SxAwWoyRatfHFoBMHGfVj1SmctLCWhQt6RMBjXu BoVRVF7e8RxJrTY4NjVzU2Q4187wA/g2VXt82CzR3xDiwRiIDvOf9I/C4+PWo+h0 OP4iQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukeeifeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteevkeeh hfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtpdhnsggprhgtphhtthhopeefpdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopeguvghvseguphgukhdrohhrghdprhgtph htthhopegurghvihgurdhmrghrtghhrghnugesrhgvughhrghtrdgtohhmpdhrtghpthht oheprghnrghtohhlhidrsghurhgrkhhovhesihhnthgvlhdrtghomh X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Feb 2026 16:30:52 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com, Anatoly Burakov Subject: [PATCH v4 01/11] mem: check fbarray name truncation in secondary process Date: Thu, 5 Feb 2026 22:27:33 +0100 Message-ID: <20260205213044.702908-2-thomas@monjalon.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260205213044.702908-1-thomas@monjalon.net> References: <20210412215339.2439530-1-thomas@monjalon.net> <20260205213044.702908-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When compiling in debug mode, the format-truncation check raises a warning: In function 'secondary_msl_create_walk': lib/eal/linux/eal_memalloc.c:1401:50: error: '%i' directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 63 [-Werror=format-truncation=] note: 'snprintf' output between 3 and 76 bytes into a destination of size 64 1401 | snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", 1402 | primary_msl->memseg_arr.name, getpid()); This is a new warning enabled in DPDK 26.03. It is solved by checking the return of snprintf. Bugzilla ID: 1878 Signed-off-by: Thomas Monjalon --- lib/eal/linux/eal_memalloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c index d9e8ea76b9..4dee224ac5 100644 --- a/lib/eal/linux/eal_memalloc.c +++ b/lib/eal/linux/eal_memalloc.c @@ -1398,8 +1398,13 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl, local_msl = &local_memsegs[msl_idx]; /* create distinct fbarrays for each secondary */ - snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", + ret = snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", primary_msl->memseg_arr.name, getpid()); + if (ret >= RTE_FBARRAY_NAME_LEN) { + EAL_LOG(ERR, "fbarray name %s_%i is too long", + primary_msl->memseg_arr.name, getpid()); + return -1; + } ret = rte_fbarray_init(&local_msl->memseg_arr, name, primary_msl->memseg_arr.len, -- 2.52.0