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: <202007090324.ReD4Ogar%lkp@intel.com>
Date:   Thu, 9 Jul 2020 03:40:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/video/fbdev/efifb.c:147:23: sparse: sparse: incorrect type
 in initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dcde237b9b0eb1d19306e6f48c0a4e058907619f
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date:   3 weeks ago
config: i386-randconfig-s001-20200709 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-37-gc9676a3b-dirty
        git checkout 670d0a4b10704667765f7d18f7592993d02783aa
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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/video/fbdev/efifb.c:147:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned char [usertype] *dst @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/efifb.c:147:23: sparse:     expected unsigned char [usertype] *dst
   drivers/video/fbdev/efifb.c:147:23: sparse:     got char [noderef] __iomem *screen_base
   drivers/video/fbdev/efifb.c:250:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/efifb.c:250:38: sparse:     expected void *addr
   drivers/video/fbdev/efifb.c:250:38: sparse:     got char [noderef] __iomem *screen_base
   drivers/video/fbdev/efifb.c:483:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected char [noderef] __iomem *screen_base @@     got void * @@
   drivers/video/fbdev/efifb.c:483:35: sparse:     expected char [noderef] __iomem *screen_base
   drivers/video/fbdev/efifb.c:483:35: sparse:     got void *
   drivers/video/fbdev/efifb.c:486:35: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected char [noderef] __iomem *screen_base @@     got void * @@
   drivers/video/fbdev/efifb.c:486:35: sparse:     expected char [noderef] __iomem *screen_base
   drivers/video/fbdev/efifb.c:486:35: sparse:     got void *
   drivers/video/fbdev/efifb.c:588:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got char [noderef] __iomem *screen_base @@
   drivers/video/fbdev/efifb.c:588:30: sparse:     expected void *addr
   drivers/video/fbdev/efifb.c:588:30: sparse:     got char [noderef] __iomem *screen_base

vim +147 drivers/video/fbdev/efifb.c

88fe4ceb244777 Hans de Goede 2018-07-24  139  
34db50e5565662 Hans de Goede 2018-07-03  140  static void efifb_show_boot_graphics(struct fb_info *info)
34db50e5565662 Hans de Goede 2018-07-03  141  {
34db50e5565662 Hans de Goede 2018-07-03  142  	u32 bmp_width, bmp_height, bmp_pitch, screen_pitch, dst_x, y, src_y;
34db50e5565662 Hans de Goede 2018-07-03  143  	struct screen_info *si = &screen_info;
34db50e5565662 Hans de Goede 2018-07-03  144  	struct bmp_file_header *file_header;
34db50e5565662 Hans de Goede 2018-07-03  145  	struct bmp_dib_header *dib_header;
34db50e5565662 Hans de Goede 2018-07-03  146  	void *bgrt_image = NULL;
34db50e5565662 Hans de Goede 2018-07-03 @147  	u8 *dst = info->screen_base;
34db50e5565662 Hans de Goede 2018-07-03  148  
cf7389b8095fab Hans de Goede 2018-09-26  149  	if (!use_bgrt)
cf7389b8095fab Hans de Goede 2018-09-26  150  		return;
cf7389b8095fab Hans de Goede 2018-09-26  151  
34db50e5565662 Hans de Goede 2018-07-03  152  	if (!bgrt_tab.image_address) {
34db50e5565662 Hans de Goede 2018-07-03  153  		pr_info("efifb: No BGRT, not showing boot graphics\n");
34db50e5565662 Hans de Goede 2018-07-03  154  		return;
34db50e5565662 Hans de Goede 2018-07-03  155  	}
34db50e5565662 Hans de Goede 2018-07-03  156  
b6b1d5119297ab Hans de Goede 2019-06-21  157  	if (bgrt_tab.status & 0x06) {
b6b1d5119297ab Hans de Goede 2019-06-21  158  		pr_info("efifb: BGRT rotation bits set, not showing boot graphics\n");
b6b1d5119297ab Hans de Goede 2019-06-21  159  		return;
b6b1d5119297ab Hans de Goede 2019-06-21  160  	}
b6b1d5119297ab Hans de Goede 2019-06-21  161  
34db50e5565662 Hans de Goede 2018-07-03  162  	/* Avoid flashing the logo if we're going to print std probe messages */
34db50e5565662 Hans de Goede 2018-07-03  163  	if (console_loglevel > CONSOLE_LOGLEVEL_QUIET)
34db50e5565662 Hans de Goede 2018-07-03  164  		return;
34db50e5565662 Hans de Goede 2018-07-03  165  
34db50e5565662 Hans de Goede 2018-07-03  166  	/* bgrt_tab.status is unreliable, so we don't check it */
34db50e5565662 Hans de Goede 2018-07-03  167  
34db50e5565662 Hans de Goede 2018-07-03  168  	if (si->lfb_depth != 32) {
34db50e5565662 Hans de Goede 2018-07-03  169  		pr_info("efifb: not 32 bits, not showing boot graphics\n");
34db50e5565662 Hans de Goede 2018-07-03  170  		return;
34db50e5565662 Hans de Goede 2018-07-03  171  	}
34db50e5565662 Hans de Goede 2018-07-03  172  
34db50e5565662 Hans de Goede 2018-07-03  173  	bgrt_image = memremap(bgrt_tab.image_address, bgrt_image_size,
34db50e5565662 Hans de Goede 2018-07-03  174  			      MEMREMAP_WB);
34db50e5565662 Hans de Goede 2018-07-03  175  	if (!bgrt_image) {
34db50e5565662 Hans de Goede 2018-07-03  176  		pr_warn("efifb: Ignoring BGRT: failed to map image memory\n");
34db50e5565662 Hans de Goede 2018-07-03  177  		return;
34db50e5565662 Hans de Goede 2018-07-03  178  	}
34db50e5565662 Hans de Goede 2018-07-03  179  
34db50e5565662 Hans de Goede 2018-07-03  180  	if (bgrt_image_size < (sizeof(*file_header) + sizeof(*dib_header)))
34db50e5565662 Hans de Goede 2018-07-03  181  		goto error;
34db50e5565662 Hans de Goede 2018-07-03  182  
34db50e5565662 Hans de Goede 2018-07-03  183  	file_header = bgrt_image;
34db50e5565662 Hans de Goede 2018-07-03  184  	if (file_header->id != 0x4d42 || file_header->reserved != 0)
34db50e5565662 Hans de Goede 2018-07-03  185  		goto error;
34db50e5565662 Hans de Goede 2018-07-03  186  
34db50e5565662 Hans de Goede 2018-07-03  187  	dib_header = bgrt_image + sizeof(*file_header);
34db50e5565662 Hans de Goede 2018-07-03  188  	if (dib_header->dib_header_size != 40 || dib_header->width < 0 ||
34db50e5565662 Hans de Goede 2018-07-03  189  	    dib_header->planes != 1 || dib_header->bpp != 24 ||
34db50e5565662 Hans de Goede 2018-07-03  190  	    dib_header->compression != 0)
34db50e5565662 Hans de Goede 2018-07-03  191  		goto error;
34db50e5565662 Hans de Goede 2018-07-03  192  
34db50e5565662 Hans de Goede 2018-07-03  193  	bmp_width = dib_header->width;
34db50e5565662 Hans de Goede 2018-07-03  194  	bmp_height = abs(dib_header->height);
34db50e5565662 Hans de Goede 2018-07-03  195  	bmp_pitch = round_up(3 * bmp_width, 4);
34db50e5565662 Hans de Goede 2018-07-03  196  	screen_pitch = si->lfb_linelength;
34db50e5565662 Hans de Goede 2018-07-03  197  
34db50e5565662 Hans de Goede 2018-07-03  198  	if ((file_header->bitmap_offset + bmp_pitch * bmp_height) >
34db50e5565662 Hans de Goede 2018-07-03  199  				bgrt_image_size)
34db50e5565662 Hans de Goede 2018-07-03  200  		goto error;
34db50e5565662 Hans de Goede 2018-07-03  201  
34db50e5565662 Hans de Goede 2018-07-03  202  	if ((bgrt_tab.image_offset_x + bmp_width) > si->lfb_width ||
34db50e5565662 Hans de Goede 2018-07-03  203  	    (bgrt_tab.image_offset_y + bmp_height) > si->lfb_height)
34db50e5565662 Hans de Goede 2018-07-03  204  		goto error;
34db50e5565662 Hans de Goede 2018-07-03  205  
88fe4ceb244777 Hans de Goede 2018-07-24  206  	if (!efifb_bgrt_sanity_check(si, bmp_width))
88fe4ceb244777 Hans de Goede 2018-07-24  207  		goto error;
88fe4ceb244777 Hans de Goede 2018-07-24  208  
34db50e5565662 Hans de Goede 2018-07-03  209  	pr_info("efifb: showing boot graphics\n");
34db50e5565662 Hans de Goede 2018-07-03  210  
34db50e5565662 Hans de Goede 2018-07-03  211  	for (y = 0; y < si->lfb_height; y++, dst += si->lfb_linelength) {
34db50e5565662 Hans de Goede 2018-07-03  212  		/* Only background? */
34db50e5565662 Hans de Goede 2018-07-03  213  		if (y < bgrt_tab.image_offset_y ||
34db50e5565662 Hans de Goede 2018-07-03  214  		    y >= (bgrt_tab.image_offset_y + bmp_height)) {
34db50e5565662 Hans de Goede 2018-07-03  215  			memset(dst, 0, 4 * si->lfb_width);
34db50e5565662 Hans de Goede 2018-07-03  216  			continue;
34db50e5565662 Hans de Goede 2018-07-03  217  		}
34db50e5565662 Hans de Goede 2018-07-03  218  
34db50e5565662 Hans de Goede 2018-07-03  219  		src_y = y - bgrt_tab.image_offset_y;
34db50e5565662 Hans de Goede 2018-07-03  220  		/* Positive header height means upside down row order */
34db50e5565662 Hans de Goede 2018-07-03  221  		if (dib_header->height > 0)
34db50e5565662 Hans de Goede 2018-07-03  222  			src_y = (bmp_height - 1) - src_y;
34db50e5565662 Hans de Goede 2018-07-03  223  
34db50e5565662 Hans de Goede 2018-07-03  224  		memset(dst, 0, bgrt_tab.image_offset_x * 4);
34db50e5565662 Hans de Goede 2018-07-03  225  		dst_x = bgrt_tab.image_offset_x;
34db50e5565662 Hans de Goede 2018-07-03  226  		efifb_copy_bmp(bgrt_image + file_header->bitmap_offset +
34db50e5565662 Hans de Goede 2018-07-03  227  					    src_y * bmp_pitch,
34db50e5565662 Hans de Goede 2018-07-03  228  			       (u32 *)dst + dst_x, bmp_width, si);
34db50e5565662 Hans de Goede 2018-07-03  229  		dst_x += bmp_width;
34db50e5565662 Hans de Goede 2018-07-03  230  		memset((u32 *)dst + dst_x, 0, (si->lfb_width - dst_x) * 4);
34db50e5565662 Hans de Goede 2018-07-03  231  	}
34db50e5565662 Hans de Goede 2018-07-03  232  
34db50e5565662 Hans de Goede 2018-07-03  233  	memunmap(bgrt_image);
34db50e5565662 Hans de Goede 2018-07-03  234  	return;
34db50e5565662 Hans de Goede 2018-07-03  235  
34db50e5565662 Hans de Goede 2018-07-03  236  error:
34db50e5565662 Hans de Goede 2018-07-03  237  	memunmap(bgrt_image);
34db50e5565662 Hans de Goede 2018-07-03  238  	pr_warn("efifb: Ignoring BGRT: unexpected or invalid BMP data\n");
34db50e5565662 Hans de Goede 2018-07-03  239  }
34db50e5565662 Hans de Goede 2018-07-03  240  #else
34db50e5565662 Hans de Goede 2018-07-03  241  static inline void efifb_show_boot_graphics(struct fb_info *info) {}
34db50e5565662 Hans de Goede 2018-07-03  242  #endif
34db50e5565662 Hans de Goede 2018-07-03  243  

:::::: The code at line 147 was first introduced by commit
:::::: 34db50e55656621c19b1a83bf896be5ac75025b9 efifb: Copy the ACPI BGRT boot graphics to the framebuffer

:::::: TO: Hans de Goede <hdegoede@...hat.com>
:::::: CC: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (44308 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ