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]
Date:   Sun, 9 Oct 2022 07:31:13 +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
Subject: drivers/video/fbdev/kyro/fbdev.c:733:9: 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:   a6afa4199d3d038fbfdff5511f7523b0e30cb774
commit: 28e77cc1c0686621a4d416f599cee5ab369daa0a fortify: Detect struct member overflows in memset() at compile-time
date:   8 months ago
config: mips-randconfig-s032-20221009
compiler: mips64el-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=28e77cc1c0686621a4d416f599cee5ab369daa0a
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 28e77cc1c0686621a4d416f599cee5ab369daa0a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash drivers/video/fbdev/kyro/

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

sparse warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/kyro/fbdev.c:733:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     expected void const *
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     got char [noderef] __iomem *screen_base
>> drivers/video/fbdev/kyro/fbdev.c:733:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     expected void const *
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     got char [noderef] __iomem *screen_base
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     expected void *
   drivers/video/fbdev/kyro/fbdev.c:733:9: sparse:     got char [noderef] __iomem *screen_base

vim +733 drivers/video/fbdev/kyro/fbdev.c

^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  669  
48c68c4f1b5424 drivers/video/kyro/fbdev.c       Greg Kroah-Hartman 2012-12-21  670  static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  671  {
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  672  	struct fb_info *info;
a26968df0110bc drivers/video/kyro/fbdev.c       Antonino A. Daplas 2006-01-09  673  	struct kyrofb_info *currentpar;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  674  	unsigned long size;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  675  	int err;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  676  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  677  	if ((err = pci_enable_device(pdev))) {
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  678  		printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  679  		return err;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  680  	}
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  681  
a26968df0110bc drivers/video/kyro/fbdev.c       Antonino A. Daplas 2006-01-09  682  	info = framebuffer_alloc(sizeof(struct kyrofb_info), &pdev->dev);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  683  	if (!info)
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  684  		return -ENOMEM;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  685  
a26968df0110bc drivers/video/kyro/fbdev.c       Antonino A. Daplas 2006-01-09  686  	currentpar = info->par;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  687  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  688  	kyro_fix.smem_start = pci_resource_start(pdev, 0);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  689  	kyro_fix.smem_len   = pci_resource_len(pdev, 0);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  690  	kyro_fix.mmio_start = pci_resource_start(pdev, 1);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  691  	kyro_fix.mmio_len   = pci_resource_len(pdev, 1);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  692  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  693  	currentpar->regbase = deviceInfo.pSTGReg =
4bdc0d676a6431 drivers/video/fbdev/kyro/fbdev.c Christoph Hellwig  2020-01-06  694  		ioremap(kyro_fix.mmio_start, kyro_fix.mmio_len);
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  695  	if (!currentpar->regbase)
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  696  		goto out_free_fb;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  697  
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  698  	info->screen_base = pci_ioremap_wc_bar(pdev, 0);
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  699  	if (!info->screen_base)
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  700  		goto out_unmap_regs;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  701  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  702  	if (!nomtrr)
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  703  		currentpar->wc_cookie = arch_phys_wc_add(kyro_fix.smem_start,
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  704  							 kyro_fix.smem_len);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  705  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  706  	kyro_fix.ypanstep	= nopan ? 0 : 1;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  707  	kyro_fix.ywrapstep	= nowrap ? 0 : 1;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  708  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  709  	info->fbops		= &kyrofb_ops;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  710  	info->fix		= kyro_fix;
a26968df0110bc drivers/video/kyro/fbdev.c       Antonino A. Daplas 2006-01-09  711  	info->pseudo_palette	= currentpar->palette;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  712  	info->flags		= FBINFO_DEFAULT;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  713  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  714  	SetCoreClockPLL(deviceInfo.pSTGReg, pdev);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  715  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  716  	deviceInfo.ulNextFreeVidMem = 0;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  717  	deviceInfo.ulOverlayOffset = 0;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  718  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  719  	/* This should give a reasonable default video mode */
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  720  	if (!fb_find_mode(&info->var, info, mode_option, kyro_modedb,
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  721  			  NUM_TOTAL_MODES, &kyro_modedb[VMODE_1024_768_75], 32))
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  722  		info->var = kyro_var;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  723  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  724  	fb_alloc_cmap(&info->cmap, 256, 0);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  725  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  726  	kyrofb_set_par(info);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  727  	kyrofb_check_var(&info->var, info);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  728  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  729  	size = get_line_length(info->var.xres_virtual,
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  730  			       info->var.bits_per_pixel);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  731  	size *= info->var.yres_virtual;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  732  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16 @733  	fb_memset(info->screen_base, 0, size);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  734  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  735  	if (register_framebuffer(info) < 0)
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  736  		goto out_unmap;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  737  
31b6780c15a4e3 drivers/video/kyro/fbdev.c       Joe Perches        2013-09-19  738  	fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n",
31b6780c15a4e3 drivers/video/kyro/fbdev.c       Joe Perches        2013-09-19  739  		info->fix.id,
31b6780c15a4e3 drivers/video/kyro/fbdev.c       Joe Perches        2013-09-19  740  		info->var.xres, info->var.yres, info->var.bits_per_pixel,
31b6780c15a4e3 drivers/video/kyro/fbdev.c       Joe Perches        2013-09-19  741  		size >> 10, (unsigned long)info->fix.smem_len >> 10);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  742  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  743  	pci_set_drvdata(pdev, info);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  744  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  745  	return 0;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  746  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  747  out_unmap:
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  748  	iounmap(info->screen_base);
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  749  out_unmap_regs:
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  750  	iounmap(currentpar->regbase);
9e517ac88b2443 drivers/video/fbdev/kyro/fbdev.c Luis R. Rodriguez  2015-08-24  751  out_free_fb:
a26968df0110bc drivers/video/kyro/fbdev.c       Antonino A. Daplas 2006-01-09  752  	framebuffer_release(info);
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  753  
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  754  	return -EINVAL;
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  755  }
^1da177e4c3f41 drivers/video/kyro/fbdev.c       Linus Torvalds     2005-04-16  756  

:::::: The code at line 733 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@...970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@...970.osdl.org>

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ