[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
lkp at intel.com
Tue Mar 2 18:17:40 GMT 2021
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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 31961 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210303/47344fcc/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list