CC: [email protected] CC: [email protected] CC: [email protected] TO: Kees Cook <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: eccea80be2576dee642bc6cab20f1a242d58a08c commit: a52f8a59aef46b59753e583bf4b28fccb069ce64 fortify: Explicitly disable Clang support date: 3 months ago :::::: branch date: 9 hours ago :::::: commit date: 3 months ago config: i386-randconfig-c001-20211208 (https://download.01.org/0day-ci/archive/20211212/[email protected]/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a) 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=a52f8a59aef46b59753e583bf4b28fccb069ce64 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout a52f8a59aef46b59753e583bf4b28fccb069ce64 # save the config file 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 >>) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ net/core/rtnetlink.c:2688:2: note: '?' condition is false if (tb[IFLA_GROUP]) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ net/core/rtnetlink.c:2688:2: note: Taking false branch if (tb[IFLA_GROUP]) { ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ net/core/rtnetlink.c:2698:6: note: Assuming field 'ifi_index' is > 0 if (ifm->ifi_index > 0 && ifname[0]) { ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ net/core/rtnetlink.c:2698:6: note: Left side of '&&' is true if (ifm->ifi_index > 0 && ifname[0]) { ^ net/core/rtnetlink.c:2698:28: note: Array access (from variable 'ifname') results in a null pointer dereference if (ifm->ifi_index > 0 && ifname[0]) { ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ net/core/rtnetlink.c:2812:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores] err = 0; ^ ~ net/core/rtnetlink.c:2812:2: note: Value stored to 'err' is never read err = 0; ^ ~ net/core/rtnetlink.c:2847:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores] err = 0; ^ ~ net/core/rtnetlink.c:2847:2: note: Value stored to 'err' is never read err = 0; ^ ~ net/core/rtnetlink.c:3809:19: warning: Although the value stored to 'if_info_size' is used in the enclosing expression, the value is never actually read from 'if_info_size' [clang-analyzer-deadcode.DeadStores] skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), flags); ^ ~~~~~~~~~~~~~~~~~~~~~ net/core/rtnetlink.c:3809:19: note: Although the value stored to 'if_info_size' is used in the enclosing expression, the value is never actually read from 'if_info_size' skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), flags); ^ ~~~~~~~~~~~~~~~~~~~~~ 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. 14 warnings generated. fs/cifs/smb2transport.c:430:3: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores] rc = generate_key(ses, ptriplet->encryption.label, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/cifs/smb2transport.c:430:3: note: Value stored to 'rc' is never read rc = generate_key(ses, ptriplet->encryption.label, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. 14 warnings generated. fs/cifs/smb2misc.c:505:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores] rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/cifs/smb2misc.c:505:2: note: Value stored to 'rc' is never read rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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. 14 warnings generated. fs/cifs/smb2pdu.c:577:3: warning: Value stored to 'pneg_ctxt' is never read [clang-analyzer-deadcode.DeadStores] pneg_ctxt += ctxt_len; ^ ~~~~~~~~ fs/cifs/smb2pdu.c:577:3: note: Value stored to 'pneg_ctxt' is never read pneg_ctxt += ctxt_len; ^ ~~~~~~~~ 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. 15 warnings generated. >> fs/cifs/cifsacl.c:267:21: warning: Assigned value is garbage or undefined >> [clang-analyzer-core.uninitialized.Assign] dst->authority[i] = src->authority[i]; ^ fs/cifs/cifsacl.c:1261:2: note: Assuming 'dacloffset' is not equal to 0 if (dacloffset) { ^ include/linux/compiler.h:56:45: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ fs/cifs/cifsacl.c:1261:2: note: '?' condition is false if (dacloffset) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ fs/cifs/cifsacl.c:1261:6: note: 'dacloffset' is not equal to 0 if (dacloffset) { ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ fs/cifs/cifsacl.c:1261:2: note: '?' condition is true if (dacloffset) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ fs/cifs/cifsacl.c:1261:2: note: Taking true branch if (dacloffset) { ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ fs/cifs/cifsacl.c:1263:3: note: '?' condition is false if (end_of_acl < (char *)dacl_ptr + le16_to_cpu(dacl_ptr->size)) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ fs/cifs/cifsacl.c:1263:3: note: Assuming the condition is false if (end_of_acl < (char *)dacl_ptr + le16_to_cpu(dacl_ptr->size)) { ^ include/linux/compiler.h:56:44: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ~~~~~~~~~~~~~~~~~^~~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ fs/cifs/cifsacl.c:1263:3: note: '?' condition is false if (end_of_acl < (char *)dacl_ptr + le16_to_cpu(dacl_ptr->size)) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ fs/cifs/cifsacl.c:1263:3: note: Taking false branch if (end_of_acl < (char *)dacl_ptr + le16_to_cpu(dacl_ptr->size)) { ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ fs/cifs/cifsacl.c:1274:6: note: Assuming 'pnmode' is null if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */ ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ fs/cifs/cifsacl.c:1274:13: note: Left side of '&&' is false if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */ vim +267 fs/cifs/cifsacl.c 3514de3fd5fab5 Steve French 2016-10-13 257 f5065508897a92 Shyam Prasad N 2021-02-12 258 static __u16 36960e440ccf94 Jeff Layton 2012-11-03 259 cifs_copy_sid(struct cifs_sid *dst, const struct cifs_sid *src) 36960e440ccf94 Jeff Layton 2012-11-03 260 { 36f87ee70f754d Jeff Layton 2012-11-25 261 int i; f5065508897a92 Shyam Prasad N 2021-02-12 262 __u16 size = 1 + 1 + 6; 36f87ee70f754d Jeff Layton 2012-11-25 263 36f87ee70f754d Jeff Layton 2012-11-25 264 dst->revision = src->revision; 30c9d6cca52624 Jeff Layton 2012-11-25 265 dst->num_subauth = min_t(u8, src->num_subauth, SID_MAX_SUB_AUTHORITIES); 36f87ee70f754d Jeff Layton 2012-11-25 266 for (i = 0; i < NUM_AUTHS; ++i) 36f87ee70f754d Jeff Layton 2012-11-25 @267 dst->authority[i] = src->authority[i]; 36f87ee70f754d Jeff Layton 2012-11-25 268 for (i = 0; i < dst->num_subauth; ++i) 36f87ee70f754d Jeff Layton 2012-11-25 269 dst->sub_auth[i] = src->sub_auth[i]; f5065508897a92 Shyam Prasad N 2021-02-12 270 size += (dst->num_subauth * 4); f5065508897a92 Shyam Prasad N 2021-02-12 271 f5065508897a92 Shyam Prasad N 2021-02-12 272 return size; 36960e440ccf94 Jeff Layton 2012-11-03 273 } 36960e440ccf94 Jeff Layton 2012-11-03 274 :::::: The code at line 267 was first introduced by commit :::::: 36f87ee70f754d04e55518853e6fb30ed4732dda cifs: make cifs_copy_sid handle a source sid with variable size subauth arrays :::::: TO: Jeff Layton <[email protected]> :::::: CC: Steve French <[email protected]> --- 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]
