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: <202203280022.jKKn3kCk-lkp@intel.com>
Date:   Mon, 28 Mar 2022 01:06:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: drivers/gpu/drm/gma500/intel_bios.c:547:42: sparse: sparse:
 incorrect type in argument 1 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f022814633e1c600507b3a99691b4d624c2813f0
commit: 0a2b782a00f33e7d06dc43d099fa071ae97bee77 fortify: Make pointer arguments const
date:   6 weeks ago
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220328/202203280022.jKKn3kCk-lkp@intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a2b782a00f33e7d06dc43d099fa071ae97bee77
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 0a2b782a00f33e7d06dc43d099fa071ae97bee77
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/gma500/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/gma500/intel_bios.c:547:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got unsigned char [noderef] [usertype] __iomem * @@
   drivers/gpu/drm/gma500/intel_bios.c:547:42: sparse:     expected void const *const p
   drivers/gpu/drm/gma500/intel_bios.c:547:42: sparse:     got unsigned char [noderef] [usertype] __iomem *
   drivers/gpu/drm/gma500/intel_bios.c:548:40: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/gpu/drm/gma500/intel_bios.c:558:24: sparse: sparse: cast removes address space '__iomem' of expression
--
   drivers/gpu/drm/gma500/opregion.c:297:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got struct opregion_header *header @@
   drivers/gpu/drm/gma500/opregion.c:297:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/gpu/drm/gma500/opregion.c:297:25: sparse:     got struct opregion_header *header
>> drivers/gpu/drm/gma500/opregion.c:327:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const *const p @@     got void [noderef] __iomem *[assigned] base @@
   drivers/gpu/drm/gma500/opregion.c:327:20: sparse:     expected void const *const p
   drivers/gpu/drm/gma500/opregion.c:327:20: sparse:     got void [noderef] __iomem *[assigned] base
   drivers/gpu/drm/gma500/opregion.c:333:26: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct opregion_header *header @@     got void [noderef] __iomem *[assigned] base @@
   drivers/gpu/drm/gma500/opregion.c:333:26: sparse:     expected struct opregion_header *header
   drivers/gpu/drm/gma500/opregion.c:333:26: sparse:     got void [noderef] __iomem *[assigned] base
   drivers/gpu/drm/gma500/opregion.c:334:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *vbt @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/gma500/opregion.c:334:23: sparse:     expected void *vbt
   drivers/gpu/drm/gma500/opregion.c:334:23: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/gma500/opregion.c:341:32: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct opregion_acpi *acpi @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/gma500/opregion.c:341:32: sparse:     expected struct opregion_acpi *acpi
   drivers/gpu/drm/gma500/opregion.c:341:32: sparse:     got void [noderef] __iomem *
   drivers/gpu/drm/gma500/opregion.c:346:32: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct opregion_asle *asle @@     got void [noderef] __iomem * @@
   drivers/gpu/drm/gma500/opregion.c:346:32: sparse:     expected struct opregion_asle *asle
   drivers/gpu/drm/gma500/opregion.c:346:32: sparse:     got void [noderef] __iomem *

vim +547 drivers/gpu/drm/gma500/intel_bios.c

1fb28e9e737e26 Alan Cox          2012-04-25  500  
1fb28e9e737e26 Alan Cox          2012-04-25  501  
f910b411053f04 Alan Cox          2011-11-03  502  /**
f910b411053f04 Alan Cox          2011-11-03  503   * psb_intel_init_bios - initialize VBIOS settings & find VBT
f910b411053f04 Alan Cox          2011-11-03  504   * @dev: DRM device
f910b411053f04 Alan Cox          2011-11-03  505   *
f910b411053f04 Alan Cox          2011-11-03  506   * Loads the Video BIOS and checks that the VBT exists.  Sets scratch registers
f910b411053f04 Alan Cox          2011-11-03  507   * to appropriate values.
f910b411053f04 Alan Cox          2011-11-03  508   *
f910b411053f04 Alan Cox          2011-11-03  509   * VBT existence is a sanity check that is relied on by other i830_bios.c code.
f910b411053f04 Alan Cox          2011-11-03  510   * Note that it would be better to use a BIOS call to get the VBT, as BIOSes may
f910b411053f04 Alan Cox          2011-11-03  511   * feed an updated VBT back through that, compared to what we'll fetch using
f910b411053f04 Alan Cox          2011-11-03  512   * this method of groping around in the BIOS data.
f910b411053f04 Alan Cox          2011-11-03  513   *
f910b411053f04 Alan Cox          2011-11-03  514   * Returns 0 on success, nonzero on failure.
f910b411053f04 Alan Cox          2011-11-03  515   */
0317c6cecd3d6c Dan Carpenter     2012-06-27  516  int psb_intel_init_bios(struct drm_device *dev)
f910b411053f04 Alan Cox          2011-11-03  517  {
f71635e893c383 Thomas Zimmermann 2021-09-20  518  	struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
a2c68495b57986 Thomas Zimmermann 2020-12-01  519  	struct pci_dev *pdev = to_pci_dev(dev->dev);
f910b411053f04 Alan Cox          2011-11-03  520  	struct vbt_header *vbt = NULL;
1fb28e9e737e26 Alan Cox          2012-04-25  521  	struct bdb_header *bdb = NULL;
1fb28e9e737e26 Alan Cox          2012-04-25  522  	u8 __iomem *bios = NULL;
f910b411053f04 Alan Cox          2011-11-03  523  	size_t size;
f910b411053f04 Alan Cox          2011-11-03  524  	int i;
f910b411053f04 Alan Cox          2011-11-03  525  
d112a8163f8375 Zhao Yakui        2012-08-08  526  
d112a8163f8375 Zhao Yakui        2012-08-08  527  	dev_priv->panel_type = 0xff;
d112a8163f8375 Zhao Yakui        2012-08-08  528  
1fb28e9e737e26 Alan Cox          2012-04-25  529  	/* XXX Should this validation be moved to intel_opregion.c? */
1fb28e9e737e26 Alan Cox          2012-04-25  530  	if (dev_priv->opregion.vbt) {
1fb28e9e737e26 Alan Cox          2012-04-25  531  		struct vbt_header *vbt = dev_priv->opregion.vbt;
1fb28e9e737e26 Alan Cox          2012-04-25  532  		if (memcmp(vbt->signature, "$VBT", 4) == 0) {
1fb28e9e737e26 Alan Cox          2012-04-25  533  			DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
1fb28e9e737e26 Alan Cox          2012-04-25  534  					 vbt->signature);
1fb28e9e737e26 Alan Cox          2012-04-25  535  			bdb = (struct bdb_header *)((char *)vbt + vbt->bdb_offset);
1fb28e9e737e26 Alan Cox          2012-04-25  536  		} else
1fb28e9e737e26 Alan Cox          2012-04-25  537  			dev_priv->opregion.vbt = NULL;
1fb28e9e737e26 Alan Cox          2012-04-25  538  	}
1fb28e9e737e26 Alan Cox          2012-04-25  539  
1fb28e9e737e26 Alan Cox          2012-04-25  540  	if (bdb == NULL) {
f910b411053f04 Alan Cox          2011-11-03  541  		bios = pci_map_rom(pdev, &size);
f910b411053f04 Alan Cox          2011-11-03  542  		if (!bios)
f910b411053f04 Alan Cox          2011-11-03  543  			return -1;
f910b411053f04 Alan Cox          2011-11-03  544  
f910b411053f04 Alan Cox          2011-11-03  545  		/* Scour memory looking for the VBT signature */
f910b411053f04 Alan Cox          2011-11-03  546  		for (i = 0; i + 4 < size; i++) {
f910b411053f04 Alan Cox          2011-11-03 @547  			if (!memcmp(bios + i, "$VBT", 4)) {
f910b411053f04 Alan Cox          2011-11-03  548  				vbt = (struct vbt_header *)(bios + i);
f910b411053f04 Alan Cox          2011-11-03  549  				break;
f910b411053f04 Alan Cox          2011-11-03  550  			}
f910b411053f04 Alan Cox          2011-11-03  551  		}
f910b411053f04 Alan Cox          2011-11-03  552  
f910b411053f04 Alan Cox          2011-11-03  553  		if (!vbt) {
f910b411053f04 Alan Cox          2011-11-03  554  			dev_err(dev->dev, "VBT signature missing\n");
f910b411053f04 Alan Cox          2011-11-03  555  			pci_unmap_rom(pdev, bios);
f910b411053f04 Alan Cox          2011-11-03  556  			return -1;
f910b411053f04 Alan Cox          2011-11-03  557  		}
f910b411053f04 Alan Cox          2011-11-03  558  		bdb = (struct bdb_header *)(bios + i + vbt->bdb_offset);
1fb28e9e737e26 Alan Cox          2012-04-25  559  	}
f910b411053f04 Alan Cox          2011-11-03  560  
1fb28e9e737e26 Alan Cox          2012-04-25  561  	/* Grab useful general dxefinitions */
f910b411053f04 Alan Cox          2011-11-03  562  	parse_general_features(dev_priv, bdb);
642c52fcc98aa4 Alan Cox          2012-04-25  563  	parse_driver_features(dev_priv, bdb);
f910b411053f04 Alan Cox          2011-11-03  564  	parse_lfp_panel_data(dev_priv, bdb);
f910b411053f04 Alan Cox          2011-11-03  565  	parse_sdvo_panel_data(dev_priv, bdb);
1fb28e9e737e26 Alan Cox          2012-04-25  566  	parse_sdvo_device_mapping(dev_priv, bdb);
1fb28e9e737e26 Alan Cox          2012-04-25  567  	parse_device_mapping(dev_priv, bdb);
f910b411053f04 Alan Cox          2011-11-03  568  	parse_backlight_data(dev_priv, bdb);
d112a8163f8375 Zhao Yakui        2012-08-08  569  	parse_edp(dev_priv, bdb);
f910b411053f04 Alan Cox          2011-11-03  570  
1fb28e9e737e26 Alan Cox          2012-04-25  571  	if (bios)
f910b411053f04 Alan Cox          2011-11-03  572  		pci_unmap_rom(pdev, bios);
f910b411053f04 Alan Cox          2011-11-03  573  
f910b411053f04 Alan Cox          2011-11-03  574  	return 0;
f910b411053f04 Alan Cox          2011-11-03  575  }
f910b411053f04 Alan Cox          2011-11-03  576  

:::::: The code at line 547 was first introduced by commit
:::::: f910b411053f04d5ccd6219a912eaea2b6f5ea6e gma500: Add the glue to the various BIOS and firmware interfaces

:::::: TO: Alan Cox <alan@...ux.intel.com>
:::::: CC: Dave Airlie <airlied@...hat.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ