Article View: linux.kernel.netdev
Article #25617[PATCH net-next] xen-netback: size the queue name for multi-digit ids
From: Aibing Chen
Date: Wed, 02 Dec 2026 04:42
Date: Wed, 02 Dec 2026 04:42
47 lines
10255 bytes
10255 bytes
xenvif_connect() names each queue with
snprintf(queue->name, sizeof(queue->name), "%s-q%u",
be->vif->dev->name, queue->id);
QUEUE_NAME_SIZE is IFNAMSIZ + 5, which has room for a three digit queue
id. The interface name can be 15 characters and %u can print ten
digits, so the format can produce 28 bytes including the terminator into
a 21 byte buffer. gcc notices this in a W=1 build, and CONFIG_WERROR
turns it into a build failure:
drivers/net/xen-netback/xenbus.c:783:65: error: '%u' directive output
may be truncated writing between 1 and 10 bytes into a region of
size between 4 and 19 [-Werror=format-truncation=]
The id is bounded by the multi-queue-num-queues value that the guest
requests, which xen-netback validates against the max_queues module
parameter, but gcc analyses the full range of %u.
Size the buffer for what the format allows: IFNAMSIZ + 12 covers the 15
character interface name, "-q", ten digits and the terminator, and
IRQ_NAME_SIZE, which derives from it, still fits the "-tx" and "-rx"
suffixes.
No functional change for the default configuration.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202606111107.k8nf2OCl-lkp@intel.com/
Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com>
---
drivers/net/xen-netback/common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 17421da13..b12fbb19a 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -98,7 +98,7 @@ struct xenvif_rx_meta {
#define XEN_NETBK_LEGACY_SLOTS_MAX XEN_NETIF_NR_SLOTS_MIN
/* Queue name is interface name with "-qNNN" appended */
-#define QUEUE_NAME_SIZE (IFNAMSIZ + 5)
+#define QUEUE_NAME_SIZE (IFNAMSIZ + 12)
/* IRQ name is queue name with "-tx" or "-rx" appended */
#define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3)
Technical Details
Message-ID:
<20261202044203.292-1-chenaibing@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375569-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375569-linux-kernel-netdev=dewy.ru From: chenaibing@cmss.chinamobile.com (Aibing Chen) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next] xen-netback: size the queue name for multi-digit ids Date: Wed, 2 Dec 2026 12:42:03 +0800 Organization: Usenet Network Message-ID: <20261202044203.292-1-chenaibing@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1889017"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1dHZ3ISUqdlYA1mrTVgoZa8qKYM= sha256:cE97Kk9A2Dpg+SAg3lJSdZwKfKUd7Ps1rRewAGctLF8= sha1:MFQonAB/wLjzC0okIwBV5Yqg2J0= sha256:fpewe0bj5de47dX5Ik7iEKakOacOPOT/ZBN7kWoT2vQ= 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 4FC1B1171EB; Wed, 2 Dec 2026 07:42:36 +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 7uSngYpqL8Og; Wed, 2 Dec 2026 07:42:26 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375569-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id A3F9B117543; Wed, 2 Dec 2026 07:42:16 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 5D0F5235FC; Wed, 2 Dec 2026 04:42: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=1796186531; b=tuA+fUbXuY2sbfNkMNRJ5umQZL1H08wxOsutD1W8FOj004cicrexoudNIizctzazTfOL Koe/TQTQq06pMy1oUq78M+tvnJ5rakAwsaUskRaF2Ga3L4ymMu/ynM/AkP6CldCqgyd6r lTBffvUJRXNejfejVnfyVcmAdEx7Gm6zklOBjwr+jCoqr/AfPmC8xO86fewefKnRJQ0JZ FWca4Wp4Tv5RIe4GyhzgDaMwrCiFYAUNF4zwHLUahPt7LnfQ7bMr94WoWFNBhHlotCFkZ DxC2ZJTODyc5TU55/gYkQEMrLnrjH79J3v7il/9gaN/J7s0oVOZq0hpmg9vyX3h5/Qg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796186531; 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=JKMTYYq6Ts9mGEUBeI35H/HAI/4rS4M6Y0gwBHrJfg4=; b=UqtPRFwTy/KAUiLBFuooRMnOh5lu+88Q/s/b93RlXhtq4Nhz84ddmfj85e9JGAQ60Fvk 4lGO45U13MOSB5E02wFkKLEgTWw00+CJ2/ZeE1eOqKSskU1MlGvihfbEUFHzIUpZo/Cll bnamQiiomiEY8Q1F1C9X/Qsp0McyexRGUqHiS+XfRthRLj9xAeC/YW2kilvP26fLQjtah sfYbhVZ5ZfhHjPEK/ZA5CvQUEXvR6J8sqDbfb0TZ0l6kpFEgJaShDbf9Nxz/5xxbRgEYw PraMVAt3Z7CSJvzDnmw0tJLSMxExD1qQZzjofEyYNm+JzfdXjH9jZj6WaPJNN3RhErQ== 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=e7fbPvi5; 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 9659B606A330; Wed, 2 Dec 2026 04:42: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=e7fbPvi5 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.139 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796186530; b=AuvRclK640vqE2z5Ic5OgI9Hy8Lv6s/h9+bUP7BatayY9nyz+L0bXNYg07OYD63Gs7T0 jNHi3s44KOCyLIXC6x7IJ/I4sO9ze7C37zq362x1TwjT/KRoOMKeUx5v+79izYcS+mbV7 JMwavD30mwwIJkCrMmjYQJaQrerpiloGIrPkPoAsfPChmS/5UIt+7eWyUhbrh0UJtjTPg e5sHwrxUMT3hqevZJgXc8E47IPJezrEB0emyyoTKRqFwSWN3V8xwf7qE/Q4Azt6EGBECj Xtaa/NgAvcU/J2Eie5Lsxnb/ekhXMwFhjhgI4ZoaocVfo0XglCVYR9UmBZFycMiNv5A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796186530; 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=JKMTYYq6Ts9mGEUBeI35H/HAI/4rS4M6Y0gwBHrJfg4=; b=4P7KjBntWSbtJy7sx5PAbm5vFYC840bPZXyQPPfK/5hg6V20hljtisfi2H8X1bAA2/AC Qslbu1DF5nFGkjb/8OiWXpum/ihbpadQpiIs8ps6Jz1kIa5rokXXBRVT8cyg54elS6Clk YXY2nbSR+jPCv/U0WrzifMjJtUXwstLY3kIRzT3dRGRL2TlR0KYHluCNMjdRjG8iEqHTH AunNcLbFP9j9QRRZE/twbYz8UdsFvqeOvP6KT+rHDWOVM0bVXcFouoF/Gi58VCG9QuxC6 gxmMO4XZ+cLc4l7QVoHaB7VUkXdewmXQ12oun4+lsedk/B3kaXcN9ZOTNpIqvUR1E8w== 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=e7fbPvi5; arc=none smtp.remote-ip=111.22.67.139 X-Received: from cmccmta6.chinamobile.com (cmccmta6.chinamobile.com [111.22.67.139]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 357E6606A31A; Wed, 2 Dec 2026 04:42:07 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 357E6606A31A 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=e7fbPvi5rAI3UB2PfhabjVAC5sECmq+WcIyEwG7L2Zl7vf/w/yIk08/vP2yLxES3pmj6SVpNLvJMR Rqf4XjR9/WnbTi2f/iCCwLwePuurFl7KKb4SSyB0FCLd0VIYfBkVucLRDwL9Q7T52XPKw0gHFKctj8 7c4wtkucsFNEGJg0= 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-app09-12009 (RichMail) with SMTP id 2ee96b0fa195d41-91e21; Wed, 02 Dec 2026 12:42:05 +0800 (CST) X-RM-TRANSID: 2ee96b0fa195d41-91e21 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from FHD-W7400297 (unknown[10.55.1.70]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee46b0fa19cef7-37ad3; Wed, 02 Dec 2026 12:42:05 +0800 (CST) X-RM-TRANSID: 2ee46b0fa19cef7-37ad3 X-Cc: xen-devel@lists.xenproject.org, 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