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  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:   Wed, 20 Jan 2021 09:05:28 +0800
From:   kernel test robot <lkp@...el.com>
To:     Rich Felker <dalias@...c.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: sound/soc/uniphier/aio-compress.c:295:23: sparse: sparse: incorrect
 type in argument 1 (different address spaces)

Hi Rich,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1e2a199f6ccdc15cf111d68d212e2fd4ce65682e
commit: ca6345de57a46ba1bd35bd15b0ceb42e05b3d71f sh: remove spurious circular inclusion from asm/smp.h
date:   4 months ago
config: sh-randconfig-s031-20210120 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.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.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca6345de57a46ba1bd35bd15b0ceb42e05b3d71f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ca6345de57a46ba1bd35bd15b0ceb42e05b3d71f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sh 

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 >>)"
   sound/soc/uniphier/aio-compress.c:295:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const *__gu_addr @@     got unsigned int [noderef] [usertype] __user * @@
   sound/soc/uniphier/aio-compress.c:295:23: sparse:     expected unsigned int const *__gu_addr
   sound/soc/uniphier/aio-compress.c:295:23: sparse:     got unsigned int [noderef] [usertype] __user *
>> sound/soc/uniphier/aio-compress.c:295:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int const *__gu_addr @@
   sound/soc/uniphier/aio-compress.c:295:23: sparse:     expected void const volatile [noderef] __user *ptr
   sound/soc/uniphier/aio-compress.c:295:23: sparse:     got unsigned int const *__gu_addr
   sound/soc/uniphier/aio-compress.c:309:34: sparse: sparse: cast to restricted __be16
   sound/soc/uniphier/aio-compress.c:309:34: sparse: sparse: cast to restricted __be16
   sound/soc/uniphier/aio-compress.c:309:34: sparse: sparse: cast to restricted __be16
   sound/soc/uniphier/aio-compress.c:309:34: sparse: sparse: cast to restricted __be16

vim +295 sound/soc/uniphier/aio-compress.c

e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  285  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  286  static int aio_compr_send_to_hw(struct uniphier_aio_sub *sub,
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  287  				char __user *buf, size_t dstsize)
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  288  {
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  289  	u32 __user *srcbuf = (u32 __user *)buf;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  290  	u32 *dstbuf = (u32 *)(sub->compr_area + sub->wr_offs);
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  291  	int src = 0, dst = 0, ret;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  292  	u32 frm, frm_a, frm_b;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  293  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  294  	while (dstsize > 0) {
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19 @295  		ret = get_user(frm, srcbuf + src);
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  296  		if (ret)
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  297  			return ret;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  298  		src++;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  299  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  300  		frm_a = frm & 0xffff;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  301  		frm_b = (frm >> 16) & 0xffff;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  302  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  303  		if (frm == IEC61937_HEADER_SIGN) {
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  304  			frm_a |= 0x01000000;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  305  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  306  			/* Next data is Pc and Pd */
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  307  			sub->iec_header = true;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  308  		} else {
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  309  			u16 pc = be16_to_cpu((__be16)frm_a);
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  310  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  311  			if (sub->iec_header && sub->iec_pc != pc) {
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  312  				/* Force overwrite IEC frame type */
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  313  				sub->iec_pc = pc;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  314  				ret = aio_oport_set_stream_type(sub, pc);
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  315  				if (ret)
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  316  					return ret;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  317  			}
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  318  			sub->iec_header = false;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  319  		}
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  320  		dstbuf[dst++] = frm_a;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  321  		dstbuf[dst++] = frm_b;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  322  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  323  		dstsize -= sizeof(u32) * 2;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  324  	}
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  325  
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  326  	return 0;
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  327  }
e98131222ff931a6 Katsuhiro Suzuki 2018-01-19  328  

:::::: The code at line 295 was first introduced by commit
:::::: e98131222ff931a670739cede00d1fb9d6f83763 ASoC: uniphier: add support for UniPhier AIO compress audio

:::::: TO: Katsuhiro Suzuki <suzuki.katsuhiro@...ionext.com>
:::::: CC: Mark Brown <broonie@...nel.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" (32834 bytes)

Powered by blists - more mailing lists