CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Paulo Alcantara <[email protected]>
CC: Steve French <[email protected]>
CC: Shyam Prasad N <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c8c109546a19613d323a319d0c921cb1f317e629
commit: bbcce368044572d0802c3bbb8ef3fe98f581d803 cifs: split out dfs code from 
cifs_reconnect()
date:   5 days ago
:::::: branch date: 19 hours ago
:::::: commit date: 5 days ago
config: i386-randconfig-c001-20211114 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
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/torvalds/linux.git/commit/?id=bbcce368044572d0802c3bbb8ef3fe98f581d803
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout bbcce368044572d0802c3bbb8ef3fe98f581d803
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 
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 >>)
   sound/soc/intel/atom/sst/sst_pvt.c:231:2: note: Taking false branch
           if (pvt_id < 0)
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:234:6: note: Assuming 'response' is false
           if (response)
               ^~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:234:2: note: Taking false branch
           if (response)
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:238:9: note: Calling 'sst_create_ipc_msg'
                   ret = sst_create_ipc_msg(&msg, large);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:160:8: note: Calling 'kzalloc'
           msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:724:9: note: Calling 'kmalloc'
           return kmalloc(size, flags | __GFP_ZERO);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:578:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:595:2: note: Returning pointer, which participates in a 
condition later
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:724:9: note: Returning from 'kmalloc'
           return kmalloc(size, flags | __GFP_ZERO);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:724:2: note: Returning pointer, which participates in a 
condition later
           return kmalloc(size, flags | __GFP_ZERO);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:160:8: note: Returning from 'kzalloc'
           msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:161:6: note: Assuming 'msg' is non-null, 
which participates in a condition later
           if (!msg)
               ^~~~
   sound/soc/intel/atom/sst/sst_pvt.c:161:2: note: Taking false branch
           if (!msg)
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:163:6: note: Assuming 'large' is false
           if (large) {
               ^~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:163:2: note: Taking false branch
           if (large) {
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:170:3: note: Null pointer value stored to 
field 'mailbox_data'
                   msg->mailbox_data = NULL;
                   ^~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:238:9: note: Returning from 
'sst_create_ipc_msg'
                   ret = sst_create_ipc_msg(&msg, large);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:240:6: note: 'ret' is >= 0
           if (ret < 0) {
               ^~~
   sound/soc/intel/atom/sst/sst_pvt.c:240:2: note: Taking false branch
           if (ret < 0) {
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:245:2: note: Taking false branch
           dev_dbg(sst->dev, "pvt_id = %d, pipe id = %d, task = %d ipc_msg: 
%d\n",
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:250:49: note: Assuming 'sync' is true
           msg->mrfld_header.p.header_high.part.res_rqd = !sync;
                                                          ^~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:251:2: note: Taking false branch
           dev_dbg(sst->dev, "header:%x\n",
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:253:2: note: Taking false branch
           dev_dbg(sst->dev, "response rqd: %x",
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:255:2: note: Taking false branch
           dev_dbg(sst->dev, "msg->mrfld_header.p.header_low_payload:%d",
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:257:6: note: Assuming 'fill_dsp' is true
           if (fill_dsp) {
               ^~~~~~~~
   sound/soc/intel/atom/sst/sst_pvt.c:257:2: note: Taking true branch
           if (fill_dsp) {
           ^
   sound/soc/intel/atom/sst/sst_pvt.c:259:3: note: Null pointer passed as 1st 
argument to memory copy function
                   memcpy(msg->mailbox_data, &dsp_hdr, sizeof(dsp_hdr));
                   ^
   arch/x86/include/asm/string_32.h:182:25: note: expanded from macro 'memcpy'
   #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
                           ^                ~
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   5 warnings generated.
>> fs/cifs/connect.c:268:4: warning: Value stored to 'rc' is never read 
>> [clang-analyzer-deadcode.DeadStores]
                           rc = reconn_set_ipaddr_from_hostname(server);
                           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/connect.c:268:4: note: Value stored to 'rc' is never read
                           rc = reconn_set_ipaddr_from_hostname(server);
                           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/connect.c:3765:3: 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(bcc_ptr, tree);
                   ^~~~~~
   fs/cifs/connect.c:3765:3: 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(bcc_ptr, tree);
                   ^~~~~~
   fs/cifs/connect.c:3768: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(bcc_ptr, "?????");
           ^~~~~~
   fs/cifs/connect.c:3768: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(bcc_ptr, "?????");
           ^~~~~~
   Suppressed 2 warnings (2 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.
   Suppressed 2 warnings (2 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.
   9 warnings generated.
   fs/cifs/file.c:982:4: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
                           rc = server->ops->close_dir(xid, tcon, &cfile->fid);
                           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/file.c:982:4: note: Value stored to 'rc' is never read
                           rc = server->ops->close_dir(xid, tcon, &cfile->fid);
                           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/file.c:984:4: warning: Value stored to 'rc' is never read 
[clang-analyzer-deadcode.DeadStores]
                           rc = -ENOSYS;
                           ^    ~~~~~~~
   fs/cifs/file.c:984:4: note: Value stored to 'rc' is never read
                           rc = -ENOSYS;
                           ^    ~~~~~~~
   fs/cifs/file.c:1161:2: warning: Value stored to 'exist' is never read 
[clang-analyzer-deadcode.DeadStores]
           exist = false;
           ^       ~~~~~
   fs/cifs/file.c:1161:2: note: Value stored to 'exist' is never read
           exist = false;
           ^       ~~~~~
   fs/cifs/file.c:1633:3: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
                   list_for_each_entry_safe(li, tmp, &cfile->llist->locks, 
llist) {
                   ^
   include/linux/list.h:716:7: note: expanded from macro 
'list_for_each_entry_safe'
                   n = list_next_entry(pos, member);                       \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:555:2: note: expanded from macro 'list_next_entry'
           list_entry((pos)->member.next, typeof(*(pos)), member)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:494:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^~~~~
   fs/cifs/file.c:1616:6: note: Assuming the condition is false
           if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE)))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/cifs/file.c:1616:2: note: Taking false branch
           if (max_buf < (sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE)))
           ^
   fs/cifs/file.c:1619:2: note: Taking false branch
           BUILD_BUG_ON(sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE) >
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:329:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:317:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:309:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   fs/cifs/file.c:1619:2: note: Loop condition is false.  Exiting loop
           BUILD_BUG_ON(sizeof(struct smb_hdr) + sizeof(LOCKING_ANDX_RANGE) >
           ^
   include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD_BUG_ON'
           BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:329:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:317: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 {                                                            \
           ^
   fs/cifs/file.c:1621:12: note: Assuming '__UNIQUE_ID___x646' is < 
'__UNIQUE_ID___y647'
           max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr),

vim +/rc +268 fs/cifs/connect.c

bbcce368044572 Paulo Alcantara 2021-10-14  244  
43b459aa5e222c Paulo Alcantara 2021-10-14  245  /*
43b459aa5e222c Paulo Alcantara 2021-10-14  246   * cifs tcp session reconnection
43b459aa5e222c Paulo Alcantara 2021-10-14  247   *
43b459aa5e222c Paulo Alcantara 2021-10-14  248   * mark tcp session as 
reconnecting so temporarily locked
43b459aa5e222c Paulo Alcantara 2021-10-14  249   * mark all smb sessions as 
reconnecting for tcp session
43b459aa5e222c Paulo Alcantara 2021-10-14  250   * reconnect tcp session
43b459aa5e222c Paulo Alcantara 2021-10-14  251   * wake up waiters on 
reconnection? - (not needed currently)
43b459aa5e222c Paulo Alcantara 2021-10-14  252   */
bbcce368044572 Paulo Alcantara 2021-10-14  253  static int 
__cifs_reconnect(struct TCP_Server_Info *server)
43b459aa5e222c Paulo Alcantara 2021-10-14  254  {
43b459aa5e222c Paulo Alcantara 2021-10-14  255          int rc = 0;
43b459aa5e222c Paulo Alcantara 2021-10-14  256  
bbcce368044572 Paulo Alcantara 2021-10-14  257          if 
(!cifs_tcp_ses_needs_reconnect(server, 1))
bbcce368044572 Paulo Alcantara 2021-10-14  258                  return 0;
bbcce368044572 Paulo Alcantara 2021-10-14  259  
bbcce368044572 Paulo Alcantara 2021-10-14  260          
cifs_mark_tcp_ses_conns_for_reconnect(server);
bbcce368044572 Paulo Alcantara 2021-10-14  261  
bbcce368044572 Paulo Alcantara 2021-10-14  262          do {
bbcce368044572 Paulo Alcantara 2021-10-14  263                  try_to_freeze();
bbcce368044572 Paulo Alcantara 2021-10-14  264                  
mutex_lock(&server->srv_mutex);
bbcce368044572 Paulo Alcantara 2021-10-14  265  
bbcce368044572 Paulo Alcantara 2021-10-14  266                  if 
(!cifs_swn_set_server_dstaddr(server)) {
bbcce368044572 Paulo Alcantara 2021-10-14  267                          /* 
resolve the hostname again to make sure that IP address is up-to-date */
bbcce368044572 Paulo Alcantara 2021-10-14 @268                          rc = 
reconn_set_ipaddr_from_hostname(server);
bbcce368044572 Paulo Alcantara 2021-10-14  269                          
cifs_dbg(FYI, "%s: reconn_set_ipaddr_from_hostname: rc=%d\n", __func__, rc);
43b459aa5e222c Paulo Alcantara 2021-10-14  270                  }
bbcce368044572 Paulo Alcantara 2021-10-14  271  
bbcce368044572 Paulo Alcantara 2021-10-14  272                  if 
(cifs_rdma_enabled(server))
bbcce368044572 Paulo Alcantara 2021-10-14  273                          rc = 
smbd_reconnect(server);
bbcce368044572 Paulo Alcantara 2021-10-14  274                  else
bbcce368044572 Paulo Alcantara 2021-10-14  275                          rc = 
generic_ip_connect(server);
bbcce368044572 Paulo Alcantara 2021-10-14  276                  if (rc) {
bbcce368044572 Paulo Alcantara 2021-10-14  277                          
mutex_unlock(&server->srv_mutex);
bbcce368044572 Paulo Alcantara 2021-10-14  278                          
cifs_dbg(FYI, "%s: reconnect error %d\n", __func__, rc);
bbcce368044572 Paulo Alcantara 2021-10-14  279                          
msleep(3000);
43b459aa5e222c Paulo Alcantara 2021-10-14  280                  } else {
bbcce368044572 Paulo Alcantara 2021-10-14  281                          
atomic_inc(&tcpSesReconnectCount);
bbcce368044572 Paulo Alcantara 2021-10-14  282                          
set_credits(server, 1);
43b459aa5e222c Paulo Alcantara 2021-10-14  283                          
spin_lock(&GlobalMid_Lock);
bbcce368044572 Paulo Alcantara 2021-10-14  284                          if 
(server->tcpStatus != CifsExiting)
bbcce368044572 Paulo Alcantara 2021-10-14  285                                  
server->tcpStatus = CifsNeedNegotiate;
43b459aa5e222c Paulo Alcantara 2021-10-14  286                          
spin_unlock(&GlobalMid_Lock);
bbcce368044572 Paulo Alcantara 2021-10-14  287                          
cifs_swn_reset_server_dstaddr(server);
bbcce368044572 Paulo Alcantara 2021-10-14  288                          
mutex_unlock(&server->srv_mutex);
bbcce368044572 Paulo Alcantara 2021-10-14  289                  }
bbcce368044572 Paulo Alcantara 2021-10-14  290          } while 
(server->tcpStatus == CifsNeedReconnect);
bbcce368044572 Paulo Alcantara 2021-10-14  291  
bbcce368044572 Paulo Alcantara 2021-10-14  292          if (server->tcpStatus 
== CifsNeedNegotiate)
bbcce368044572 Paulo Alcantara 2021-10-14  293                  
mod_delayed_work(cifsiod_wq, &server->echo, 0);
bbcce368044572 Paulo Alcantara 2021-10-14  294  
43b459aa5e222c Paulo Alcantara 2021-10-14  295          
wake_up(&server->response_q);
43b459aa5e222c Paulo Alcantara 2021-10-14  296          return rc;
bbcce368044572 Paulo Alcantara 2021-10-14  297  }
bbcce368044572 Paulo Alcantara 2021-10-14  298  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to