CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Luiz Augusto von Dentz <[email protected]>
CC: 0day robot <[email protected]>

tree:   
https://github.com/0day-ci/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-eir-Move-EIR-Adv-Data-functions-to-its-own-file/20210922-113507
head:   cda1eaab813d24fd5a24abcae5c22e15191ee466
commit: cda1eaab813d24fd5a24abcae5c22e15191ee466 Bluetooth: eir: Move EIR/Adv 
Data functions to its own file
date:   6 days ago
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: i386-randconfig-c001-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
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/0day-ci/linux/commit/cda1eaab813d24fd5a24abcae5c22e15191ee466
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Luiz-Augusto-von-Dentz/Bluetooth-eir-Move-EIR-Adv-Data-functions-to-its-own-file/20210922-113507
        git checkout cda1eaab813d24fd5a24abcae5c22e15191ee466
        # 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 >>)
   6 warnings generated.
   Suppressed 6 warnings (6 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.
   15 warnings generated.
   drivers/w1/w1.c:997:2: warning: Value stored to 'search_bit' is never read 
[clang-analyzer-deadcode.DeadStores]
           search_bit = 0;
           ^            ~
   drivers/w1/w1.c:997:2: note: Value stored to 'search_bit' is never read
           search_bit = 0;
           ^            ~
   drivers/w1/w1.c:999:2: warning: Value stored to 'last_rn' is never read 
[clang-analyzer-deadcode.DeadStores]
           last_rn = 0;
           ^         ~
   drivers/w1/w1.c:999:2: note: Value stored to 'last_rn' is never read
           last_rn = 0;
           ^         ~
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   Suppressed 6 warnings (6 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   Suppressed 6 warnings (6 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   13 warnings generated.
   Suppressed 13 warnings (13 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.
   16 warnings generated.
   net/sunrpc/auth_gss/gss_mech_switch.c:55: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(new, prefix);
                   ^~~~~~
   net/sunrpc/auth_gss/gss_mech_switch.c:55: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(new, prefix);
                   ^~~~~~
   net/sunrpc/auth_gss/gss_mech_switch.c:56:3: warning: Call to function 
'strcat' 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 'strlcat'. CWE-119 
[clang-analyzer-security.insecureAPI.strcpy]
                   strcat(new, name);
                   ^~~~~~
   net/sunrpc/auth_gss/gss_mech_switch.c:56:3: note: Call to function 'strcat' 
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 'strlcat'. CWE-119
                   strcat(new, name);
                   ^~~~~~
   Suppressed 14 warnings (14 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.
   15 warnings generated.
   net/sunrpc/auth_gss/svcauth_gss.c:1316:3: warning: Value stored to 'status' 
is never read [clang-analyzer-deadcode.DeadStores]
                   status = -EINVAL;
                   ^        ~~~~~~~
   net/sunrpc/auth_gss/svcauth_gss.c:1316:3: note: Value stored to 'status' is 
never read
                   status = -EINVAL;
                   ^        ~~~~~~~
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   Suppressed 6 warnings (6 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.
   7 warnings generated.
   Suppressed 7 warnings (7 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.
   Suppressed 6 warnings (6 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.
   15 warnings generated.
   Suppressed 15 warnings (13 in non-user code, 2 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   16 warnings generated.
>> net/bluetooth/eir.c:212:2: warning: Value stored to 'ptr' is never read 
>> [clang-analyzer-deadcode.DeadStores]
           ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - 
data));
           ^     
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/bluetooth/eir.c:212:2: note: Value stored to 'ptr' is never read
           ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - 
data));
           ^     
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/bluetooth/eir.c:295:4: warning: Value stored to 'ptr' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ptr += 3;
                           ^      ~
   net/bluetooth/eir.c:295:4: note: Value stored to 'ptr' is never read
                           ptr += 3;
                           ^      ~
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   14 warnings generated.
   Suppressed 14 warnings (14 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.
   15 warnings generated.
   include/linux/list.h:135:13: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
           __list_del(entry->prev, entry->next);
                      ^
   net/sunrpc/xprt.c:1783:6: note: Assuming 'xprt' is not equal to NULL
           if (xprt == NULL)
               ^~~~~~~~~~~~
   net/sunrpc/xprt.c:1783:2: note: Taking false branch
           if (xprt == NULL)
           ^
   net/sunrpc/xprt.c:1789:14: note: Assuming 'i' is < 'num_prealloc'
           for (i = 0; i < num_prealloc; i++) {
                       ^~~~~~~~~~~~~~~~
   net/sunrpc/xprt.c:1789:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < num_prealloc; i++) {
           ^
   net/sunrpc/xprt.c:1791:7: note: Assuming 'req' is null
                   if (!req)
                       ^~~~
   net/sunrpc/xprt.c:1791:3: note: Taking true branch
                   if (!req)
                   ^
   net/sunrpc/xprt.c:1792:4: note: Control jumps to line 1805
                           goto out_free;
                           ^
   net/sunrpc/xprt.c:1805:2: note: Calling 'xprt_free'
           xprt_free(xprt);
           ^~~~~~~~~~~~~~~
   net/sunrpc/xprt.c:1814:2: note: Calling 'xprt_free_all_slots'
           xprt_free_all_slots(xprt);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
   net/sunrpc/xprt.c:1743:2: note: Loop condition is true.  Entering loop body
           while (!list_empty(&xprt->free)) {
           ^
   net/sunrpc/xprt.c:1744:9: note: Left side of '&&' is false
                   req = list_first_entry(&xprt->free, struct rpc_rqst, 
rq_list);
                         ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   net/sunrpc/xprt.c:1744:9: note: Taking false branch
                   req = list_first_entry(&xprt->free, struct rpc_rqst, 
rq_list);
                         ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   net/sunrpc/xprt.c:1744:9: note: Loop condition is false.  Exiting loop
                   req = list_first_entry(&xprt->free, struct rpc_rqst, 
rq_list);
                         ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'

vim +/ptr +212 net/bluetooth/eir.c

cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  165  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  166  void eir_create(struct 
hci_dev *hdev, u8 *data)
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  167  {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  168   u8 *ptr = data;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  169   size_t name_len;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  170  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  171   name_len = 
strlen(hdev->dev_name);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  172  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  173   if (name_len > 0) {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  174           /* EIR Data 
type */
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  175           if (name_len > 
48) {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  176                   
name_len = 48;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  177                   ptr[1] 
= EIR_NAME_SHORT;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  178           } else {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  179                   ptr[1] 
= EIR_NAME_COMPLETE;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  180           }
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  181  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  182           /* EIR Data 
length */
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  183           ptr[0] = 
name_len + 1;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  184  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  185           memcpy(ptr + 2, 
hdev->dev_name, name_len);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  186  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  187           ptr += 
(name_len + 2);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  188   }
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  189  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  190   if (hdev->inq_tx_power 
!= HCI_TX_POWER_INVALID) {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  191           ptr[0] = 2;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  192           ptr[1] = 
EIR_TX_POWER;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  193           ptr[2] = 
(u8)hdev->inq_tx_power;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  194  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  195           ptr += 3;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  196   }
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  197  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  198   if (hdev->devid_source 
> 0) {
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  199           ptr[0] = 9;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  200           ptr[1] = 
EIR_DEVICE_ID;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  201  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  202           
put_unaligned_le16(hdev->devid_source, ptr + 2);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  203           
put_unaligned_le16(hdev->devid_vendor, ptr + 4);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  204           
put_unaligned_le16(hdev->devid_product, ptr + 6);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  205           
put_unaligned_le16(hdev->devid_version, ptr + 8);
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  206  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  207           ptr += 10;
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  208   }
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  209  
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  210   ptr = 
create_uuid16_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  211   ptr = 
create_uuid32_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20 @212   ptr = 
create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  213  }
cda1eaab813d24 Luiz Augusto von Dentz 2021-09-20  214  

---
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