Article View: linux.kernel.netdev
Article #16212[PATCH net] net: ethernet: ti: netcp: fix queue name buffer size
From: Aibing Chen
Date: Sat, 14 Nov 2026 10:34
Date: Sat, 14 Nov 2026 10:34
46 lines
9979 bytes
9979 bytes
netcp_txpipe_open() and netcp_setup_navigator_resources() format a queue or pool name into a 16 byte stack buffer. The longest of these names is "rx-fdq-<devname>-<n>": 7 characters of prefix, IFNAMSIZ - 1 (15) characters of device name, a dash and the queue index, so it needs up to 35 bytes. Building the driver with W=1 reports a -Wformat-truncation warning for each snprintf() that formats ndev->name, e.g. for "rx-pool-%s" the compiler warns that the %s directive may write up to 15 bytes into a region of size 8. netcp_txpipe_open() formats dev_name(dev), which is not bounded by IFNAMSIZ either, so size that buffer the same way. The names are only used for knav debugfs entries and for dev_dbg() and dev_err() messages, so nothing changes apart from the names no longer being cut short. Signed-off-by: Aibing Chen <chenaibing@cmss.chinamobile.com> --- drivers/net/ethernet/ti/netcp_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c index f5e093dc9..a746b0348 100644 --- a/drivers/net/ethernet/ti/netcp_core.c +++ b/drivers/net/ethernet/ti/netcp_core.c @@ -1327,7 +1327,7 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe) struct device *dev = tx_pipe->netcp_device->device; struct knav_dma_cfg config; int ret = 0; - u8 name[16]; + u8 name[40]; memset(&config, 0, sizeof(config)); config.direction = DMA_MEM_TO_DEV; @@ -1584,7 +1584,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) struct knav_queue_notify_config notify_cfg; struct knav_dma_cfg config; u32 last_fdq = 0; - u8 name[16]; + u8 name[40]; int ret; int i;
Technical Details
Message-ID:
<20261114103452.943-1-chenaibing@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363172-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363172-linux-kernel-netdev=dewy.ru From: chenaibing@cmss.chinamobile.com (Aibing Chen) Newsgroups: linux.kernel.netdev Subject: [PATCH net] net: ethernet: ti: netcp: fix queue name buffer size Date: Sat, 14 Nov 2026 18:34:52 +0800 Organization: Usenet Network Message-ID: <20261114103452.943-1-chenaibing@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1550792"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7w3MEf8RstuvjNL3uooikGGHkx8= sha256:Ai84FttOOd3+uNHhL80AesU7gnzByEbQMBu0Sk1q/EY= sha1:XqhMMK8jt1YCSKc1AGTBMxe/Wk0= sha256:nHR6watUxGC7Tx4ngNGfF/8euwH242wzj1JqjVyIY1U= 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 653CF11479F; Sat, 14 Nov 2026 13:35:41 +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 wNIWo2h_-9zv; Sat, 14 Nov 2026 13:35:35 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363172-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 C5A6D114776; Sat, 14 Nov 2026 13:35:25 +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 983D440C4E; Sat, 14 Nov 2026 10:35:16 +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=1794652514; b=RjzgXRWALoJt0nhBc+fIw7tuMT/am4r68RX8zgRwuRoQ3IyQbTCl/704XQSAQvjGOqrV gq0UEaQApd6LR0arBYbsoGOuBfS25g218dVhSFnsPmJOrNdtV1/ggyy0m1v+QZpy2rS+W nq29mBaioP2PkbN1+r9a07G6jux8KlGaRkCLbuXmUORdaJTcJIACcoCreGOsDkXe86mD2 FgQ72U7vEWtJr7xWvOdeR5yOzolaZMf1QQUMwgqqM8odITeKPpJmolpK7ZdquicArD/pM 54TLw5lHqNWobIYYy/UDmPXXSKrvVxq3SHF01WPOcK4pELT/ojsVuvq17MtSW/p7IHA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794652514; 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=rIeGr1ZfHqgP5C0CTq+IjubXxO1HLLI0c0lBMd1W29c=; b=JyaPUynm5oy0Xj6t6RaygxN/C2HnF8y4gW8aezRuhLjVXRY7RgCv6Q4YZl5DUY7uXYR3 qAFh4aJhjLMPhF5LmswmZbl3Y1o/X5vsdWslb1sMhJFC56FBBMKon4HDXXa2bGQMRXj0v T/O7X7dLcjTTm/nVOrhk2iAqRX0YLvt6tUOTvJtJAPNXG0ju6PmoaXM1bvDQ5en89YsdW 4fb2g1H2FZK6PJfea1ckCH1TNowUshf1YB4xIPGkZLsj5SVW6fGQAFZ8x6ELoNCo1kc37 wbJ0f7Mw2WERYhPAvSHnxhWwWM1SvnIiGMZmwX4xMnHJYa8Li28pOuHZGFd9URtKqmQ== 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=CYZX7uef; 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 4FD62606A32D; Sat, 14 Nov 2026 10:35:14 +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=CYZX7uef 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=1794652508; b=aM8VigFj3qLkJEKsdJg1i8M7bEj4Peh9wiiX95KtrYBAehghVPD8lehlpB8uTuZGrs7E +33Z0QgCMx+2FhEdN7aDVoSI+TFzcNzkYL5JNrcWMPVGUKEtGXbqt7mDcCZv+YuMmXJAb VeaV1pxnFKwTP9Of8ZzUbzjURllWtOf/wIknkQs/6PVz8ZH0BKRautkYWoYSLUyJ+7PHW mZK2F/aCx76J1I5Mf4gMlrIHxvhvk5HCgSDcA+hcJ9f3lDB3pxjeexEcRqKLldwJ1xlQi n/6MM123kPLIIFcWvHQ84Cgw6Ac4hind3tRUu99VkGW7GpgGp8bYFCk43TnLNeNc+XQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794652508; 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=rIeGr1ZfHqgP5C0CTq+IjubXxO1HLLI0c0lBMd1W29c=; b=ztVuT80mlEn4JLfJNMJ+fWDVzXfUNrWRpHys5T8SB0wKh13uE8R3t4Rp/Oe3vFaqq0LU xn7dDDfYsDSYEWcxZHb+O4938ek2JXKizb7bokfjHntuNBaaj8Zus5cvywlnPKRoNFaVA mTVBFqW7CynUNmwS4iRZ6ZUeyMwc5O4U6DoC5hDTL696WW2VIOdoUtHo+HZ1Rz1OtpLHm gN0p1e8l7KRWTo+4McS97rCKWRAXscyfjEkeH3Tkp6LUVebFhQ9Il9Odk2KhiBRlyOpiH 4voDZbtdEWQ+JaYmmV16TFbvFYnd67m+Qjuyuqh50YeDZtqAZspA4/voW5ObHcX1L7w== 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=CYZX7uef; 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 411DC606A333; Sat, 14 Nov 2026 10:35:03 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 411DC606A333 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=CYZX7uefb6it+jNZqwbPLU3dltX9Gpz40G5CwyIQm6ijKJl1qWxvDd+fB7hKcbfwp0UwYi0Asgylf S2jBZ6+tvCK2i3LwWpbvG6N7pfmjArqx+A3zXwcE5Z9kSPXYrjQgDCP/wDvIxAX9gPiPGrt55G3kxK VUCKTUS5TMAo7zYo= 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-app05-12005 (RichMail) with SMTP id 2ee56af8394c1b8-ee994; Sat, 14 Nov 2026 18:34:55 +0800 (CST) X-RM-TRANSID: 2ee56af8394c1b8-ee994 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from FHD-W7400297 (unknown[10.55.1.70]) by rmsmtp-syy-appsvr08-12008 (RichMail) with SMTP id 2ee86af8394d13d-41ce7; Sat, 14 Nov 2026 18:34:55 +0800 (CST) X-RM-TRANSID: 2ee86af8394d13d-41ce7 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