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: <202006151548.kVt68f5u%lkp@intel.com>
Date:   Mon, 15 Jun 2020 15:39:59 +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,
        Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: drivers/video/fbdev/core/fbmem.c:803:39: sparse: sparse: incorrect
 type in argument 2 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b3a9e3b9622ae10064826dccb4f7a52bd88c7407
commit: 80591e61a0f7e88deaada69844e4a31280c4a38f kbuild: tell sparse about the $ARCH
date:   7 months ago
config: nios2-randconfig-s032-20200615 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-rc1-3-g55607964-dirty
        git checkout 80591e61a0f7e88deaada69844e4a31280c4a38f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=nios2 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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/core/fbmem.c:803:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const *s @@     got unsigned char [noderef] [usertype] <asn:2> *[assigned] src @@
>> drivers/video/fbdev/core/fbmem.c:803:39: sparse:     expected void const *s
   drivers/video/fbdev/core/fbmem.c:803:39: sparse:     got unsigned char [noderef] [usertype] <asn:2> *[assigned] src
>> drivers/video/fbdev/core/fbmem.c:880:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *d @@     got unsigned char [noderef] [usertype] <asn:2> *[assigned] dst @@
>> drivers/video/fbdev/core/fbmem.c:880:32: sparse:     expected void *d
   drivers/video/fbdev/core/fbmem.c:880:32: sparse:     got unsigned char [noderef] [usertype] <asn:2> *[assigned] dst

vim +803 drivers/video/fbdev/core/fbmem.c

c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  756  
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  757  static ssize_t
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  758  fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  759  {
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  760  	unsigned long p = *ppos;
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  761  	struct fb_info *info = file_fb_info(file);
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  762  	u8 *buffer, *dst;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  763  	u8 __iomem *src;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  764  	int c, cnt = 0, err = 0;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  765  	unsigned long total_size;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  766  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  767  	if (!info || ! info->screen_base)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  768  		return -ENODEV;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  769  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  770  	if (info->state != FBINFO_STATE_RUNNING)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  771  		return -EPERM;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  772  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  773  	if (info->fbops->fb_read)
3f9b0880e4a96b drivers/video/fbmem.c Antonino A. Daplas 2007-05-08  774  		return info->fbops->fb_read(info, buf, count, ppos);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  775  	
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  776  	total_size = info->screen_size;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  777  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  778  	if (total_size == 0)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  779  		total_size = info->fix.smem_len;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  780  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  781  	if (p >= total_size)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  782  		return 0;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  783  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  784  	if (count >= total_size)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  785  		count = total_size;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  786  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  787  	if (count + p > total_size)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  788  		count = total_size - p;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  789  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  790  	buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  791  			 GFP_KERNEL);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  792  	if (!buffer)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  793  		return -ENOMEM;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  794  
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  795  	src = (u8 __iomem *) (info->screen_base + p);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  796  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  797  	if (info->fbops->fb_sync)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  798  		info->fbops->fb_sync(info);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  799  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  800  	while (count) {
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  801  		c  = (count > PAGE_SIZE) ? PAGE_SIZE : count;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  802  		dst = buffer;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27 @803  		fb_memcpy_fromfb(dst, src, c);
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  804  		dst += c;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  805  		src += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  806  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  807  		if (copy_to_user(buf, buffer, c)) {
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  808  			err = -EFAULT;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  809  			break;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  810  		}
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  811  		*ppos += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  812  		buf += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  813  		cnt += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  814  		count -= c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  815  	}
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  816  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  817  	kfree(buffer);
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  818  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  819  	return (err) ? err : cnt;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  820  }
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  821  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  822  static ssize_t
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  823  fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  824  {
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  825  	unsigned long p = *ppos;
c47747fde931c0 drivers/video/fbmem.c Linus Torvalds     2011-05-11  826  	struct fb_info *info = file_fb_info(file);
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  827  	u8 *buffer, *src;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  828  	u8 __iomem *dst;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  829  	int c, cnt = 0, err = 0;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  830  	unsigned long total_size;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  831  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  832  	if (!info || !info->screen_base)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  833  		return -ENODEV;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  834  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  835  	if (info->state != FBINFO_STATE_RUNNING)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  836  		return -EPERM;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  837  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  838  	if (info->fbops->fb_write)
3f9b0880e4a96b drivers/video/fbmem.c Antonino A. Daplas 2007-05-08  839  		return info->fbops->fb_write(info, buf, count, ppos);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  840  	
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  841  	total_size = info->screen_size;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  842  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  843  	if (total_size == 0)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  844  		total_size = info->fix.smem_len;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  845  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  846  	if (p > total_size)
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  847  		return -EFBIG;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  848  
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  849  	if (count > total_size) {
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  850  		err = -EFBIG;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  851  		count = total_size;
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  852  	}
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  853  
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  854  	if (count + p > total_size) {
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  855  		if (!err)
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  856  			err = -ENOSPC;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  857  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  858  		count = total_size - p;
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  859  	}
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  860  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  861  	buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  862  			 GFP_KERNEL);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  863  	if (!buffer)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  864  		return -ENOMEM;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  865  
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  866  	dst = (u8 __iomem *) (info->screen_base + p);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  867  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  868  	if (info->fbops->fb_sync)
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  869  		info->fbops->fb_sync(info);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  870  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  871  	while (count) {
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  872  		c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  873  		src = buffer;
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  874  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  875  		if (copy_from_user(src, buf, c)) {
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  876  			err = -EFAULT;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  877  			break;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  878  		}
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  879  
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27 @880  		fb_memcpy_tofb(dst, src, c);
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  881  		dst += c;
f11b478d461b71 drivers/video/fbmem.c James Hogan        2010-10-27  882  		src += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  883  		*ppos += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  884  		buf += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  885  		cnt += c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  886  		count -= c;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  887  	}
0a484a3af905a2 drivers/video/fbmem.c Antonino A. Daplas 2006-01-09  888  
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  889  	kfree(buffer);
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  890  
6a2a88668e90cd drivers/video/fbmem.c Antonino A. Daplas 2006-04-18  891  	return (cnt) ? cnt : err;
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  892  }
^1da177e4c3f41 drivers/video/fbmem.c Linus Torvalds     2005-04-16  893  

:::::: The code at line 803 was first introduced by commit
:::::: f11b478d461b7113eb4603b3914aaf15b7788e87 fbmem: fix fb_read, fb_write unaligned accesses

:::::: TO: James Hogan <james@...anarts.com>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

---
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" (21504 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ