Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp311259rdb; Thu, 25 Jan 2024 16:49:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGDXf/s4zybhQ4OmrF37gzU74eeu0aNdoBZUjSSwTby6FlpbLwMjurv5/VGE6JNSQNRe/I X-Received: by 2002:a17:902:82c6:b0:1d5:b87e:eaec with SMTP id u6-20020a17090282c600b001d5b87eeaecmr499618plz.97.1706230182745; Thu, 25 Jan 2024 16:49:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706230182; cv=pass; d=google.com; s=arc-20160816; b=dHJM3JpKPvhBbBUnmJVd+KbOnLPdCJkyhNg1z70o2ZKinxnXzm8r+Fai4kA1XHSPgK Ax06uqdyFbm1kEbEy88RCW8oWQaHlN50Xl41hu4YzNMSMd1dgPzFgQsSg4JxIYpLCvpU SVqy3nUn55fhlh7G0LMoyt+O3h22EPzDRsDy3O5XzfvrKVcwSPI6sMpSk2Lc6CVbAcTL 8yN0MIEj8qaAzFe/2aY14BppB8kY3E5BKc3a3TK2wGZIhafLG1Az0QQ0gjPJXB0mKXNm aUTQ/IDp4xjJB0i3hT7t1wHzjm+U0DoZT1aV/IDc6bU0TV5KlQcNeVorQfI3lzN2caKv RePg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=57776H+2gHOO3vIcZueaM0U8jZToBFm0x+sKQSP4N2M=; fh=pkZKnpdjroO1okf0v1AfeBxDff4kA8gQjcg5aEMz5Z8=; b=PeBeYKjXFqRmYz6QsGWvaIwJUaNtZCo4yLrUvKeWALbEhiy6pagVt4ZO4WkNBRrTSP phMbrcCrIZY3s1ou9tx1ilDoMYdN31U7c+D02hMgukq8UrGyFYXb9AUklzj4v/CdE4tN AZATe1V/6agreAQgYDl0R3lcnWGhixx0CHj/M06mr9mKs3C8SmUPO/8AoH5RsRQEBfMA mJ7YZIZYxGLcp1jeW60cKE/1ZU7/lBybiQZCuBr821bNSEHnOwTSQqPSZHMYD+zXMO54 41WdJghKbY81LH6QobhoBE+a7HoUTKfhaB+TYKL8U0WIAp8/hPk0boWHTIq3ZWIRDS8W dkfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3qDekIx; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ja20-20020a170902efd400b001d7859e9d2fsi148834plb.240.2024.01.25.16.49.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 16:49:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3qDekIx; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-39471-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39471-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 66896290A43 for ; Fri, 26 Jan 2024 00:49:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58D2615CC; Fri, 26 Jan 2024 00:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="d3qDekIx" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABF5464C for ; Fri, 26 Jan 2024 00:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706230172; cv=none; b=SRXxvwmYf1TA9Pj3o66/NeV5KUKi1sB9mSFbgEpH5QfA5ucc8CodObKORotE7ehSHutE0OnT8H9272fEm+ilKEJhIWdEt0QSv5QqkWRs2v8yJrO8Sr3KOjCL/BXvyFfYYhk+wJmsseBDGljDyHepDwiWI5pEcjQZ1InunW52a2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706230172; c=relaxed/simple; bh=w2kdtJZ783fLiPG5vvC94hf/FSswyEok6jaDZlu5C8U=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=SKdpDgYgq9jeCtneFUiQfK1uH9VEekMEnCenh6ODUdffUXNhZByMGPv4BiUVwwxEgaGnUqvkcRi1S7Ir03+tYCUkKc4wzVFBv7bpxgY8bnrMut65D1QtIH0QRuA87izOrHdPSwKyZWofo/vWbSsGuShu4DPVBlZz+RbttNF6tjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=d3qDekIx; arc=none smtp.client-ip=192.55.52.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706230170; x=1737766170; h=date:from:to:cc:subject:message-id:mime-version; bh=w2kdtJZ783fLiPG5vvC94hf/FSswyEok6jaDZlu5C8U=; b=d3qDekIxUhwf7aeQ37w3eF6dk8fE0vV1XlWAtazHlkQU9dCmR+hvHL2O 8I2m52D7iYXnYTUryc1b1xqZ230ATE7KkvsJRkK+lUN3NmGkTqb/kbB16 1qtw8Yy0FfSBzmCNYwHX9Nllc5uMssYv0QXx0jW/PVKcq3TQy9cRfS5Oe IjNEBQft0dT0xnOMJvidMApoP1xmDZxB9N4oFdDHUWt9yHH0FPWtaYf6f /c8DsGsv6LlHxNpiSLZi8U+yRN4hM2NbRQjRKW5UNFRA22dMPct1OZxWd 5vYkxiTTr9oFHYXe69d69ZVcUtUUMI9ujT6wPpxLC+U/CE/cFcVgVheh5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="433503446" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="433503446" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 16:49:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="2523691" Received: from lkp-server01.sh.intel.com (HELO 370188f8dc87) ([10.239.97.150]) by fmviesa003.fm.intel.com with ESMTP; 25 Jan 2024 16:49:26 -0800 Received: from kbuild by 370188f8dc87 with local (Exim 4.96) (envelope-from ) id 1rTAPL-0000X6-32; Fri, 26 Jan 2024 00:49:23 +0000 Date: Fri, 26 Jan 2024 08:48:43 +0800 From: kernel test robot To: Daniel Axtens Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Francis Laniel , Kees Cook , Andrew Morton , Linux Memory Management List Subject: drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c:154:19: warning: '%s' directive output may be truncated writing up to 19 bytes into a region of size between 13 and 24 Message-ID: <202401260858.jZN6vD1k-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: ecb1b8288dc7ccbdcb3b9df005fa1c0e0c0388a7 commit: 6a39e62abbafd1d58d1722f40c7d26ef379c6a2f lib: string.h: detect intra-object overflow in fortified string functions date: 3 years, 1 month ago config: x86_64-randconfig-012-20240106 (https://download.01.org/0day-ci/archive/20240126/202401260858.jZN6vD1k-lkp@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401260858.jZN6vD1k-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/202401260858.jZN6vD1k-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c: In function 'bnx2x_fill_fw_str': >> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c:154:19: warning: '%s' directive output may be truncated writing up to 19 bytes into a region of size between 13 and 24 [-Wformat-truncation=] 154 | "bc %d.%d.%d%s%s", | ^~ ...... 158 | ((phy_fw_ver[0] != '\0') ? " phy " : ""), phy_fw_ver); | ~~~~~~~~~~ drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c:153:3: note: 'snprintf' output between 9 and 39 bytes into a destination of size 32 153 | snprintf(buf + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 154 | "bc %d.%d.%d%s%s", | ~~~~~~~~~~~~~~~~~~ 155 | (bp->common.bc_ver & 0xff0000) >> 16, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 156 | (bp->common.bc_ver & 0xff00) >> 8, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 157 | (bp->common.bc_ver & 0xff), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 158 | ((phy_fw_ver[0] != '\0') ? " phy " : ""), phy_fw_ver); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +154 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b3b83c3f3c640b drivers/net/bnx2x/bnx2x_cmn.c Dmitry Kravkov 2011-05-04 135 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 136 /** 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 137 * bnx2x_fill_fw_str - Fill buffer with FW version string. 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 138 * 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 139 * @bp: driver handle 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 140 * @buf: character buffer to fill with the fw name 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 141 * @buf_len: length of the above buffer 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 142 * 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 143 */ 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 144 void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len) 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 145 { 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 146 if (IS_PF(bp)) { 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 147 u8 phy_fw_ver[PHY_FW_VER_LEN]; 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 148 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 149 phy_fw_ver[0] = '\0'; 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 150 bnx2x_get_ext_phy_fw_version(&bp->link_params, 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 151 phy_fw_ver, PHY_FW_VER_LEN); 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 152 strlcpy(buf, bp->fw_ver, buf_len); 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 153 snprintf(buf + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver), 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 @154 "bc %d.%d.%d%s%s", 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 155 (bp->common.bc_ver & 0xff0000) >> 16, 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 156 (bp->common.bc_ver & 0xff00) >> 8, 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 157 (bp->common.bc_ver & 0xff), 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 158 ((phy_fw_ver[0] != '\0') ? " phy " : ""), phy_fw_ver); 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 159 } else { 6411280ac94db9 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-07 160 bnx2x_vf_fill_fw_str(bp, buf, buf_len); 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 161 } 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 162 } 8ca5e17e58c953 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c Ariel Elior 2013-01-01 163 :::::: The code at line 154 was first introduced by commit :::::: 8ca5e17e58c953b9a9dbd4974c554b25c6d70b1a bnx2x: Support of PF driver of a VF acquire request :::::: TO: Ariel Elior :::::: CC: David S. Miller -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki