CC: [email protected] CC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Hayes Wang <[email protected]>
Hi Hayes, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on horms-ipvs/master] [also build test WARNING on linus/master v5.16-rc3 next-20211203] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Hayes-Wang/r8169-support-dash/20211129-181721 base: https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git master :::::: branch date: 5 days ago :::::: commit date: 5 days ago config: i386-randconfig-c001-20211130 (https://download.01.org/0day-ci/archive/20211205/[email protected]/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 25eb7fa01d7ebbe67648ea03841cda55b4239ab2) 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/e0b1115782b23f3f7cc28430c69ed35655dbf7eb git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Hayes-Wang/r8169-support-dash/20211129-181721 git checkout e0b1115782b23f3f7cc28430c69ed35655dbf7eb # 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 >>) #define smp_store_release(p, v) __smp_store_release(p, v) ^ arch/x86/include/asm/barrier.h:67:2: note: expanded from macro '__smp_store_release' WRITE_ONCE(*p, v); \ ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:315:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ drivers/target/target_core_alua.c:1809:2: note: Loop condition is false. Exiting loop rcu_assign_pointer(lun->lun_tg_pt_gp, tg_pt_gp); ^ include/linux/rcupdate.h:453:3: note: expanded from macro 'rcu_assign_pointer' smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \ ^ include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release' #define smp_store_release(p, v) __smp_store_release(p, v) ^ arch/x86/include/asm/barrier.h:67:2: note: expanded from macro '__smp_store_release' WRITE_ONCE(*p, v); \ ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:307:2: note: expanded from macro '__compiletime_assert' do { \ ^ drivers/target/target_core_alua.c:1809:2: note: Loop condition is false. Exiting loop rcu_assign_pointer(lun->lun_tg_pt_gp, tg_pt_gp); ^ include/linux/rcupdate.h:453:3: note: expanded from macro 'rcu_assign_pointer' smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \ ^ include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release' #define smp_store_release(p, v) __smp_store_release(p, v) ^ arch/x86/include/asm/barrier.h:67:2: note: expanded from macro '__smp_store_release' WRITE_ONCE(*p, v); \ ^ include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE' __WRITE_ONCE(x, val); \ ^ include/asm-generic/rwonce.h:53:35: note: expanded from macro '__WRITE_ONCE' #define __WRITE_ONCE(x, val) \ ^ drivers/target/target_core_alua.c:1809:2: note: Loop condition is false. Exiting loop rcu_assign_pointer(lun->lun_tg_pt_gp, tg_pt_gp); ^ include/linux/rcupdate.h:453:3: note: expanded from macro 'rcu_assign_pointer' smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \ ^ include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release' #define smp_store_release(p, v) __smp_store_release(p, v) ^ arch/x86/include/asm/barrier.h:67:2: note: expanded from macro '__smp_store_release' WRITE_ONCE(*p, v); \ ^ include/asm-generic/rwonce.h:58:33: note: expanded from macro 'WRITE_ONCE' #define WRITE_ONCE(x, val) \ ^ drivers/target/target_core_alua.c:1809:2: note: Loop condition is false. Exiting loop rcu_assign_pointer(lun->lun_tg_pt_gp, tg_pt_gp); ^ include/linux/rcupdate.h:453:3: note: expanded from macro 'rcu_assign_pointer' smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \ ^ include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release' #define smp_store_release(p, v) __smp_store_release(p, v) ^ arch/x86/include/asm/barrier.h:63:39: note: expanded from macro '__smp_store_release' #define __smp_store_release(p, v) \ ^ drivers/target/target_core_alua.c:1809:2: note: Loop condition is false. Exiting loop rcu_assign_pointer(lun->lun_tg_pt_gp, tg_pt_gp); ^ include/linux/rcupdate.h:445:44: note: expanded from macro 'rcu_assign_pointer' #define rcu_assign_pointer(p, v) \ ^ drivers/target/target_core_alua.c:1810:41: note: Passing null pointer value via 2nd parameter 'head' list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/target/target_core_alua.c:1810:2: note: Calling 'list_add_tail' list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/list.h:102:18: note: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'head') __list_add(new, head->prev, head); ^~~~ 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. 13 warnings generated. >> drivers/net/ethernet/realtek/r8169_main.c:4677: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(buf, "enable\n"); ^~~~~~ drivers/net/ethernet/realtek/r8169_main.c:4677: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(buf, "enable\n"); ^~~~~~ drivers/net/ethernet/realtek/r8169_main.c:4679: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(buf, "disable\n"); ^~~~~~ drivers/net/ethernet/realtek/r8169_main.c:4679: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(buf, "disable\n"); ^~~~~~ Suppressed 11 warnings (11 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. 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. 14 warnings generated. >> drivers/net/ethernet/realtek/r8169_dash.c:882:3: warning: Value stored to >> 'dest' is never read [clang-analyzer-deadcode.DeadStores] dest += size; ^ ~~~~ drivers/net/ethernet/realtek/r8169_dash.c:882:3: note: Value stored to 'dest' is never read dest += size; ^ ~~~~ Suppressed 13 warnings (11 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. 11 warnings generated. Suppressed 11 warnings (11 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. 17 warnings generated. drivers/net/ethernet/sis/sis900.c:532:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = 0; ^ ~ drivers/net/ethernet/sis/sis900.c:532:2: note: Value stored to 'ret' is never read ret = 0; ^ ~ drivers/net/ethernet/sis/sis900.c:740:3: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores] status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:740:3: note: Value stored to 'status' is never read status = mdio_read(net_dev, phy->phy_addr, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:767:23: warning: Access to field 'phy_addr' results in a dereference of a null pointer (loaded from variable 'default_phy') [clang-analyzer-core.NullDereference] sis_priv->cur_phy = default_phy->phy_addr; ^ drivers/net/ethernet/sis/sis900.c:1325:11: note: Value assigned to field 'first_mii' status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:1328:6: note: Assuming the condition is true if (!netif_carrier_ok(net_dev)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:1328:2: note: Taking true branch if (!netif_carrier_ok(net_dev)) { ^ drivers/net/ethernet/sis/sis900.c:1331:12: note: Calling 'sis900_default_phy' status = sis900_default_phy(net_dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:739:39: note: Assuming pointer value is null for (phy=sis_priv->first_mii; phy; phy=phy->next) { ^~~ drivers/net/ethernet/sis/sis900.c:739:9: note: Loop condition is false. Execution continues on line 758 for (phy=sis_priv->first_mii; phy; phy=phy->next) { ^ drivers/net/ethernet/sis/sis900.c:758:7: note: 'default_phy' is null if (!default_phy && phy_home) ^~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:758:6: note: Left side of '&&' is true if (!default_phy && phy_home) ^ drivers/net/ethernet/sis/sis900.c:758:22: note: 'phy_home' is null if (!default_phy && phy_home) ^~~~~~~~ drivers/net/ethernet/sis/sis900.c:758:2: note: Taking false branch if (!default_phy && phy_home) ^ drivers/net/ethernet/sis/sis900.c:760:12: note: 'default_phy' is null else if (!default_phy && phy_lan) ^~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:760:11: note: Left side of '&&' is true else if (!default_phy && phy_lan) ^ drivers/net/ethernet/sis/sis900.c:760:27: note: 'phy_lan' is null else if (!default_phy && phy_lan) ^~~~~~~ drivers/net/ethernet/sis/sis900.c:760:7: note: Taking false branch else if (!default_phy && phy_lan) ^ drivers/net/ethernet/sis/sis900.c:762:12: note: 'default_phy' is null else if (!default_phy) ^~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:762:7: note: Taking true branch else if (!default_phy) ^ drivers/net/ethernet/sis/sis900.c:763:3: note: Null pointer value stored to 'default_phy' default_phy = sis_priv->first_mii; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:765:6: note: Assuming 'default_phy' is not equal to field 'mii' if (sis_priv->mii != default_phy) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:765:2: note: Taking true branch if (sis_priv->mii != default_phy) { ^ drivers/net/ethernet/sis/sis900.c:767:23: note: Access to field 'phy_addr' results in a dereference of a null pointer (loaded from variable 'default_phy') sis_priv->cur_phy = default_phy->phy_addr; ^~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:778:2: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores] status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:778:2: note: Value stored to 'status' is never read status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:1324:2: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores] status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:1324:2: note: Value stored to 'status' is never read status = mdio_read(net_dev, sis_priv->cur_phy, MII_STATUS); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/sis/sis900.c:1332:3: warning: Value stored to 'mii_phy' is never read [clang-analyzer-deadcode.DeadStores] mii_phy = sis_priv->mii; vim +4677 drivers/net/ethernet/realtek/r8169_main.c e0b1115782b23f Hayes Wang 2021-11-29 4661 e0b1115782b23f Hayes Wang 2021-11-29 4662 static ssize_t e0b1115782b23f Hayes Wang 2021-11-29 4663 ap_ready_show(struct device *dev, struct device_attribute *attr, char *buf) e0b1115782b23f Hayes Wang 2021-11-29 4664 { e0b1115782b23f Hayes Wang 2021-11-29 4665 struct net_device *net = to_net_dev(dev); e0b1115782b23f Hayes Wang 2021-11-29 4666 struct rtl8169_private *tp = netdev_priv(net); e0b1115782b23f Hayes Wang 2021-11-29 4667 bool enable; e0b1115782b23f Hayes Wang 2021-11-29 4668 e0b1115782b23f Hayes Wang 2021-11-29 4669 if (rtnl_lock_killable()) e0b1115782b23f Hayes Wang 2021-11-29 4670 return -EINTR; e0b1115782b23f Hayes Wang 2021-11-29 4671 e0b1115782b23f Hayes Wang 2021-11-29 4672 enable = rtl_dash_get_ap_ready(tp->rtl_dash); e0b1115782b23f Hayes Wang 2021-11-29 4673 e0b1115782b23f Hayes Wang 2021-11-29 4674 rtnl_unlock(); e0b1115782b23f Hayes Wang 2021-11-29 4675 e0b1115782b23f Hayes Wang 2021-11-29 4676 if (enable) e0b1115782b23f Hayes Wang 2021-11-29 @4677 strcat(buf, "enable\n"); e0b1115782b23f Hayes Wang 2021-11-29 4678 else e0b1115782b23f Hayes Wang 2021-11-29 4679 strcat(buf, "disable\n"); e0b1115782b23f Hayes Wang 2021-11-29 4680 e0b1115782b23f Hayes Wang 2021-11-29 4681 return (strlen(buf) + 1); e0b1115782b23f Hayes Wang 2021-11-29 4682 } e0b1115782b23f Hayes Wang 2021-11-29 4683 --- 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]
