CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Arnd Bergmann <[email protected]>
CC: Masahiro Yamada <[email protected]>
CC: Alex Shi <[email protected]>
CC: Nick Desaulniers <[email protected]>
CC: Miguel Ojeda <[email protected]>
CC: Nathan Chancellor <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   be2d3ecedd9911fbfd7e55cc9ceac5f8b79ae4cf
commit: e8c07082a810fbb9db303a2b66b66b8d7e588b53 Kbuild: move to -std=gnu11
date:   3 weeks ago
:::::: branch date: 20 hours ago
:::::: commit date: 3 weeks ago
config: riscv-randconfig-c006-20220403 
(https://download.01.org/0day-ci/archive/20220403/[email protected]/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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e8c07082a810fbb9db303a2b66b66b8d7e588b53
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e8c07082a810fbb9db303a2b66b66b8d7e588b53
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 
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 >>)
               ^~~~
   net/core/failover.c:62:11: note: Left side of '&&' is false
           if (fops && fops->slave_pre_register &&
                    ^
   net/core/failover.c:66:46: note: Access to field 'slave_handle_frame' 
results in a dereference of a null pointer (loaded from variable 'fops')
           err = netdev_rx_handler_register(slave_dev, fops->slave_handle_frame,
                                                       ^~~~
   Suppressed 66 warnings (66 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.
   46 warnings generated.
   drivers/hid/wacom_sys.c:169:2: warning: 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 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memcpy(wacom->wacom_wac.data, raw_data, size);
           ^~~~~~
   drivers/hid/wacom_sys.c:169:2: 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(wacom->wacom_wac.data, raw_data, size);
           ^~~~~~
   drivers/hid/wacom_sys.c:323:5: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                                   ret = hid_report_raw_event(hdev,
                                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/wacom_sys.c:323:5: note: Value stored to 'ret' is never read
                                   ret = hid_report_raw_event(hdev,
                                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/wacom_sys.c:384:4: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT,
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/wacom_sys.c:384:4: note: Value stored to 'ret' is never read
                           ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT,
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/wacom_sys.c:1014:3: warning: 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 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                   memcpy(buf + 3, img + i * chunk_len, chunk_len);
                   ^~~~~~
   drivers/hid/wacom_sys.c:1014: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(buf + 3, img + i * chunk_len, chunk_len);
                   ^~~~~~
   drivers/hid/wacom_sys.c:1778: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(battery->bat_name, "wacom_battery_%ld", n);
           ^~~~~~~
   drivers/hid/wacom_sys.c:1778: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(battery->bat_name, "wacom_battery_%ld", n);
           ^~~~~~~
   drivers/hid/wacom_sys.c:1861:9: 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]
           return sprintf(buf, "%d\n", mode < 3 ? mode : -1);
                  ^~~~~~~
   drivers/hid/wacom_sys.c:1861:9: 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
           return sprintf(buf, "%d\n", mode < 3 ? mode : -1);
                  ^~~~~~~
   drivers/hid/wacom_sys.c:2224:4: 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(name, sizeof(name), "%s %X",
                           ^~~~~~~~
   drivers/hid/wacom_sys.c:2224:4: 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(name, sizeof(name), "%s %X",
                           ^~~~~~~~
   drivers/hid/wacom_sys.c:2231:4: 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(name, sizeof(name), "Wacom %s", 
product_name);
                           ^~~~~~~~
   drivers/hid/wacom_sys.c:2231:4: 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(name, sizeof(name), "Wacom %s", 
product_name);
                           ^~~~~~~~
   drivers/hid/wacom_sys.c:2240:4: warning: Call to function 'memmove' 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 'memmove_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
                           memmove(gap, gap+1, strlen(gap));
                           ^~~~~~~
   drivers/hid/wacom_sys.c:2240:4: note: Call to function 'memmove' 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 'memmove_s' in case of C11
                           memmove(gap, gap+1, strlen(gap));
                           ^~~~~~~
   drivers/hid/wacom_sys.c:2250: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(wacom_wac->name, sizeof(wacom_wac->name), "%s%s",
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2250: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(wacom_wac->name, sizeof(wacom_wac->name), "%s%s",
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2254: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(wacom_wac->pen_name, sizeof(wacom_wac->pen_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2254: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(wacom_wac->pen_name, sizeof(wacom_wac->pen_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2256: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(wacom_wac->touch_name, sizeof(wacom_wac->touch_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2256: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(wacom_wac->touch_name, sizeof(wacom_wac->touch_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2258: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(wacom_wac->pad_name, sizeof(wacom_wac->pad_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2258: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(wacom_wac->pad_name, sizeof(wacom_wac->pad_name),
           ^~~~~~~~
   drivers/hid/wacom_sys.c:2423:3: warning: Value stored to 'error' is never 
read [clang-analyzer-deadcode.DeadStores]
                   error = hid_hw_open(hdev);
                   ^       ~~~~~~~~~~~~~~~~~
   drivers/hid/wacom_sys.c:2423:3: note: Value stored to 'error' is never read
                   error = hid_hw_open(hdev);
                   ^       ~~~~~~~~~~~~~~~~~
   Suppressed 32 warnings (32 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.
   65 warnings generated.
>> drivers/net/arcnet/com20020-pci.c:103:9: warning: Call to function 'sprintf' 
>> is insecure as it does not provide bounding of the memory buffer or 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]
           return sprintf(buf, "%s\n", lp->backplane ? "true" : "false");
                  ^~~~~~~
   drivers/net/arcnet/com20020-pci.c:103:9: note: Call to function 'sprintf' is 
insecure as it does not provide bounding of the memory buffer or 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
           return sprintf(buf, "%s\n", lp->backplane ? "true" : "false");
                  ^~~~~~~
   drivers/net/arcnet/com20020-pci.c:218:3: 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(dev->name, sizeof(dev->name), "arc%d-%d", 
dev->dev_id, i);
                   ^~~~~~~~
   drivers/net/arcnet/com20020-pci.c:218:3: 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(dev->name, sizeof(dev->name), "arc%d-%d", 
dev->dev_id, i);
                   ^~~~~~~~
   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.
   90 warnings generated.
   drivers/net/ppp/ppp_generic.c:1169:5: 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(ppp->dev->name, IFNAMSIZ, "ppp%i", 
ret);
                                   ^~~~~~~~
   drivers/net/ppp/ppp_generic.c:1169:5: 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(ppp->dev->name, IFNAMSIZ, "ppp%i", 
ret);
                                   ^~~~~~~~
   drivers/net/ppp/ppp_generic.c:1198:3: 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(ppp->dev->name, IFNAMSIZ, "ppp%i", ppp->file.index);
                   ^~~~~~~~
   drivers/net/ppp/ppp_generic.c:1198:3: 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(ppp->dev->name, IFNAMSIZ, "ppp%i", ppp->file.index);
                   ^~~~~~~~
   drivers/net/ppp/ppp_generic.c:1490:3: 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(&cstats, 0, sizeof(cstats));
                   ^~~~~~
   drivers/net/ppp/ppp_generic.c:1490:3: 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(&cstats, 0, sizeof(cstats));
                   ^~~~~~
   drivers/net/ppp/ppp_generic.c:2051:59: warning: Division by zero 
[clang-analyzer-core.DivideZero]
                                   flen = (((totfree - nzero)*(totlen + 
hdrlen*totfree)) /
                                           
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   drivers/net/ppp/ppp_generic.c:1928:2: note: The value 0 is assigned to 
'totspeed'
           totspeed = 0; /*total bitrate of the bundle*/
           ^~~~~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1936:12: note: Assuming the condition is false
           hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1936:11: note: '?' condition is false
           hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
                    ^
   drivers/net/ppp/ppp_generic.c:1938:2: note: Loop condition is true.  
Entering loop body
           list_for_each_entry(pch, &ppp->channels, clist) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/net/ppp/ppp_generic.c:1939:7: note: Assuming field 'chan' is non-null
                   if (pch->chan) {
                       ^~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1939:3: note: Taking true branch
                   if (pch->chan) {
                   ^
   drivers/net/ppp/ppp_generic.c:1946:12: note: Field 'avail' is 1
                   if (pch->avail) {
                            ^
   drivers/net/ppp/ppp_generic.c:1946:3: note: Taking true branch
                   if (pch->avail) {
                   ^
   drivers/net/ppp/ppp_generic.c:1947:8: note: Assuming the condition is true
                           if (skb_queue_empty(&pch->file.xq) ||
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1947:39: note: Left side of '||' is true
                           if (skb_queue_empty(&pch->file.xq) ||
                                                              ^
   drivers/net/ppp/ppp_generic.c:1949:10: note: Assuming field 'speed' is equal 
to 0
                                           if (pch->speed == 0)
                                               ^~~~~~~~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1949:6: note: Taking true branch
                                           if (pch->speed == 0)
                                           ^
   drivers/net/ppp/ppp_generic.c:1958:8: note: Assuming field 'had_frag' is not 
equal to 0
                           if (!pch->had_frag && i < ppp->nxchan)
                               ^~~~~~~~~~~~~~
   drivers/net/ppp/ppp_generic.c:1958:23: note: Left side of '&&' is false
                           if (!pch->had_frag && i < ppp->nxchan)
                                              ^
   drivers/net/ppp/ppp_generic.c:1938:2: note: Loop condition is false. 
Execution continues on line 1968
           list_for_each_entry(pch, &ppp->channels, clist) {
           ^
   include/linux/list.h:638:2: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
           ^
   drivers/net/ppp/ppp_generic.c:1968:6: note: 'nfree' is not equal to 0
           if (nfree == 0 || nfree < navail / 2)
               ^~~~~
   drivers/net/ppp/ppp_generic.c:1968:6: note: Left side of '||' is false
   drivers/net/ppp/ppp_generic.c:1968:2: note: Taking false branch
           if (nfree == 0 || nfree < navail / 2)
           ^
   drivers/net/ppp/ppp_generic.c:1974:6: note: Assuming the condition is false
           if (*p == 0 && mp_protocol_compress) {
               ^~~~~~~
   drivers/net/ppp/ppp_generic.c:1974:14: note: Left side of '&&' is false
           if (*p == 0 && mp_protocol_compress) {
                       ^
   drivers/net/ppp/ppp_generic.c:1985:14: note: Assuming 'i' is < field 'nxchan'

vim +103 drivers/net/arcnet/com20020-pci.c

8890624a4e8c2c Michael Grzeschik 2014-09-18   95  
ede07a1fc7d70a Michael Grzeschik 2017-06-28   96  static ssize_t 
backplane_mode_show(struct device *dev,
ede07a1fc7d70a Michael Grzeschik 2017-06-28   97                                
   struct device_attribute *attr,
ede07a1fc7d70a Michael Grzeschik 2017-06-28   98                                
   char *buf)
ede07a1fc7d70a Michael Grzeschik 2017-06-28   99  {
ede07a1fc7d70a Michael Grzeschik 2017-06-28  100        struct net_device 
*net_dev = to_net_dev(dev);
ede07a1fc7d70a Michael Grzeschik 2017-06-28  101        struct arcnet_local *lp 
= netdev_priv(net_dev);
ede07a1fc7d70a Michael Grzeschik 2017-06-28  102  
ede07a1fc7d70a Michael Grzeschik 2017-06-28 @103        return sprintf(buf, 
"%s\n", lp->backplane ? "true" : "false");
ede07a1fc7d70a Michael Grzeschik 2017-06-28  104  }
ede07a1fc7d70a Michael Grzeschik 2017-06-28  105  static 
DEVICE_ATTR_RO(backplane_mode);
ede07a1fc7d70a Michael Grzeschik 2017-06-28  106  

:::::: The code at line 103 was first introduced by commit
:::::: ede07a1fc7d70adfb290cfdace391295897023cb arcnet: com20020-pci: add 
attribute to readback backplane status

:::::: TO: Michael Grzeschik <[email protected]>
:::::: CC: David S. Miller <[email protected]>

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

Reply via email to