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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202210181020.6R0Y5edL-lkp@intel.com>
Date:   Tue, 18 Oct 2022 10:57:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Vadim Fedorenko <vfedorenko@...ek.ru>,
        Richard Cochran <richardcochran@...il.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org,
        Vadim Fedorenko <vadfed@...com>
Subject: Re: [PATCH net-next 5/5] ptp: ocp: remove flash image header check
 fallback

Hi Vadim,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Vadim-Fedorenko/ptp-ocp-add-support-for-Orolia-ART-CARD/20221018-060138
patch link:    https://lore.kernel.org/r/20221017215947.7438-6-vfedorenko%40novek.ru
patch subject: [PATCH net-next 5/5] ptp: ocp: remove flash image header check fallback
config: i386-allyesconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/6a4a00e6e58c585d9fe182377e261e531593f143
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Vadim-Fedorenko/ptp-ocp-add-support-for-Orolia-ART-CARD/20221018-060138
        git checkout 6a4a00e6e58c585d9fe182377e261e531593f143
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/ptp/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/ptp/ptp_ocp.c: In function 'ptp_ocp_devlink_fw_image':
>> drivers/ptp/ptp_ocp.c:1569:1: warning: label 'out' defined but not used [-Wunused-label]
    1569 | out:
         | ^~~


vim +/out +1569 drivers/ptp/ptp_ocp.c

773bda96492153 Jonathan Lemon  2021-08-03  1526  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1527  static int
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1528  ptp_ocp_devlink_fw_image(struct devlink *devlink, const struct firmware *fw,
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1529  			 const u8 **data, size_t *size)
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1530  {
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1531  	struct ptp_ocp *bp = devlink_priv(devlink);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1532  	const struct ptp_ocp_firmware_header *hdr;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1533  	size_t offset, length;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1534  	u16 crc;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1535  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1536  	hdr = (const struct ptp_ocp_firmware_header *)fw->data;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1537  	if (memcmp(hdr->magic, OCP_FIRMWARE_MAGIC_HEADER, 4)) {
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1538  		devlink_flash_update_status_notify(devlink,
6a4a00e6e58c58 Vadim Fedorenko 2022-10-18  1539  			"No firmware header found, cancel firmware upgrade",
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1540  			NULL, 0, 0);
6a4a00e6e58c58 Vadim Fedorenko 2022-10-18  1541  		return -EINVAL;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1542  	}
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1543  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1544  	if (be16_to_cpu(hdr->pci_vendor_id) != bp->pdev->vendor ||
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1545  	    be16_to_cpu(hdr->pci_device_id) != bp->pdev->device) {
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1546  		devlink_flash_update_status_notify(devlink,
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1547  			"Firmware image compatibility check failed",
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1548  			NULL, 0, 0);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1549  		return -EINVAL;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1550  	}
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1551  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1552  	offset = sizeof(*hdr);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1553  	length = be32_to_cpu(hdr->image_size);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1554  	if (length != (fw->size - offset)) {
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1555  		devlink_flash_update_status_notify(devlink,
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1556  			"Firmware image size check failed",
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1557  			NULL, 0, 0);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1558  		return -EINVAL;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1559  	}
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1560  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1561  	crc = crc16(0xffff, &fw->data[offset], length);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1562  	if (be16_to_cpu(hdr->crc) != crc) {
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1563  		devlink_flash_update_status_notify(devlink,
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1564  			"Firmware image CRC check failed",
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1565  			NULL, 0, 0);
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1566  		return -EINVAL;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1567  	}
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1568  
3c3673bde50c31 Vadim Fedorenko 2022-05-19 @1569  out:
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1570  	*data = &fw->data[offset];
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1571  	*size = length;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1572  
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1573  	return 0;
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1574  }
3c3673bde50c31 Vadim Fedorenko 2022-05-19  1575  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (288058 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ