All of lore.kernel.org
 help / color / mirror / Atom feed
* [xlnx:xlnx_rebase_v5.4 1005/1700] crypto/af_alg.c:267:54: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2021-03-02 18:17 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-02 18:17 UTC (permalink / raw)
  To: Kalyani Akula; +Cc: kbuild-all, linux-arm-kernel, Michal Simek

[-- Attachment #1: Type: text/plain, Size: 2786 bytes --]

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   49bdb4e70d2001f3a5bf0bf5e990cca4a85210f4
commit: 7132d44df68f906bc3d12d6b1437d208f91c88e5 [1005/1700] crypto: Adds user space interface for ALG_SET_KEY_TYPE
config: i386-randconfig-s002-20210302 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-241-geaceeafa-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/7132d44df68f906bc3d12d6b1437d208f91c88e5
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout 7132d44df68f906bc3d12d6b1437d208f91c88e5
        # 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@intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> crypto/af_alg.c:267:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected unsigned char const [usertype] *keytype @@     got char [noderef] <asn:1> *optval @@
   crypto/af_alg.c:267:54: sparse:     expected unsigned char const [usertype] *keytype
   crypto/af_alg.c:267:54: sparse:     got char [noderef] <asn:1> *optval

vim +267 crypto/af_alg.c

   227	
   228	static int alg_setsockopt(struct socket *sock, int level, int optname,
   229				  char __user *optval, unsigned int optlen)
   230	{
   231		struct sock *sk = sock->sk;
   232		struct alg_sock *ask = alg_sk(sk);
   233		const struct af_alg_type *type;
   234		int err = -EBUSY;
   235	
   236		lock_sock(sk);
   237		if (ask->refcnt)
   238			goto unlock;
   239	
   240		type = ask->type;
   241	
   242		err = -ENOPROTOOPT;
   243		if (level != SOL_ALG || !type)
   244			goto unlock;
   245	
   246		switch (optname) {
   247		case ALG_SET_KEY:
   248			if (sock->state == SS_CONNECTED)
   249				goto unlock;
   250			if (!type->setkey)
   251				goto unlock;
   252	
   253			err = alg_setkey(sk, optval, optlen);
   254			break;
   255		case ALG_SET_AEAD_AUTHSIZE:
   256			if (sock->state == SS_CONNECTED)
   257				goto unlock;
   258			if (!type->setauthsize)
   259				goto unlock;
   260			err = type->setauthsize(ask->private, optlen);
   261			break;
   262		case ALG_SET_KEY_TYPE:
   263			if (sock->state == SS_CONNECTED)
   264				goto unlock;
   265			if (!type->setkeytype)
   266				goto unlock;
 > 267			err = type->setkeytype(ask->private, optval, optlen);
   268		}
   269	
   270	unlock:
   271		release_sock(sk);
   272	
   273		return err;
   274	}
   275	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31961 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [xlnx:xlnx_rebase_v5.4 1005/1700] crypto/af_alg.c:267:54: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2021-03-02 18:17 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-02 18:17 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2867 bytes --]

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   49bdb4e70d2001f3a5bf0bf5e990cca4a85210f4
commit: 7132d44df68f906bc3d12d6b1437d208f91c88e5 [1005/1700] crypto: Adds user space interface for ALG_SET_KEY_TYPE
config: i386-randconfig-s002-20210302 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-241-geaceeafa-dirty
        # https://github.com/Xilinx/linux-xlnx/commit/7132d44df68f906bc3d12d6b1437d208f91c88e5
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout 7132d44df68f906bc3d12d6b1437d208f91c88e5
        # 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@intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> crypto/af_alg.c:267:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected unsigned char const [usertype] *keytype @@     got char [noderef] <asn:1> *optval @@
   crypto/af_alg.c:267:54: sparse:     expected unsigned char const [usertype] *keytype
   crypto/af_alg.c:267:54: sparse:     got char [noderef] <asn:1> *optval

vim +267 crypto/af_alg.c

   227	
   228	static int alg_setsockopt(struct socket *sock, int level, int optname,
   229				  char __user *optval, unsigned int optlen)
   230	{
   231		struct sock *sk = sock->sk;
   232		struct alg_sock *ask = alg_sk(sk);
   233		const struct af_alg_type *type;
   234		int err = -EBUSY;
   235	
   236		lock_sock(sk);
   237		if (ask->refcnt)
   238			goto unlock;
   239	
   240		type = ask->type;
   241	
   242		err = -ENOPROTOOPT;
   243		if (level != SOL_ALG || !type)
   244			goto unlock;
   245	
   246		switch (optname) {
   247		case ALG_SET_KEY:
   248			if (sock->state == SS_CONNECTED)
   249				goto unlock;
   250			if (!type->setkey)
   251				goto unlock;
   252	
   253			err = alg_setkey(sk, optval, optlen);
   254			break;
   255		case ALG_SET_AEAD_AUTHSIZE:
   256			if (sock->state == SS_CONNECTED)
   257				goto unlock;
   258			if (!type->setauthsize)
   259				goto unlock;
   260			err = type->setauthsize(ask->private, optlen);
   261			break;
   262		case ALG_SET_KEY_TYPE:
   263			if (sock->state == SS_CONNECTED)
   264				goto unlock;
   265			if (!type->setkeytype)
   266				goto unlock;
 > 267			err = type->setkeytype(ask->private, optval, optlen);
   268		}
   269	
   270	unlock:
   271		release_sock(sk);
   272	
   273		return err;
   274	}
   275	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31961 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-03 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 18:17 [xlnx:xlnx_rebase_v5.4 1005/1700] crypto/af_alg.c:267:54: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot
2021-03-02 18:17 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.