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: <202210100209.tR2Iqbqk-lkp@intel.com>
Date:   Mon, 10 Oct 2022 02:40:17 +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/pvr2fb.c:800: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-s053-20221009
compiler: mipsel-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

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/pvr2fb.c:336:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:336:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:338:31: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:345:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:347:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:349:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:540:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:541:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:560:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:569:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:573:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:574:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:579:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:580:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:581:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:584:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:585:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:588:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:591:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:595:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:595:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:596:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:600:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:612:19: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:614:17: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:616:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/video/fbdev/pvr2fb.c:800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     expected void const *
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     got char [noderef] __iomem *screen_base
>> drivers/video/fbdev/pvr2fb.c:800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     expected void const *
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     got char [noderef] __iomem *screen_base
   drivers/video/fbdev/pvr2fb.c:800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void * @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     expected void *
   drivers/video/fbdev/pvr2fb.c:800:9: sparse:     got char [noderef] __iomem *screen_base
   drivers/video/fbdev/pvr2fb.c:832:15: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:1071:11: sparse: sparse: Using plain integer as NULL pointer
   drivers/video/fbdev/pvr2fb.c:233:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:233:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:240:9: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/video/fbdev/pvr2fb.c:240:9: sparse: sparse: cast removes address space '__iomem' of expression

vim +800 drivers/video/fbdev/pvr2fb.c

0f5a5712ad1e3b drivers/video/fbdev/pvr2fb.c Bartlomiej Zolnierkiewicz 2019-06-07  761  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  762  /**
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  763   * pvr2fb_common_init
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  764   *
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  765   * Common init code for the PVR2 chips.
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  766   *
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  767   * This mostly takes care of the common aspects of the fb setup and
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  768   * registration. It's expected that the board-specific init code has
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  769   * already setup pvr2_fix with something meaningful at this point.
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  770   *
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  771   * Device info reporting is also done here, as well as picking a sane
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  772   * default from the modedb. For board-specific modelines, simply define
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  773   * a per-board modedb.
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  774   *
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  775   * Also worth noting is that the cable and video output types are likely
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  776   * always going to be VGA for the PCI-based PVR2 boards, but we leave this
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  777   * in for flexibility anyways. Who knows, maybe someone has tv-out on a
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  778   * PCI-based version of these things ;-)
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  779   */
0f5a5712ad1e3b drivers/video/fbdev/pvr2fb.c Bartlomiej Zolnierkiewicz 2019-06-07  780  static int __maybe_unused pvr2fb_common_init(void)
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  781  {
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  782  	struct pvr2fb_par *par = currentpar;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  783  	unsigned long modememused, rev;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  784  
4bdc0d676a6431 drivers/video/fbdev/pvr2fb.c Christoph Hellwig         2020-01-06  785  	fb_info->screen_base = ioremap(pvr2_fix.smem_start,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  786  					       pvr2_fix.smem_len);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  787  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  788  	if (!fb_info->screen_base) {
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  789  		printk(KERN_ERR "pvr2fb: Failed to remap smem space\n");
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  790  		goto out_err;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  791  	}
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  792  
4bdc0d676a6431 drivers/video/fbdev/pvr2fb.c Christoph Hellwig         2020-01-06  793  	par->mmio_base = ioremap(pvr2_fix.mmio_start,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  794  					 pvr2_fix.mmio_len);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  795  	if (!par->mmio_base) {
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  796  		printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n");
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  797  		goto out_err;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  798  	}
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  799  
d2b06a8b17f96b drivers/video/pvr2fb.c       Paul Mundt                2006-09-27 @800  	fb_memset(fb_info->screen_base, 0, pvr2_fix.smem_len);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  801  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  802  	pvr2_fix.ypanstep	= nopan  ? 0 : 1;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  803  	pvr2_fix.ywrapstep	= nowrap ? 0 : 1;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  804  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  805  	fb_info->fbops		= &pvr2fb_ops;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  806  	fb_info->fix		= pvr2_fix;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  807  	fb_info->par		= currentpar;
9cd1c67434544b drivers/video/pvr2fb.c       Antonino A. Daplas        2007-08-10  808  	fb_info->pseudo_palette	= currentpar->palette;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  809  	fb_info->flags		= FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  810  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  811  	if (video_output == VO_VGA)
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  812  		defmode = DEFMODE_VGA;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  813  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  814  	if (!mode_option)
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  815  		mode_option = "640x480@60";
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  816  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  817  	if (!fb_find_mode(&fb_info->var, fb_info, mode_option, pvr2_modedb,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  818  	                  NUM_TOTAL_MODES, &pvr2_modedb[defmode], 16))
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  819  		fb_info->var = pvr2_var;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  820  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  821  	fb_alloc_cmap(&fb_info->cmap, 256, 0);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  822  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  823  	if (register_framebuffer(fb_info) < 0)
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  824  		goto out_err;
306c869c237a66 drivers/video/pvr2fb.c       Adrian McMenamin          2007-08-10  825  	/*Must write PIXDEPTH to register before anything is displayed - so force init */
306c869c237a66 drivers/video/pvr2fb.c       Adrian McMenamin          2007-08-10  826  	pvr2_init_display(fb_info);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  827  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  828  	modememused = get_line_length(fb_info->var.xres_virtual,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  829  				      fb_info->var.bits_per_pixel);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  830  	modememused *= fb_info->var.yres_virtual;
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  831  
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  832  	rev = fb_readl(par->mmio_base + 0x04);
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  833  
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  834  	fb_info(fb_info, "%s (rev %ld.%ld) frame buffer device, using %ldk/%ldk of video memory\n",
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  835  		fb_info->fix.id, (rev >> 4) & 0x0f, rev & 0x0f,
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  836  		modememused >> 10,
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  837  		(unsigned long)(fb_info->fix.smem_len >> 10));
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  838  	fb_info(fb_info, "Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n",
31b6780c15a4e3 drivers/video/pvr2fb.c       Joe Perches               2013-09-19  839  		fb_info->var.xres, fb_info->var.yres,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  840  		fb_info->var.bits_per_pixel,
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  841  		get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel),
0f5a5712ad1e3b drivers/video/fbdev/pvr2fb.c Bartlomiej Zolnierkiewicz 2019-06-07  842  		pvr2_get_param_name(cables, cable_type, 3),
0f5a5712ad1e3b drivers/video/fbdev/pvr2fb.c Bartlomiej Zolnierkiewicz 2019-06-07  843  		pvr2_get_param_name(outputs, video_output, 3));
^1da177e4c3f41 drivers/video/pvr2fb.c       Linus Torvalds            2005-04-16  844  

:::::: The code at line 800 was first introduced by commit
:::::: d2b06a8b17f96b75fa1e8e7765cb900c99fd80fb video: Update pvr2fb for sq API changes.

:::::: TO: Paul Mundt <lethal@...ux-sh.org>
:::::: CC: Paul Mundt <lethal@...ux-sh.org>

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ