CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Kees Cook <[email protected]>
CC: Jakub Kicinski <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git 
net-next-mlx5
head:   77ab714f00703c91d5a6e15d7445775c80358774
commit: 1a2fb220edca98d18f90e3ef5bd6853a6b22b1b8 [26/38] skbuff: Extract list 
pointers to silence compiler warnings
:::::: branch date: 14 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-c007-20211210 
(https://download.01.org/0day-ci/archive/20211212/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git/commit/?id=1a2fb220edca98d18f90e3ef5bd6853a6b22b1b8
        git remote add saeed 
https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git
        git fetch --no-tags saeed net-next-mlx5
        git checkout 1a2fb220edca98d18f90e3ef5bd6853a6b22b1b8
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:315:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   include/linux/rculist.h:84:2: note: Loop condition is false.  Exiting loop
           rcu_assign_pointer(list_next_rcu(prev), new);
           ^
   include/linux/rcupdate.h:453:3: note: expanded from macro 
'rcu_assign_pointer'
                   smp_store_release(&p, 
RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                   ^
   include/asm-generic/barrier.h:164:2: note: expanded from macro 
'smp_store_release'
           WRITE_ONCE(*p, v);                                              \
           ^
   include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:335:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   include/linux/rculist.h:84:2: note: Dereference of null pointer
           rcu_assign_pointer(list_next_rcu(prev), new);
           ^
   include/linux/rcupdate.h:453:3: note: expanded from macro 
'rcu_assign_pointer'
                   smp_store_release(&p, 
RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:164:2: note: expanded from macro 
'smp_store_release'
           WRITE_ONCE(*p, v);                                              \
           ^~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE'
           __WRITE_ONCE(x, val);                                           \
           ^~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
           *(volatile typeof(x) *)&(x) = (val);                            \
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/vme/bridges/vme_fake.c:560:5: warning: Value stored to 'done' is 
never read [clang-analyzer-deadcode.DeadStores]
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:560:5: note: Value stored to 'done' is never 
read
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:604:3: warning: Value stored to 'done' is 
never read [clang-analyzer-deadcode.DeadStores]
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:604:3: note: Value stored to 'done' is never 
read
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:749:5: warning: Value stored to 'done' is 
never read [clang-analyzer-deadcode.DeadStores]
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:749:5: note: Value stored to 'done' is never 
read
                                   done += 1;
                                   ^       ~
   drivers/vme/bridges/vme_fake.c:794:3: warning: Value stored to 'done' is 
never read [clang-analyzer-deadcode.DeadStores]
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:794:3: note: Value stored to 'done' is never 
read
                   done += 1;
                   ^       ~
   drivers/vme/bridges/vme_fake.c:1104:2: warning: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(fake_bridge->name, driver_name);
           ^~~~~~
   drivers/vme/bridges/vme_fake.c:1104:2: note: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119
           strcpy(fake_bridge->name, driver_name);
           ^~~~~~
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
>> net/tipc/bcast.c:305:4: warning: The expression is an uninitialized value. 
>> The computed value will also be garbage 
>> [clang-analyzer-core.uninitialized.Assign]
                           (*cong_link_cnt)++;
                           ^
   net/tipc/bcast.c:392:6: note: Assuming field 'local' is false
           if (dests->local && !tipc_msg_reassemble(pkts, &localq)) {
               ^~~~~~~~~~~~
   net/tipc/bcast.c:392:19: note: Left side of '&&' is false
           if (dests->local && !tipc_msg_reassemble(pkts, &localq)) {
                            ^
   net/tipc/bcast.c:397:6: note: Assuming field 'remote' is not equal to 0
           if (dests->remote) {
               ^~~~~~~~~~~~~
   net/tipc/bcast.c:397:2: note: Taking true branch
           if (dests->remote) {
           ^
   net/tipc/bcast.c:402:7: note: Assuming the condition is false
                   if (msg_user(hdr) == MSG_FRAGMENTER)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:402:3: note: Taking false branch
                   if (msg_user(hdr) == MSG_FRAGMENTER)
                   ^
   net/tipc/bcast.c:407:7: note: Assuming 'rcast' is not equal to field 'rcast'
                   if (rcast != method->rcast) {
                       ^~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:407:3: note: Taking true branch
                   if (rcast != method->rcast) {
                   ^
   net/tipc/bcast.c:408:9: note: Calling 'tipc_mcast_send_sync'
                           rc = tipc_mcast_send_sync(net, skb, method, dests);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:324:2: note: 'cong_link_cnt' declared without an initial 
value
           u16 cong_link_cnt;
           ^~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:328:6: note: Assuming the condition is false
           if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:328:2: note: Taking false branch
           if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL))
           ^
   net/tipc/bcast.c:332:6: note: Assuming the condition is false
           if (msg_user(hdr) == MSG_FRAGMENTER)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:332:2: note: Taking false branch
           if (msg_user(hdr) == MSG_FRAGMENTER)
           ^
   net/tipc/bcast.c:334:6: note: Assuming the condition is false
           if (msg_type(hdr) != TIPC_MCAST_MSG)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:334:2: note: Taking false branch
           if (msg_type(hdr) != TIPC_MCAST_MSG)
           ^
   net/tipc/bcast.c:339:6: note: Assuming '_skb' is non-null
           if (!_skb)
               ^~~~~
   net/tipc/bcast.c:339:2: note: Taking false branch
           if (!_skb)
           ^
   net/tipc/bcast.c:352:25: note: Assuming the condition is false
           msg_set_is_rcast(_hdr, !msg_is_rcast(hdr));
                                  ^~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:357:14: note: Field 'rcast' is false
           if (method->rcast)
                       ^
   net/tipc/bcast.c:357:2: note: Taking false branch
           if (method->rcast)
           ^
   net/tipc/bcast.c:360:8: note: Calling 'tipc_rcast_xmit'
                   rc = tipc_rcast_xmit(net, &tmpq, dests, &cong_link_cnt);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:298:2: note: Loop condition is true.  Entering loop body
           list_for_each_entry_safe(dst, tmp, &dests->list, list) {
           ^
   include/linux/list.h:717:2: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
           ^
   net/tipc/bcast.c:300:7: note: Assuming the condition is false
                   if (!tipc_msg_pskb_copy(dnode, pkts, &_pkts))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:300:3: note: Taking false branch
                   if (!tipc_msg_pskb_copy(dnode, pkts, &_pkts))
                   ^
   net/tipc/bcast.c:304:7: note: Assuming the condition is true
                   if (tipc_node_xmit(net, &_pkts, dnode, selector) == 
-ELINKCONG)
                       
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/tipc/bcast.c:304:3: note: Taking true branch
                   if (tipc_node_xmit(net, &_pkts, dnode, selector) == 
-ELINKCONG)
                   ^
   net/tipc/bcast.c:305:4: note: The expression is an uninitialized value. The 
computed value will also be garbage
                           (*cong_link_cnt)++;
                           ^~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.

vim +305 net/tipc/bcast.c

5266698661401af Jon Paul Maloy 2015-10-22  279  
a853e4c6d084372 Jon Paul Maloy 2017-01-18  280  /* tipc_rcast_xmit - replicate 
and send a message to given destination nodes
a853e4c6d084372 Jon Paul Maloy 2017-01-18  281   * @net: the applicable net 
namespace
a853e4c6d084372 Jon Paul Maloy 2017-01-18  282   * @pkts: chain of buffers 
containing message
a853e4c6d084372 Jon Paul Maloy 2017-01-18  283   * @dests: list of destination 
nodes
a853e4c6d084372 Jon Paul Maloy 2017-01-18  284   * @cong_link_cnt: returns 
number of congested links
a853e4c6d084372 Jon Paul Maloy 2017-01-18  285   * @cong_links: returns 
identities of congested links
a853e4c6d084372 Jon Paul Maloy 2017-01-18  286   * Returns 0 if success, 
otherwise errno
a853e4c6d084372 Jon Paul Maloy 2017-01-18  287   */
a853e4c6d084372 Jon Paul Maloy 2017-01-18  288  static int 
tipc_rcast_xmit(struct net *net, struct sk_buff_head *pkts,
a853e4c6d084372 Jon Paul Maloy 2017-01-18  289                             
struct tipc_nlist *dests, u16 *cong_link_cnt)
a853e4c6d084372 Jon Paul Maloy 2017-01-18  290  {
a80ae5306a7346d Jon Maloy      2017-10-13  291          struct tipc_dest *dst, 
*tmp;
a853e4c6d084372 Jon Paul Maloy 2017-01-18  292          struct sk_buff_head 
_pkts;
a80ae5306a7346d Jon Maloy      2017-10-13  293          u32 dnode, selector;
a853e4c6d084372 Jon Paul Maloy 2017-01-18  294  
a853e4c6d084372 Jon Paul Maloy 2017-01-18  295          selector = 
msg_link_selector(buf_msg(skb_peek(pkts)));
e654f9f53b45fde Jon Maloy      2019-08-15  296          
__skb_queue_head_init(&_pkts);
a853e4c6d084372 Jon Paul Maloy 2017-01-18  297  
a80ae5306a7346d Jon Maloy      2017-10-13  298          
list_for_each_entry_safe(dst, tmp, &dests->list, list) {
a80ae5306a7346d Jon Maloy      2017-10-13  299                  dnode = 
dst->node;
a80ae5306a7346d Jon Maloy      2017-10-13  300                  if 
(!tipc_msg_pskb_copy(dnode, pkts, &_pkts))
a853e4c6d084372 Jon Paul Maloy 2017-01-18  301                          return 
-ENOMEM;
a853e4c6d084372 Jon Paul Maloy 2017-01-18  302  
a853e4c6d084372 Jon Paul Maloy 2017-01-18  303                  /* Any other 
return value than -ELINKCONG is ignored */
a80ae5306a7346d Jon Maloy      2017-10-13  304                  if 
(tipc_node_xmit(net, &_pkts, dnode, selector) == -ELINKCONG)
a853e4c6d084372 Jon Paul Maloy 2017-01-18 @305                          
(*cong_link_cnt)++;
a853e4c6d084372 Jon Paul Maloy 2017-01-18  306          }
a853e4c6d084372 Jon Paul Maloy 2017-01-18  307          return 0;
a853e4c6d084372 Jon Paul Maloy 2017-01-18  308  }
a853e4c6d084372 Jon Paul Maloy 2017-01-18  309  

:::::: The code at line 305 was first introduced by commit
:::::: a853e4c6d0843729e1f25a7a7beff168e1dd7420 tipc: introduce replicast as 
transport option for multicast

:::::: TO: Jon Paul Maloy <[email protected]>
:::::: CC: David S. Miller <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to