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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FBD6C47DAF for ; Thu, 18 Jan 2024 20:36:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C2A26B0081; Thu, 18 Jan 2024 15:36:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 672E76B0082; Thu, 18 Jan 2024 15:36:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53A1F6B0085; Thu, 18 Jan 2024 15:36:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 446656B0081 for ; Thu, 18 Jan 2024 15:36:37 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 79AFBA22CA for ; Thu, 18 Jan 2024 20:36:36 +0000 (UTC) X-FDA: 81693589992.21.A44530B Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by imf06.hostedemail.com (Postfix) with ESMTP id 3EAD918000D for ; Thu, 18 Jan 2024 20:36:34 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kZsqkLnn; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of lkp@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705610194; a=rsa-sha256; cv=none; b=t+ueoRAoSRypby7PfOmpb14tP1fvSKxTQZJRWT1up2r4QZE8dfyTBzS0Q64pMHbcg2qgAu ZWqaXXO/3HDKYNGB0nPznKXIHHN7b9SOyoNC4NmSCQ5IQ0HDnjk54CqDRZBaBIW2yKf1aA 0586m8xHVkgUTKJK5MhUzZ96S+NA5Ks= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kZsqkLnn; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of lkp@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705610194; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=QgQrS8ErnfI/UD+drRt5bEf/UPsKjnzoIjxKz97ZZ00=; b=BRwNTN5gEAS1zfm7ye75Ib2Q1XdwBFry6CHxVSzW8xOh/jCBDgeOfZMG2kf+MnEkbepStj ODAqYq0qJ//13f9nzxibKzRQ7f+kqG+6Z3x6JDXuLaxJBVEIt0TvohQtsYzKcAfupysmWU 0cYLxQsIDbWeTjWEUtxqlI8HuhofpX8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705610194; x=1737146194; h=date:from:to:cc:subject:message-id:mime-version: content-transfer-encoding; bh=CR+CPgkwVgLCbPAIyGRpihDaYVG336e/bnFESDj19dY=; b=kZsqkLnncJ9ebCGC1uO13Ig7hO88E0juOa1m/NTHGjb9MyQMDOHSFtb/ W85rlk6+yhjOuDczB1nNcxNUdALFQnfDZ+RAsUYpUR4LrQ9nK7lrK/13o 0YXw8LKtCwOI43YubhWDpWZE2ohRBaaq/AnptJQP5CneuX9u0yVZycO9q vG04rzp7vqG2qsnlqL0/LuNfBRrnyEC1FN8xgIHI2w8BrAlqaHWK+OVhM w2k5YWz64UOYc4K7Xsq9Fv0636BnfEo1JSDZ1aItTuBAFhWw1KPT7Q8Tt eXy6vRwNe1uDKYEgLP+3ORrvw82PkmzYf8OF3UnOWiq0JBFAQj94oNVNz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="391015304" X-IronPort-AV: E=Sophos;i="6.05,203,1701158400"; d="scan'208";a="391015304" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2024 12:36:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,203,1701158400"; d="scan'208";a="386852" Received: from lkp-server01.sh.intel.com (HELO 961aaaa5b03c) ([10.239.97.150]) by fmviesa003.fm.intel.com with ESMTP; 18 Jan 2024 12:36:30 -0800 Received: from kbuild by 961aaaa5b03c with local (Exim 4.96) (envelope-from ) id 1rQZ7k-0003Jq-0r; Thu, 18 Jan 2024 20:36:28 +0000 Date: Fri, 19 Jan 2024 04:36:15 +0800 From: kernel test robot To: Zhu Yanjun Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Jakub Kicinski , Xuan Zhuo Subject: [linux-next:master 13015/13783] drivers/net/virtio_net.c:4340:35: error: '%u' directive writing between 1 and 10 bytes into a region of size 9 Message-ID: <202401190425.IGYMqCJW-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3EAD918000D X-Stat-Signature: eyutptjioeggzdtyc5zg9jg43kq1sypn X-HE-Tag: 1705610194-21882 X-HE-Meta: U2FsdGVkX18XovOs74E4B/3o0Gb9J6v8BheKutHO/3M3rdNYIkandaBQT6W9TjJYLMxTo+ThEW0E0mlPeqe/VHwGU9LUYagxmGOh24qLD7o4yA26b8dk2bf/gtXV6trgoTHtRX4KcT4+UM3zC4tjG6uL1r0GaLKXaMbekvSXbEWzbMIQi9IY+olEV4OlWAiYFGbX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v7f+hWkBXcuWmS0hfx5V01X6Ox9PhR3rzL3cClNDoCVVFlfaePh43Lz/dT1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 2863b714f3ad0a9686f2de1b779228ad8c7a8052 commit: e3fe8d28c67bf6c291e920c6d04fa22afa14e6e4 [13015/13783] virtio_net: Fix "ā€˜%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings config: x86_64-sof-customedconfig-avs-defconfig (https://download.01.org/0day-ci/archive/20240119/202401190425.IGYMqCJW-lkp@intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240119/202401190425.IGYMqCJW-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202401190425.IGYMqCJW-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/net/virtio_net.c: In function 'init_vqs': drivers/net/virtio_net.c:4339:36: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=] sprintf(vi->rq[i].name, "input.%u", i); ^ drivers/net/virtio_net.c:4339:3: note: 'sprintf' output between 8 and 17 bytes into a destination of size 16 sprintf(vi->rq[i].name, "input.%u", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/net/virtio_net.c:4340:35: error: '%u' directive writing between 1 and 10 bytes into a region of size 9 [-Werror=format-overflow=] sprintf(vi->sq[i].name, "output.%u", i); ^~ drivers/net/virtio_net.c:4340:27: note: directive argument in the range [0, 2147483647] sprintf(vi->sq[i].name, "output.%u", i); ^~~~~~~~~~~ drivers/net/virtio_net.c:4340:3: note: 'sprintf' output between 9 and 18 bytes into a destination of size 16 sprintf(vi->sq[i].name, "output.%u", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors vim +4340 drivers/net/virtio_net.c 4293 4294 static int virtnet_find_vqs(struct virtnet_info *vi) 4295 { 4296 vq_callback_t **callbacks; 4297 struct virtqueue **vqs; 4298 const char **names; 4299 int ret = -ENOMEM; 4300 int total_vqs; 4301 bool *ctx; 4302 u16 i; 4303 4304 /* We expect 1 RX virtqueue followed by 1 TX virtqueue, followed by 4305 * possible N-1 RX/TX queue pairs used in multiqueue mode, followed by 4306 * possible control vq. 4307 */ 4308 total_vqs = vi->max_queue_pairs * 2 + 4309 virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); 4310 4311 /* Allocate space for find_vqs parameters */ 4312 vqs = kcalloc(total_vqs, sizeof(*vqs), GFP_KERNEL); 4313 if (!vqs) 4314 goto err_vq; 4315 callbacks = kmalloc_array(total_vqs, sizeof(*callbacks), GFP_KERNEL); 4316 if (!callbacks) 4317 goto err_callback; 4318 names = kmalloc_array(total_vqs, sizeof(*names), GFP_KERNEL); 4319 if (!names) 4320 goto err_names; 4321 if (!vi->big_packets || vi->mergeable_rx_bufs) { 4322 ctx = kcalloc(total_vqs, sizeof(*ctx), GFP_KERNEL); 4323 if (!ctx) 4324 goto err_ctx; 4325 } else { 4326 ctx = NULL; 4327 } 4328 4329 /* Parameters for control virtqueue, if any */ 4330 if (vi->has_cvq) { 4331 callbacks[total_vqs - 1] = NULL; 4332 names[total_vqs - 1] = "control"; 4333 } 4334 4335 /* Allocate/initialize parameters for send/receive virtqueues */ 4336 for (i = 0; i < vi->max_queue_pairs; i++) { 4337 callbacks[rxq2vq(i)] = skb_recv_done; 4338 callbacks[txq2vq(i)] = skb_xmit_done; 4339 sprintf(vi->rq[i].name, "input.%u", i); > 4340 sprintf(vi->sq[i].name, "output.%u", i); 4341 names[rxq2vq(i)] = vi->rq[i].name; 4342 names[txq2vq(i)] = vi->sq[i].name; 4343 if (ctx) 4344 ctx[rxq2vq(i)] = true; 4345 } 4346 4347 ret = virtio_find_vqs_ctx(vi->vdev, total_vqs, vqs, callbacks, 4348 names, ctx, NULL); 4349 if (ret) 4350 goto err_find; 4351 4352 if (vi->has_cvq) { 4353 vi->cvq = vqs[total_vqs - 1]; 4354 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN)) 4355 vi->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; 4356 } 4357 4358 for (i = 0; i < vi->max_queue_pairs; i++) { 4359 vi->rq[i].vq = vqs[rxq2vq(i)]; 4360 vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq); 4361 vi->sq[i].vq = vqs[txq2vq(i)]; 4362 } 4363 4364 /* run here: ret == 0. */ 4365 4366 4367 err_find: 4368 kfree(ctx); 4369 err_ctx: 4370 kfree(names); 4371 err_names: 4372 kfree(callbacks); 4373 err_callback: 4374 kfree(vqs); 4375 err_vq: 4376 return ret; 4377 } 4378 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki