aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hnae3.h
diff options
context:
space:
mode:
authorYufeng Mo <moyufeng@huawei.com>2021-12-10 21:09:34 +0800
committerDavid S. Miller <davem@davemloft.net>2021-12-12 16:20:50 +0000
commit6dde452bceca3f2ed2b33bc46a16ff5682a03a2e (patch)
tree16215f2ff55af1577640dc72fbc103b3bc1829b3 /drivers/net/ethernet/hisilicon/hns3/hnae3.h
parentnet: hns3: fix use-after-free bug in hclgevf_send_mbx_msg (diff)
downloadlinux-dev-6dde452bceca3f2ed2b33bc46a16ff5682a03a2e.tar.xz
linux-dev-6dde452bceca3f2ed2b33bc46a16ff5682a03a2e.zip
net: hns3: fix race condition in debugfs
When multiple threads concurrently access the debugfs content, data and pointer exceptions may occur. Therefore, mutex lock protection is added for debugfs. Fixes: 5e69ea7ee2a6 ("net: hns3: refactor the debugfs process") Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hnae3.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hnae3.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 3f7a9a4c59d5..63f5abcc6bf4 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -839,6 +839,8 @@ struct hnae3_handle {
u8 netdev_flags;
struct dentry *hnae3_dbgfs;
+ /* protects concurrent contention between debugfs commands */
+ struct mutex dbgfs_lock;
/* Network interface message level enabled bits */
u32 msg_enable;