Article View: linux.kernel.netdev
Article #26848[PATCH net-next v2 1/2] cxgb4: size the MSI-X interrupt name buffer
From: Aibing Chen
Date: Fri, 04 Dec 2026 09:48
Date: Fri, 04 Dec 2026 09:48
48 lines
10386 bytes
10386 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 IFNAMSIZ - 1 + 3 + 5 + 1 = 24 bytes
"%s-mirrorrxq%d" needs IFNAMSIZ - 1 + 10 + 5 + 1 = 31 bytes
"%s-%s%d" needs 2 * (IFNAMSIZ - 1) + 1 + 11 + 1 = 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, 2 * IFNAMSIZ + 11 bytes, so that the
size tracks IFNAMSIZ.
Reported-by: kernel test robot <lkp@intel.com>
Link: 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..fe5f6af9c 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[2 * IFNAMSIZ + 11];
unsigned int idx;
cpumask_var_t aff_mask;
};
Technical Details
Message-ID:
<20261204094816.116-1-chenaibing@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377224-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377224-linux-kernel-netdev=dewy.ru From: chenaibing@cmss.chinamobile.com (Aibing Chen) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v2 1/2] cxgb4: size the MSI-X interrupt name buffer Date: Fri, 4 Dec 2026 17:48:15 +0800 Organization: Usenet Network Message-ID: <20261204094816.116-1-chenaibing@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2729752"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ZZkuV0Weto1quo7h6PipD1tAbaY= sha256:O3F5lP/sK1tblTMhNLVR3nqGGD0VFNOnMtU/U/3Mv9w= sha1:B4EfxLU2aIA4bHXr+BjwyzfjVRU= sha256:OeS91RJJkJ8ML1cIhXCQkFJIpGPzqAk8lODdMUr5LTU= 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 C4173117B85; Fri, 4 Dec 2026 12:48:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.998 X-Spam-Status: No, score=-2.998 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.001, 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 gFNoQKzcWKut; Fri, 4 Dec 2026 12:48:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377224-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 34C6B117B52; Fri, 4 Dec 2026 12:48:43 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id E597B24F46; Fri, 4 Dec 2026 09:48:40 +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=1796377720; b=zGFRsQGAt7fmQEG2q0rTF40j7XUqQUi310AIgCfYAW/qdepcYbynkw3kh/WyzAkL9N66 CxEOJYjHfSBmxKh49ssklhl54DRNXmkwDaP7BjO1abDPATJZM6gzjcT+5f+W8tkcm53qm jrAVFQ9FxFtSlwNMXhEA3XeNos7BsXgWHf25lZhgwnTTBY4DJ/0SVN/s3ptmiw6xZEb4M RGfS4axPtsJLYl+axO1rbIXU8HRVRYnkRuW7ugRuD2udQr9R2tnkJV8uD6wznT5B1Vvc2 BxABC0SctEBi9PSSwUxjwJLKBc/2iXXIxL7t0Ia6GctkA+X+qqxHxjEEBtvbv+Sr/wQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796377720; 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=EhjI5Nq3w2ZWa2Nm+WuwGZrEKAtFzjS5FH80THVMvmY=; b=kGN44lqWjGGdWn4uhSNToe9Rwp0KBe3QN9h9APBVyi7ye6r2Ptdbj0JVGpIhcFeFxYus QRKcy2e9jCY5hupRDwbcGTtgj34XtdIgMkyDda/OW0qXURb145N3ZR4uCRGJCbJOKDOYZ RwLToChgxPeC5N+B8gWq+/W4ZfLGh1abnztGBIf/coN7p1dcyphcB70O6bz84C4ekquin 8MCXlZiYawvFCFyhG782VGpL5dbf5MU2jA1bHcTNB1xToY4Ls2xT2q2m7gdonsMe8XHV1 n3j1VV8pQCpdvh1MIb9mv1URoZ2lcaDcV894hj/e0w0zadedD1BrjHY94VCqK9r6EGg== 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=VniDaxkk; 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 BD69F606A333; Fri, 4 Dec 2026 09:48:40 +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=VniDaxkk 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=1796377709; b=pcxZxHZS7/vMKNTmW6LqLtFc/FsPWDzOsdPk3GAPR5NPEv2OIwEgYE4f5DhnIPmppJZC bwZGW13Mel1BytW75dvF2aUIvSmjFnwEXTpNADiq/Zo1sNgU3bsEuxLmg4lDvBpl/kaku rk7jTFn7YkyUlMh4XunPU3GKMQaIIf3uZPDx+u/56WeLestz6n0vGQnDcnBML6OdnzMyn GdquVhRQkYEeaPKLrGrT/xwGG3Z5QdJC+rbi4qd5Q9TJKRfjXFbMlgr7DJQEmVzupXbnY DlxOGfJ5BF1S/fSGlruj0E0zyhvjj/PZ2RZV6mXpO9sVUlkFLQ2tLZ8IlSh1E5ZtIzw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796377709; 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=EhjI5Nq3w2ZWa2Nm+WuwGZrEKAtFzjS5FH80THVMvmY=; b=qAkP+oiAj1XUP5Kht2NVkiI6rr8l7ZlF4cKfl5vymYSx2YskiOp2m7vhZvGuBD0K/yJ0 CpMfqOUcl3bcajj1t9uPVLAU63lix2rh0GSjvNPOQvD4bJtardqtLSEIhXKDZaRLfCBIO 1/EzrrwSxp0l7PRRPdqKizU14qDyOFjFT2Hp54eqkzdWP4E28mc00cC8zrdKoDc9N4y63 tG1sLf79CcF3I4s/S8yhzACzV16tEaHVuZKNKbCcFiVCncEeaudcxm1abGRU2IRYgKGj1 5+kpD5whlmPEVQPcPv5eLMihLT02jRVKlNt5vc0d6hmwluKz2ZhfVRzMo479RAf0JYA== 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=VniDaxkk; 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 47317606A330; Fri, 4 Dec 2026 09:48:26 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47317606A330 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=VniDaxkk5rE6aULwYKuhXqCc21RJaBp0J2LLZ4m1EuZ+iweGV67+WGhpoyn6ItldR33K6Q5gpxRWv 0o8Df38PbuSrPEtCShegDVct2LJYRWtm5juXHIOFnRD+mjtCgRIvZv0O/WDM0usPxSdTb7qnqyWd+V jVZ67bslP9TM88Yw= 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-app03-12003 (RichMail) with SMTP id 2ee36b128c62f79-71952; Fri, 04 Dec 2026 17:48:19 +0800 (CST) X-RM-TRANSID: 2ee36b128c62f79-71952 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 2ee16b128c60479-947ec; Fri, 04 Dec 2026 17:48:19 +0800 (CST) X-RM-TRANSID: 2ee16b128c60479-947ec X-Cc: 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