CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Jeremy Kerr <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   d567f5db412ed52de0b3b3efca4a451263de6108
commit: 99ce45d5e7dbde399997a630f45ac9f654fa4bcc mctp: Implement extended 
addressing
date:   4 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 4 months ago
config: mips-randconfig-c004-20220211 
(https://download.01.org/0day-ci/archive/20220215/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
f6685f774697c85d6a352dcea013f46a99f9fe31)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99ce45d5e7dbde399997a630f45ac9f654fa4bcc
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 99ce45d5e7dbde399997a630f45ac9f654fa4bcc
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 
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 >>)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_log.c:580:6: note: Assuming the condition is false
           if (xlog_is_shutdown(log)) {
               ^~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_log.c:580:2: note: Taking false branch
           if (xlog_is_shutdown(log)) {
           ^
   fs/xfs/xfs_log.c:594:7: note: 'last_ref' is true
           if (!last_ref)
                ^~~~~~~~
   fs/xfs/xfs_log.c:594:2: note: Taking false branch
           if (!last_ref)
           ^
   fs/xfs/xfs_log.c:597:6: note: Assuming field 'ic_state' is equal to 
XLOG_STATE_WANT_SYNC
           if (iclog->ic_state != XLOG_STATE_WANT_SYNC) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_log.c:597:2: note: Taking false branch
           if (iclog->ic_state != XLOG_STATE_WANT_SYNC) {
           ^
   fs/xfs/xfs_log.c:603:6: note: Assuming field 'h_tail_lsn' is 0
           if (!iclog->ic_header.h_tail_lsn)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_log.c:603:2: note: Taking true branch
           if (!iclog->ic_header.h_tail_lsn)
           ^
   fs/xfs/xfs_log.c:604:31: note: Assigned value is garbage or undefined
                   iclog->ic_header.h_tail_lsn = cpu_to_be64(tail_lsn);
                                               ^
   fs/xfs/xfs_log.c:965:2: warning: Value stored to 'error' is never read 
[clang-analyzer-deadcode.DeadStores]
           error = xlog_force_iclog(iclog);
           ^       ~~~~~~~~~~~~~~~~~~~~~~~
   fs/xfs/xfs_log.c:965:2: note: Value stored to 'error' is never read
           error = xlog_force_iclog(iclog);
           ^       ~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 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/btrfs/file.c:548:3: warning: Value stored to 'modified' is never read 
[clang-analyzer-deadcode.DeadStores]
                   modified = false;
                   ^          ~~~~~
   fs/btrfs/file.c:548:3: note: Value stored to 'modified' is never read
                   modified = false;
                   ^          ~~~~~
   fs/btrfs/file.c:1400:5: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
                                   err = 0;
                                   ^     ~
   fs/btrfs/file.c:1400:5: note: Value stored to 'err' is never read
                                   err = 0;
                                   ^     ~
   fs/btrfs/file.c:3247:4: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3247:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3253:4: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3253:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3264:4: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3264:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3271:4: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
   fs/btrfs/file.c:3271:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   fs/btrfs/extent_map.c:615:3: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                   ret = 0;
                   ^     ~
   fs/btrfs/extent_map.c:615:3: note: Value stored to 'ret' is never read
                   ret = 0;
                   ^     ~
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
>> net/mctp/af_mctp.c:243:17: warning: Assigned value is garbage or undefined 
>> [clang-analyzer-core.uninitialized.Assign]
                   msk->addr_ext = val;
                                 ^ ~~~
   net/mctp/af_mctp.c:232:26: note: Left side of '&&' is false
           struct mctp_sock *msk = container_of(sock->sk, struct mctp_sock, sk);
                                   ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   net/mctp/af_mctp.c:232:26: note: Taking false branch
           struct mctp_sock *msk = container_of(sock->sk, struct mctp_sock, sk);
                                   ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   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:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   net/mctp/af_mctp.c:232:26: note: Loop condition is false.  Exiting loop
           struct mctp_sock *msk = container_of(sock->sk, struct mctp_sock, sk);
                                   ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   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:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   net/mctp/af_mctp.c:233:2: note: 'val' declared without an initial value
           int val;
           ^~~~~~~
   net/mctp/af_mctp.c:235:6: note: Assuming 'level' is equal to SOL_MCTP
           if (level != SOL_MCTP)
               ^~~~~~~~~~~~~~~~~
   net/mctp/af_mctp.c:235:2: note: Taking false branch
           if (level != SOL_MCTP)
           ^
   net/mctp/af_mctp.c:238:6: note: Assuming 'optname' is equal to 
MCTP_OPT_ADDR_EXT
           if (optname == MCTP_OPT_ADDR_EXT) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mctp/af_mctp.c:238:2: note: Taking true branch
           if (optname == MCTP_OPT_ADDR_EXT) {
           ^
   net/mctp/af_mctp.c:239:7: note: Assuming the condition is false
                   if (optlen != sizeof(int))
                       ^~~~~~~~~~~~~~~~~~~~~
   net/mctp/af_mctp.c:239:3: note: Taking false branch
                   if (optlen != sizeof(int))
                   ^
   net/mctp/af_mctp.c:241:7: note: Calling 'copy_from_sockptr'
                   if (copy_from_sockptr(&val, optval, sizeof(int)))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/sockptr.h:55:9: note: Calling 'copy_from_sockptr_offset'
           return copy_from_sockptr_offset(dst, src, 0, size);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/sockptr.h:47:6: note: Assuming the condition is true
           if (!sockptr_is_kernel(src))
               ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/sockptr.h:47:2: note: Taking true branch
           if (!sockptr_is_kernel(src))
           ^
   include/linux/sockptr.h:48:10: note: Calling 'copy_from_user'
                   return copy_from_user(dst, src.user + offset, size);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:2: note: Taking true branch
           if (likely(check_copy_size(to, n, false)))
           ^
   include/linux/uaccess.h:192:7: note: Calling '_copy_from_user'
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:157:7: note: Calling 'should_fail_usercopy'
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
                ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/fault-inject-usercopy.h:18:49: note: Returning zero, which 
participates in a condition later
   static inline bool should_fail_usercopy(void) { return false; }
                                                   ^~~~~~~~~~~~
   include/linux/uaccess.h:157:7: note: Returning from 'should_fail_usercopy'
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
                ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:157:6: note: Left side of '&&' is true
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
               ^
   include/linux/uaccess.h:157:2: note: Taking true branch
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {

vim +243 net/mctp/af_mctp.c

8f601a1e4f8c84 Jeremy Kerr 2021-07-29  228  
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  229  static int mctp_setsockopt(struct 
socket *sock, int level, int optname,
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  230                         sockptr_t 
optval, unsigned int optlen)
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  231  {
99ce45d5e7dbde Jeremy Kerr 2021-10-26  232      struct mctp_sock *msk = 
container_of(sock->sk, struct mctp_sock, sk);
99ce45d5e7dbde Jeremy Kerr 2021-10-26  233      int val;
99ce45d5e7dbde Jeremy Kerr 2021-10-26  234  
99ce45d5e7dbde Jeremy Kerr 2021-10-26  235      if (level != SOL_MCTP)
99ce45d5e7dbde Jeremy Kerr 2021-10-26  236              return -EINVAL;
99ce45d5e7dbde Jeremy Kerr 2021-10-26  237  
99ce45d5e7dbde Jeremy Kerr 2021-10-26  238      if (optname == 
MCTP_OPT_ADDR_EXT) {
99ce45d5e7dbde Jeremy Kerr 2021-10-26  239              if (optlen != 
sizeof(int))
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  240                      return -EINVAL;
99ce45d5e7dbde Jeremy Kerr 2021-10-26  241              if 
(copy_from_sockptr(&val, optval, sizeof(int)))
99ce45d5e7dbde Jeremy Kerr 2021-10-26  242                      return -EFAULT;
99ce45d5e7dbde Jeremy Kerr 2021-10-26 @243              msk->addr_ext = val;
99ce45d5e7dbde Jeremy Kerr 2021-10-26  244              return 0;
99ce45d5e7dbde Jeremy Kerr 2021-10-26  245      }
99ce45d5e7dbde Jeremy Kerr 2021-10-26  246  
99ce45d5e7dbde Jeremy Kerr 2021-10-26  247      return -ENOPROTOOPT;
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  248  }
8f601a1e4f8c84 Jeremy Kerr 2021-07-29  249  

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