tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: b8d954fb09872d1a3f0962b3590ecf87574ced1d [4481/23714] tipc: fix cancellation of topology subscriptions config: x86_64-randconfig-122-20240915 (https://download.01.org/0day-ci/archive/20240916/202409160357.101L4Sn7-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409160357.101L4Sn7-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409160357.101L4Sn7-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
net/tipc/topsrv.c:374:30: sparse: sparse: cast from restricted __be32 net/tipc/topsrv.c:374:30: sparse: sparse: cast from restricted __be32 net/tipc/topsrv.c:374:30: sparse: sparse: cast from restricted __be32 net/tipc/topsrv.c:374:30: sparse: sparse: cast from restricted __be32
In file included from include/linux/if_ether.h:23, from include/uapi/linux/ethtool.h:19, from include/linux/ethtool.h:18, from include/linux/netdevice.h:41, from net/tipc/core.h:52, from net/tipc/topsrv.h:40, from net/tipc/subscr.h:40, from net/tipc/topsrv.c:37: In function '__skb_insert', inlined from '__skb_queue_before' at include/linux/skbuff.h:1832:2, inlined from '__skb_queue_tail' at include/linux/skbuff.h:1866:2, inlined from 'tipc_topsrv_kern_evt' at net/tipc/topsrv.c:618:2: include/linux/skbuff.h:1726:34: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds] 1726 | next->prev = prev->next = newsk; | ~~~~~~~~~~~^~~~~~~ net/tipc/topsrv.c: In function 'tipc_topsrv_kern_evt': net/tipc/topsrv.c:608:29: note: object 'evtq' of size 80 608 | struct sk_buff_head evtq; | ^~~~ In function '__skb_insert', inlined from '__skb_queue_before' at include/linux/skbuff.h:1832:2, inlined from '__skb_queue_tail' at include/linux/skbuff.h:1866:2, inlined from 'tipc_topsrv_kern_evt' at net/tipc/topsrv.c:618:2: include/linux/skbuff.h:1726:21: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds] 1726 | next->prev = prev->next = newsk; | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ net/tipc/topsrv.c: In function 'tipc_topsrv_kern_evt': net/tipc/topsrv.c:608:29: note: object 'evtq' of size 80 608 | struct sk_buff_head evtq; | ^~~~ net/tipc/topsrv.c:82: warning: Function parameter or member 'awork' not described in 'tipc_topsrv' net/tipc/topsrv.c:82: warning: Function parameter or member 'listener' not described in 'tipc_topsrv' net/tipc/topsrv.o: warning: objtool: tipc_conn_delete_sub()+0x15d: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_kern_evt()+0x192: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_conn_rcv_sub()+0x1e9: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_conn_send_to_sock()+0x2cc: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_queue_evt()+0x115: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_kern_subscr()+0x402: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_kern_unsubscr()+0x108: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_start()+0x51c: sibling call from callable instruction with modified stack frame net/tipc/topsrv.o: warning: objtool: tipc_topsrv_stop()+0x10e: sibling call from callable instruction with modified stack frame
vim +374 net/tipc/topsrv.c
365 366 static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, 367 struct tipc_conn *con, 368 struct tipc_subscr *s) 369 { 370 struct tipc_net *tn = tipc_net(srv->net); 371 struct tipc_subscription *sub; 372 373 if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) {
374 s->filter &= __constant_ntohl(~TIPC_SUB_CANCEL);
375 tipc_conn_delete_sub(con, s); 376 return 0; 377 } 378 if (atomic_read(&tn->subscription_count) >= TIPC_MAX_SUBSCR) { 379 pr_warn("Subscription rejected, max (%u)\n", TIPC_MAX_SUBSCR); 380 return -1; 381 } 382 sub = tipc_sub_subscribe(srv->net, s, con->conid); 383 if (!sub) 384 return -1; 385 atomic_inc(&tn->subscription_count); 386 spin_lock_bh(&con->sub_lock); 387 list_add(&sub->sub_list, &con->sub_list); 388 spin_unlock_bh(&con->sub_lock); 389 return 0; 390 } 391