lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202310210328.KaJWGR5u-lkp@intel.com>
Date:   Sat, 21 Oct 2023 03:36:05 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jack Xiao <Jack.Xiao@....com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Alex Deucher <alexander.deucher@....com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s'
 directive output may be truncated writing 1 byte into a region of size
 between 0 and 29

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c3200081020d63f6c6bfd8a6db2ae8a5b99b348a
commit: 97998b893c3000b27a780a4982e16cfc8f4ea555 drm/amd/amdgpu: introduce gc_*_mes_2.bin v2
date:   6 months ago
config: x86_64-randconfig-x051-20230809 (https://download.01.org/0day-ci/archive/20231021/202310210328.KaJWGR5u-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231021/202310210328.KaJWGR5u-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 <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310210328.KaJWGR5u-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function 'amdgpu_mes_init_microcode':
   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1448:66: warning: '%s' directive output may be truncated writing up to 1 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
    1448 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                                                                  ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1448:17: note: 'snprintf' output between 16 and 46 bytes into a destination of size 40
    1448 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1449 |                          ucode_prefix,
         |                          ~~~~~~~~~~~~~
    1450 |                          pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s' directive output may be truncated writing 1 byte into a region of size between 0 and 29 [-Wformat-truncation=]
    1443 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                                                                  ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:17: note: 'snprintf' output between 17 and 46 bytes into a destination of size 40
    1443 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1444 |                          ucode_prefix,
         |                          ~~~~~~~~~~~~~
    1445 |                          pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s' directive output may be truncated writing 2 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
    1443 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                                                                  ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:17: note: 'snprintf' output between 18 and 47 bytes into a destination of size 40
    1443 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1444 |                          ucode_prefix,
         |                          ~~~~~~~~~~~~~
    1445 |                          pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1455:62: warning: '_mes.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
    1455 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
         |                                                              ^~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1455:17: note: 'snprintf' output between 16 and 45 bytes into a destination of size 40
    1455 |                 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1456 |                          ucode_prefix);
         |                          ~~~~~~~~~~~~~


vim +1443 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c

  1430	
  1431	int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
  1432	{
  1433		const struct mes_firmware_header_v1_0 *mes_hdr;
  1434		struct amdgpu_firmware_info *info;
  1435		char ucode_prefix[30];
  1436		char fw_name[40];
  1437		bool need_retry = false;
  1438		int r;
  1439	
  1440		amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix,
  1441					       sizeof(ucode_prefix));
  1442		if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(11, 0, 0)) {
> 1443			snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
  1444				 ucode_prefix,
  1445				 pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
  1446			need_retry = true;
  1447		} else {
> 1448			snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
  1449				 ucode_prefix,
  1450				 pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
  1451		}
  1452	
  1453		r = amdgpu_ucode_request(adev, &adev->mes.fw[pipe], fw_name);
  1454		if (r && need_retry && pipe == AMDGPU_MES_SCHED_PIPE) {
> 1455			snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ