From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:1467 hclge_dbg_dump_mac_list() warn: potential spectre issue 'hdev->vport' (local cap)
Date: Sat, 27 Feb 2021 05:30:36 +0800 [thread overview]
Message-ID: <202102270533.5grAwcKC-lkp@intel.com> (raw)
[-- 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 --]
next reply other threads:[~2021-02-26 21:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 21:30 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-14 13:41 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202102270533.5grAwcKC-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.