* drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' (local cap)
@ 2021-02-26 21:30 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-02-26 21:30 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4340 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jian Shen <shenjian15@huawei.com>
CC: Huazhong Tan <tanhuazhong@huawei.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8b83369ddcb3fb9cab5c1088987ce477565bb630
commit: f671237a4b4521dfde5f96c2b088287712e72f4b net: hns3: add support for dumping UC and MC MAC list
date: 10 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 10 months ago
config: xtensa-randconfig-m031-20210227 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' [r] (local cap)
vim +1467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
ee9e44248f52b6f1 Yonglong Liu 2019-10-08 1443
f671237a4b4521df Jian Shen 2020-04-24 1444 static int hclge_dbg_dump_mac_list(struct hclge_dev *hdev, const char *cmd_buf,
f671237a4b4521df Jian Shen 2020-04-24 1445 bool is_unicast)
f671237a4b4521df Jian Shen 2020-04-24 1446 {
f671237a4b4521df Jian Shen 2020-04-24 1447 struct hclge_mac_node *mac_node, *tmp;
f671237a4b4521df Jian Shen 2020-04-24 1448 struct hclge_vport *vport;
f671237a4b4521df Jian Shen 2020-04-24 1449 struct list_head *list;
f671237a4b4521df Jian Shen 2020-04-24 1450 u32 func_id;
f671237a4b4521df Jian Shen 2020-04-24 1451 int ret;
f671237a4b4521df Jian Shen 2020-04-24 1452
f671237a4b4521df Jian Shen 2020-04-24 1453 ret = kstrtouint(cmd_buf, 0, &func_id);
f671237a4b4521df Jian Shen 2020-04-24 1454 if (ret < 0) {
f671237a4b4521df Jian Shen 2020-04-24 1455 dev_err(&hdev->pdev->dev,
f671237a4b4521df Jian Shen 2020-04-24 1456 "dump mac list: bad command string, ret = %d\n", ret);
f671237a4b4521df Jian Shen 2020-04-24 1457 return -EINVAL;
f671237a4b4521df Jian Shen 2020-04-24 1458 }
f671237a4b4521df Jian Shen 2020-04-24 1459
f671237a4b4521df Jian Shen 2020-04-24 1460 if (func_id >= hdev->num_alloc_vport) {
f671237a4b4521df Jian Shen 2020-04-24 1461 dev_err(&hdev->pdev->dev,
f671237a4b4521df Jian Shen 2020-04-24 1462 "function id(%u) is out of range(0-%u)\n", func_id,
f671237a4b4521df Jian Shen 2020-04-24 1463 hdev->num_alloc_vport - 1);
f671237a4b4521df Jian Shen 2020-04-24 1464 return -EINVAL;
f671237a4b4521df Jian Shen 2020-04-24 1465 }
f671237a4b4521df Jian Shen 2020-04-24 1466
f671237a4b4521df Jian Shen 2020-04-24 @1467 vport = &hdev->vport[func_id];
f671237a4b4521df Jian Shen 2020-04-24 1468
f671237a4b4521df Jian Shen 2020-04-24 1469 list = is_unicast ? &vport->uc_mac_list : &vport->mc_mac_list;
f671237a4b4521df Jian Shen 2020-04-24 1470
f671237a4b4521df Jian Shen 2020-04-24 1471 dev_info(&hdev->pdev->dev, "vport %u %s mac list:\n",
f671237a4b4521df Jian Shen 2020-04-24 1472 func_id, is_unicast ? "uc" : "mc");
f671237a4b4521df Jian Shen 2020-04-24 1473 dev_info(&hdev->pdev->dev, "mac address state\n");
f671237a4b4521df Jian Shen 2020-04-24 1474
f671237a4b4521df Jian Shen 2020-04-24 1475 spin_lock_bh(&vport->mac_list_lock);
f671237a4b4521df Jian Shen 2020-04-24 1476
f671237a4b4521df Jian Shen 2020-04-24 1477 list_for_each_entry_safe(mac_node, tmp, list, node) {
f671237a4b4521df Jian Shen 2020-04-24 1478 dev_info(&hdev->pdev->dev, "%pM %d\n",
f671237a4b4521df Jian Shen 2020-04-24 1479 mac_node->mac_addr, mac_node->state);
f671237a4b4521df Jian Shen 2020-04-24 1480 }
f671237a4b4521df Jian Shen 2020-04-24 1481
f671237a4b4521df Jian Shen 2020-04-24 1482 spin_unlock_bh(&vport->mac_list_lock);
f671237a4b4521df Jian Shen 2020-04-24 1483
f671237a4b4521df Jian Shen 2020-04-24 1484 return 0;
f671237a4b4521df Jian Shen 2020-04-24 1485 }
f671237a4b4521df Jian Shen 2020-04-24 1486
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36183 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' (local cap)
@ 2021-01-14 13:41 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-01-14 13:41 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4339 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jian Shen <shenjian15@huawei.com>
CC: Huazhong Tan <tanhuazhong@huawei.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: f671237a4b4521dfde5f96c2b088287712e72f4b net: hns3: add support for dumping UC and MC MAC list
date: 9 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 9 months ago
config: arm64-randconfig-m031-20210114 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' [r] (local cap)
vim +1467 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
ee9e44248f52b6f1 Yonglong Liu 2019-10-08 1443
f671237a4b4521df Jian Shen 2020-04-24 1444 static int hclge_dbg_dump_mac_list(struct hclge_dev *hdev, const char *cmd_buf,
f671237a4b4521df Jian Shen 2020-04-24 1445 bool is_unicast)
f671237a4b4521df Jian Shen 2020-04-24 1446 {
f671237a4b4521df Jian Shen 2020-04-24 1447 struct hclge_mac_node *mac_node, *tmp;
f671237a4b4521df Jian Shen 2020-04-24 1448 struct hclge_vport *vport;
f671237a4b4521df Jian Shen 2020-04-24 1449 struct list_head *list;
f671237a4b4521df Jian Shen 2020-04-24 1450 u32 func_id;
f671237a4b4521df Jian Shen 2020-04-24 1451 int ret;
f671237a4b4521df Jian Shen 2020-04-24 1452
f671237a4b4521df Jian Shen 2020-04-24 1453 ret = kstrtouint(cmd_buf, 0, &func_id);
f671237a4b4521df Jian Shen 2020-04-24 1454 if (ret < 0) {
f671237a4b4521df Jian Shen 2020-04-24 1455 dev_err(&hdev->pdev->dev,
f671237a4b4521df Jian Shen 2020-04-24 1456 "dump mac list: bad command string, ret = %d\n", ret);
f671237a4b4521df Jian Shen 2020-04-24 1457 return -EINVAL;
f671237a4b4521df Jian Shen 2020-04-24 1458 }
f671237a4b4521df Jian Shen 2020-04-24 1459
f671237a4b4521df Jian Shen 2020-04-24 1460 if (func_id >= hdev->num_alloc_vport) {
f671237a4b4521df Jian Shen 2020-04-24 1461 dev_err(&hdev->pdev->dev,
f671237a4b4521df Jian Shen 2020-04-24 1462 "function id(%u) is out of range(0-%u)\n", func_id,
f671237a4b4521df Jian Shen 2020-04-24 1463 hdev->num_alloc_vport - 1);
f671237a4b4521df Jian Shen 2020-04-24 1464 return -EINVAL;
f671237a4b4521df Jian Shen 2020-04-24 1465 }
f671237a4b4521df Jian Shen 2020-04-24 1466
f671237a4b4521df Jian Shen 2020-04-24 @1467 vport = &hdev->vport[func_id];
f671237a4b4521df Jian Shen 2020-04-24 1468
f671237a4b4521df Jian Shen 2020-04-24 1469 list = is_unicast ? &vport->uc_mac_list : &vport->mc_mac_list;
f671237a4b4521df Jian Shen 2020-04-24 1470
f671237a4b4521df Jian Shen 2020-04-24 1471 dev_info(&hdev->pdev->dev, "vport %u %s mac list:\n",
f671237a4b4521df Jian Shen 2020-04-24 1472 func_id, is_unicast ? "uc" : "mc");
f671237a4b4521df Jian Shen 2020-04-24 1473 dev_info(&hdev->pdev->dev, "mac address state\n");
f671237a4b4521df Jian Shen 2020-04-24 1474
f671237a4b4521df Jian Shen 2020-04-24 1475 spin_lock_bh(&vport->mac_list_lock);
f671237a4b4521df Jian Shen 2020-04-24 1476
f671237a4b4521df Jian Shen 2020-04-24 1477 list_for_each_entry_safe(mac_node, tmp, list, node) {
f671237a4b4521df Jian Shen 2020-04-24 1478 dev_info(&hdev->pdev->dev, "%pM %d\n",
f671237a4b4521df Jian Shen 2020-04-24 1479 mac_node->mac_addr, mac_node->state);
f671237a4b4521df Jian Shen 2020-04-24 1480 }
f671237a4b4521df Jian Shen 2020-04-24 1481
f671237a4b4521df Jian Shen 2020-04-24 1482 spin_unlock_bh(&vport->mac_list_lock);
f671237a4b4521df Jian Shen 2020-04-24 1483
f671237a4b4521df Jian Shen 2020-04-24 1484 return 0;
f671237a4b4521df Jian Shen 2020-04-24 1485 }
f671237a4b4521df Jian Shen 2020-04-24 1486
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36576 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-26 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 21:30 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' (local cap) kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-01-14 13:41 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.