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: <202310182332.OXIRVcAe-lkp@intel.com>
Date:   Wed, 18 Oct 2023 23:42:30 +0800
From:   kernel test robot <lkp@...el.com>
To:     Mario Limonciello <mario.limonciello@....com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Alex Deucher <alexander.deucher@....com>,
        Lijo Lazar <lijo.lazar@....com>
Subject: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:54:
 warning: '.bin' directive output may be truncated writing 4 bytes into a
 region of size between 0 and 29

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06dc10eae55b5ceabfef287a7e5f16ceea204aa0
commit: 6b54496238cc81792f697e7b21c452cdcdbb4ac5 drm/amd: Convert SMUv11 microcode to use `amdgpu_ucode_ip_version_decode`
date:   9 months ago
config: x86_64-randconfig-r006-20230904 (https://download.01.org/0day-ci/archive/20231018/202310182332.OXIRVcAe-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/20231018/202310182332.OXIRVcAe-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/202310182332.OXIRVcAe-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c: In function 'smu_v11_0_init_microcode':
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:54: warning: '.bin' directive output may be truncated writing 4 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
     110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
         |                                                      ^~~~
   drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:110:9: note: 'snprintf' output between 12 and 41 bytes into a destination of size 36
     110 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +110 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c

    92	
    93	int smu_v11_0_init_microcode(struct smu_context *smu)
    94	{
    95		struct amdgpu_device *adev = smu->adev;
    96		char ucode_prefix[30];
    97		char fw_name[SMU_FW_NAME_LEN];
    98		int err = 0;
    99		const struct smc_firmware_header_v1_0 *hdr;
   100		const struct common_firmware_header *header;
   101		struct amdgpu_firmware_info *ucode = NULL;
   102	
   103		if (amdgpu_sriov_vf(adev) &&
   104		    ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 9)) ||
   105		     (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7))))
   106			return 0;
   107	
   108		amdgpu_ucode_ip_version_decode(adev, MP1_HWIP, ucode_prefix, sizeof(ucode_prefix));
   109	
 > 110		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
   111	
   112		err = request_firmware(&adev->pm.fw, fw_name, adev->dev);
   113		if (err)
   114			goto out;
   115		err = amdgpu_ucode_validate(adev->pm.fw);
   116		if (err)
   117			goto out;
   118	
   119		hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data;
   120		amdgpu_ucode_print_smc_hdr(&hdr->header);
   121		adev->pm.fw_version = le32_to_cpu(hdr->header.ucode_version);
   122	
   123		if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
   124			ucode = &adev->firmware.ucode[AMDGPU_UCODE_ID_SMC];
   125			ucode->ucode_id = AMDGPU_UCODE_ID_SMC;
   126			ucode->fw = adev->pm.fw;
   127			header = (const struct common_firmware_header *)ucode->fw->data;
   128			adev->firmware.fw_size +=
   129				ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE);
   130		}
   131	
   132	out:
   133		if (err) {
   134			DRM_ERROR("smu_v11_0: Failed to load firmware \"%s\"\n",
   135				  fw_name);
   136			release_firmware(adev->pm.fw);
   137			adev->pm.fw = NULL;
   138		}
   139		return err;
   140	}
   141	

-- 
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