tree:
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head: 41c32273d7f5666a5637a109ec004fd746d5efac
commit: a4aead6fc0566e064448dc8363333b78f7bb1545 [8324/8346] net: socket: accept redundant
network info in control message
config: parisc-randconfig-s032-20200731 (attached as .config)
compiler: hppa-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.2-115-g5fc204f2-dirty
git checkout a4aead6fc0566e064448dc8363333b78f7bb1545
# 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=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
net/core/sock.c: note: in included file (through arch/parisc/include/uapi/asm/unistd.h,
arch/parisc/include/asm/unistd.h, include/uapi/linux/unistd.h, ...):
./arch/parisc/include/generated/uapi/asm/unistd_32.h:380:41: sparse: sparse: no newline
at end of file
net/core/sock.c:2306:14: sparse: sparse: undefined identifier 'SCM_REDUNDANT'
> net/core/sock.c:2306:14: sparse: sparse: incompatible types for
'case' statement
net/core/sock.c:3102:35: sparse: sparse: undefined
identifier 'SCM_REDUNDANT'
net/core/sock.c:1910:9: sparse: sparse: context imbalance in 'sk_clone_lock' -
wrong count at exit
net/core/sock.c:1914:6: sparse: sparse: context imbalance in
'sk_free_unlock_clone' - unexpected unlock
net/core/sock.c:2306:14: sparse: sparse: Expected constant expression in case
statement
vim +/case +2306 net/core/sock.c
2269
2270 int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
2271 struct sockcm_cookie *sockc)
2272 {
2273 struct skb_redundant_info *cred;
2274 u32 tsflags;
2275
2276 switch (cmsg->cmsg_type) {
2277 case SO_MARK:
2278 if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
2279 return -EPERM;
2280 if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
2281 return -EINVAL;
2282 sockc->mark = *(u32 *)CMSG_DATA(cmsg);
2283 break;
2284 case SO_TIMESTAMPING_OLD:
2285 if (cmsg->cmsg_len != CMSG_LEN(sizeof(u32)))
2286 return -EINVAL;
2287
2288 tsflags = *(u32 *)CMSG_DATA(cmsg);
2289 if (tsflags & ~SOF_TIMESTAMPING_TX_RECORD_MASK)
2290 return -EINVAL;
2291
2292 sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK;
2293 sockc->tsflags |= tsflags;
2294 break;
2295 case SCM_TXTIME:
2296 if (!sock_flag(sk, SOCK_TXTIME))
2297 return -EINVAL;
2298 if (cmsg->cmsg_len != CMSG_LEN(sizeof(u64)))
2299 return -EINVAL;
2300 sockc->transmit_time = get_unaligned((u64 *)CMSG_DATA(cmsg));
2301 break;
2302 /* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */
2303 case SCM_RIGHTS:
2304 case SCM_CREDENTIALS:
2305 break;
2306 case SCM_REDUNDANT:
2307 if (cmsg->cmsg_len !=
2308 CMSG_LEN(sizeof(struct skb_redundant_info)))
2309 return -EINVAL;
2310
2311 cred = (struct skb_redundant_info *)CMSG_DATA(cmsg);
2312 memcpy(&sockc->redinfo, cred,
2313 sizeof(struct skb_redundant_info));
2314 break;
2315 default:
2316 return -EINVAL;
2317 }
2318 return 0;
2319 }
2320 EXPORT_SYMBOL(__sock_cmsg_send);
2321
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org