All of lore.kernel.org
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/rxrpc-ringless 4/9] net/rxrpc/call_event.c:258:14: warning: Value stored to 'hard_ack' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-04-07 14:24 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-07 14:24 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 16714 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "GNU/Weeb Mailing List" <gwml@vger.gnuweeb.org>
CC: linux-kernel(a)vger.kernel.org
TO: David Howells <dhowells@redhat.com>

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/rxrpc-ringless
head:   a4b855ffcf1d116e65df68fa6f5df04878bc0083
commit: 569092d7590362c7148ac768a923783886248c3b [4/9] rxrpc: Don't use a ring buffer for call Tx queue
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/20220407/202204072207.x7C35wpP-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c4a1b07d0979e7ff20d7d541af666d822d66b566)
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://github.com/ammarfaizi2/linux-block/commit/569092d7590362c7148ac768a923783886248c3b
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/rxrpc-ringless
        git checkout 569092d7590362c7148ac768a923783886248c3b
        # 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 <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
                   memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
                   ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   net/8021q/vlan_dev.c:593:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
                   memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
                   ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro '__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro '__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   Suppressed 74 warnings (74 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.
   71 warnings generated.
   Suppressed 71 warnings (71 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.
   71 warnings generated.
   Suppressed 71 warnings (71 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.
   108 warnings generated.
   Suppressed 108 warnings (108 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.
   80 warnings generated.
   Suppressed 80 warnings (80 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.
   45 warnings generated.
   Suppressed 45 warnings (45 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.
   45 warnings generated.
   Suppressed 45 warnings (45 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.
   91 warnings generated.
   net/rxrpc/output.c:578:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memset(&whdr, 0, sizeof(whdr));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   net/rxrpc/output.c:578:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
           memset(&whdr, 0, sizeof(whdr));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro '__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro '__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   Suppressed 90 warnings (90 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.
   63 warnings generated.
   Suppressed 63 warnings (63 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.
   95 warnings generated.
   Suppressed 95 warnings (95 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.
   95 warnings generated.
   Suppressed 95 warnings (95 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.
   96 warnings generated.
   net/netfilter/nf_nat_amanda.c:65:2: warning: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           sprintf(buffer, "%u", port);
           ^~~~~~~
   net/netfilter/nf_nat_amanda.c:65:2: note: Call to function 'sprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
           sprintf(buffer, "%u", port);
           ^~~~~~~
   Suppressed 95 warnings (95 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.
   44 warnings generated.
   Suppressed 44 warnings (44 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.
   38 warnings generated.
   Suppressed 38 warnings (38 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.
   90 warnings generated.
   Suppressed 90 warnings (90 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.
   91 warnings generated.
>> net/rxrpc/call_event.c:258:14: warning: Value stored to 'hard_ack' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           rxrpc_seq_t hard_ack = smp_load_acquire(&call->acks_hard_ack);
                       ^~~~~~~~
   net/rxrpc/call_event.c:258:14: note: Value stored to 'hard_ack' during its initialization is never read
           rxrpc_seq_t hard_ack = smp_load_acquire(&call->acks_hard_ack);
                       ^~~~~~~~
   Suppressed 90 warnings (90 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.
   90 warnings generated.
   Suppressed 90 warnings (89 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   85 warnings generated.
   Suppressed 85 warnings (85 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.
   48 warnings generated.
   Suppressed 48 warnings (48 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.
   81 warnings generated.
   net/mac80211/debugfs_sta.c:299:6: warning: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           if (sscanf(buf, "limit %u %u %u", &ac, &q_limit_l, &q_limit_h)
               ^~~~~~
   net/mac80211/debugfs_sta.c:299:6: note: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11
           if (sscanf(buf, "limit %u %u %u", &ac, &q_limit_l, &q_limit_h)
               ^~~~~~
   net/mac80211/debugfs_sta.c:412:6: warning: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           if (sscanf(buf, "timeout=%d", &timeout) == 1) {
               ^~~~~~
   net/mac80211/debugfs_sta.c:412:6: note: Call to function 'sscanf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sscanf_s' in case of C11
           if (sscanf(buf, "timeout=%d", &timeout) == 1) {
               ^~~~~~
   net/mac80211/debugfs_sta.c:1033:2: warning: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
           ^~~~~~~~
   net/mac80211/debugfs_sta.c:1033:2: note: Call to function 'snprintf' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'snprintf_s' in case of C11
           snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
           ^~~~~~~~
   Suppressed 78 warnings (78 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 +/hard_ack +258 net/rxrpc/call_event.c

569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  251  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  252  /*
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  253   * Shrink the transmit queue.
2ad6691d988c0c net/rxrpc/call_event.c David Howells 2020-06-11  254   */
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  255  void rxrpc_shrink_call_tx_queue(struct rxrpc_call *call)
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  256  {
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  257  	struct rxrpc_txbuf *txb;
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31 @258  	rxrpc_seq_t hard_ack = smp_load_acquire(&call->acks_hard_ack);
2ad6691d988c0c net/rxrpc/call_event.c David Howells 2020-06-11  259  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  260  	_enter("%x/%x/%x", call->tx_bottom, call->acks_hard_ack, call->tx_top);
2ad6691d988c0c net/rxrpc/call_event.c David Howells 2020-06-11  261  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  262  	for (;;) {
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  263  		spin_lock(&call->tx_lock);
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  264  		txb = list_first_entry_or_null(&call->tx_queue,
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  265  					       struct rxrpc_txbuf, call_link);
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  266  		if (!txb)
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  267  			break;
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  268  		hard_ack = smp_load_acquire(&call->acks_hard_ack);
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  269  		if (before(hard_ack, txb->hdr.seq))
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  270  			break;
17926a79320afa net/rxrpc/ar-ack.c     David Howells 2007-04-26  271  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  272  		ASSERTCMP(txb->hdr.seq, ==, call->tx_bottom + 1);
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  273  		call->tx_bottom++;
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  274  		list_del_rcu(&txb->call_link);
224711df5c00f7 net/rxrpc/ar-ack.c     David Howells 2007-05-04  275  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  276  		trace_rxrpc_txqueue(call, rxrpc_txqueue_dequeue);
17926a79320afa net/rxrpc/ar-ack.c     David Howells 2007-04-26  277  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  278  		spin_unlock(&call->tx_lock);
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  279  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  280  		rxrpc_put_txbuf(txb, rxrpc_txbuf_put_rotated);
dfa7d9204054b0 net/rxrpc/call_event.c David Howells 2016-09-17  281  	}
17926a79320afa net/rxrpc/ar-ack.c     David Howells 2007-04-26  282  
569092d7590362 net/rxrpc/call_event.c David Howells 2022-03-31  283  	spin_unlock(&call->tx_lock);
17926a79320afa net/rxrpc/ar-ack.c     David Howells 2007-04-26  284  }
17926a79320afa net/rxrpc/ar-ack.c     David Howells 2007-04-26  285  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-07 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 14:24 [ammarfaizi2-block:dhowells/linux-fs/rxrpc-ringless 4/9] net/rxrpc/call_event.c:258:14: warning: Value stored to 'hard_ack' during its initialization is never read [clang-analyzer-deadcode.DeadStores] kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.