Article View: linux.kernel.netdev
Article #22908[PATCH net-next] cxgb4: avoid truncating the MSI-X interrupt names
From: Aibing Chen
Date: Thu, 26 Nov 2026 06:17
Date: Thu, 26 Nov 2026 06:17
51 lines
10424 bytes
10424 bytes
The MSI-X interrupt names are assembled with snprintf() into
adap->msix_info[].desc[IFNAMSIZ + 10], from adap->port[0]->name (up to
IFNAMSIZ - 1 characters) plus a suffix and a queue index:
"%s-Rx%d" needs up to 30 bytes
"%s-mirrorrxq%d" needs up to 37 bytes
"%s-%s%d" needs up to 43 bytes
The last one also formats the ULD queue name, which is copied from the
ULD with memcpy(rxq_info->name, uld_info->name, IFNAMSIZ) into a
char[IFNAMSIZ] field, so it can be up to IFNAMSIZ - 1 characters as well.
Because -Wformat-truncation is enabled for W=1 builds and COMPILE_TEST
configurations turn it into an error through CONFIG_WERROR, the driver
does not build today:
cxgb4_main.c:1074:48: error: '%d' directive output may be truncated
writing between 1 and 11 bytes into a region of size between 8 and
23 [-Werror=format-truncation=]
cxgb4_main.c:1356:47: error: '%d' directive output may be truncated
writing between 1 and 5 bytes into a region of size between 1 and 16
cxgb4_uld.c:141:38: error: '%s' directive output may be truncated
writing up to 15 bytes into a region of size between 10 and 25
Size desc[] for the worst case, 42 characters plus the terminator, which
is IFNAMSIZ + 27 bytes.
Compile tested only, with W=1 before and after the change; no Chelsio
hardware was available to exercise the driver.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604141419.a4vuNBN7-lkp@intel.com/
Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index f20f4bc58..dda787b8d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -1049,7 +1049,7 @@ struct msix_bmap {
struct msix_info {
unsigned short vec;
- char desc[IFNAMSIZ + 10];
+ char desc[IFNAMSIZ + 27];
unsigned int idx;
cpumask_var_t aff_mask;
};
Technical Details
Message-ID:
<20261126061756.1856-1-chenaibing@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371887-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371887-linux-kernel-netdev=dewy.ru From: chenaibing@cmss.chinamobile.com (Aibing Chen) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next] cxgb4: avoid truncating the MSI-X interrupt names Date: Thu, 26 Nov 2026 14:17:56 +0800 Organization: Usenet Network Message-ID: <20261126061756.1856-1-chenaibing@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="397103"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ETJlg3YGl8W0GPPoCkJw96tjgWk= sha256:7NgmtlwZnkLi46X4puvSRk0oEPDJofe6u1Q5JCaCebU= sha1:75AUYcCNAPTQdzlz/UrQ74AiaRY= sha256:/6QziD85M00ajZAiDdTLbC/Clyue44wTDSmJMeunDzQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DCDA3125EB2; Thu, 26 Nov 2026 09:19:29 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.75 X-Spam-Status: No, score=-2.75 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=cmss.chinamobile.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BiXL50_Q7dYi; Thu, 26 Nov 2026 09:19:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371887-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B513D125EB0; Thu, 26 Nov 2026 09:19:15 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 8C3FD3576C; Thu, 26 Nov 2026 06:19:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795673951; b=WbESnpoJyqw2rHCVNfmGMB3/Cm4aJqZS1nHDUjF8xLhZtaquZKdj12kUr5N1VyTLb7YL fsQ/3m/f43NI/5fw8Y4EbXmI2lBtKP+F+5EOe9T7oU+co77j9Hit7iDVbSx33QbnvB9Uc daWGmEWFlsbIOm9/ZBBR55KtIn0nF+5C1O5J95wPVsO5a864Uxu+QzXxWnVkarA4W/zd+ xHdmOQzJ+kw6bTovNGi8A7DLE6uLRc78s85BEi9iS+N+CUCcKUIO6S39OrsghWIfk0yBc aApTHTWYSHwoRfo1LM211235k6tplPFmBAKu+GBoJwl+uQ8UQpjfGcDkbkr4GbTPhKQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795673951; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo: X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG: Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=EK9NlA9A9Ay5zTVdixzrgGUW5jboXGbIDd6mwOWxKCk=; b=AaYSMQ8d0bpXNebbqRRYhfYFUi/RysfINWpLAUXdqhUktBmt0hyxmyvLrvTWkZ+2kgOA ayoOZRuzgZMgKSkutAarOqHzPmiEU7IPoam1oE2RmV7TTwX7nzL5xYLG9cB0SpZcKRYOd B4Lmxr9Y1LRS0W56lEuom/vmA8tZ9iHswx2PdjMX4wBS0Z7miPqm6E9xYJEEn76w6u8pw jAmZOl++NoXGdYU1VYjBuRxvcu2V2DvxOiwUG0dLiq6LU1qoglxKFmuKxe0T/PjVUttXI fCygYTnJIiPeXFQW1Q8gFCCLW6otCxXvbp1ePkgYgBx95Wq3uLMyz/pW4+pStlecK8Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=YSlz5MgE; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8429606A330; Thu, 26 Nov 2026 06:19:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=YSlz5MgE X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.135 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795673951; b=wS+P3VTHAGtWMvHPscAmY9Ju9tQa+4l+MUU89dP/1AK5/ss5zcUnnHRu2qFjGyK2x5w9 FxD46wxMAPjcXrNJYtc0ibLQtNYR8gRClgOqd8WN1NGh5n9XoIskLgu5LYcVfSN50iq1h uOq6hHfTiNc6663BjNhLhRsP+pDhNciYIOU2FLWyBB/HRhFFkDAu8JMxUafJmXANkufxh V2Yi9boNsBtOfONt/8S7LbQZiOo9cZBxotibgQtnbuBPUEAdsd7yUSZilNGKDZ4GrW2+p Z+KqK2NoVgW49+k0/WYXqlC1MP7GpeJXH/MRra2E8uEizLKhOkwTw+jczgeRVajleFw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795673951; h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received: X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From: To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=EK9NlA9A9Ay5zTVdixzrgGUW5jboXGbIDd6mwOWxKCk=; b=kWocWEcLGwwMpx3ALOwLm8A6f43m9tpLJa/FcRj35YddVIn8wcrX7DZnLB2isCvsx5Z6 47zVmyZ29iDh09fQiriy2ba90PXt/VqKa+bGzn07Z8/DCi1zutGoMxcEiSDq/yNWEaHFm 8YNtqPfwWf36frrVV5boA+vcQuajf1CCm9jFy8/gY+tkplPg0pMVX7EWmaqHGY1VSDoJa rpjO5nkLyZU5CM9o5SJc5OgReuzecflh7SsTEZ0MeLwbDORyJXGAJio3035TWq8Ochg1U E4qbqBqAw9GiA20o5CTy7lb9PeVmzzwLfMsJcPUPZAGxOGKasi5j73SAWSB+naWyEZw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=YSlz5MgE; arc=none smtp.remote-ip=111.22.67.135 X-Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [111.22.67.135]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C6AF606A31C; Thu, 26 Nov 2026 06:19:07 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5C6AF606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=YSlz5MgE46VrwhBT7bRjN0MGppo99ywOBzuzxZaT0Ek0GEfI/1fU8Jdo4+DRHCJ4dPn8DhKtD83es 2f047P3FQw5PBajK8OTbk8b5D4l3ocAWT6QR7Xan3YlQL+uQfbI2iISWc3zOVDpCi/PN/cO2+bwnM2 GGAQPXO64fdYq+UQ= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee76b07cf174f5-597f5; Thu, 26 Nov 2026 14:17:59 +0800 (CST) X-RM-TRANSID: 2ee76b07cf174f5-597f5 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from FHD-W7400297 (unknown[10.55.1.70]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee16b07cf15283-5fa97; Thu, 26 Nov 2026 14:17:59 +0800 (CST) X-RM-TRANSID: 2ee16b07cf15283-5fa97 X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.50.1.windows.1 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list