Commit 3a444e2b authored by Hao Chen's avatar Hao Chen Committed by Jiantao Xiao
Browse files

net: hns3: fix debugfs concurrency issue between kfree buffer and read

mainline inclusion
from mainline-v6.6-rc1
commit c295160b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7YRUW
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c295160b1d95e885f1af4586a221cb221d232d10



----------------------------------------------------------------------

Now in hns3_dbg_uninit(), there may be concurrency between
kfree buffer and read, it may result in memory error.

Moving debugfs_remove_recursive() in front of kfree buffer to ensure
they don't happen at the same time.

Fixes: 5e69ea7e ("net: hns3: refactor the debugfs process")
Signed-off-by: default avatarHao Chen <chenhao418@huawei.com>
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent c9ee9209
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment