[PATCH net 0/3] net: hns3: three fixes for hns3 driver

Jijie Shao posted 3 patches 1 week, 2 days ago
drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
.../ethernet/hisilicon/hns3/hns3_debugfs.c    | 95 +++++++++++--------
.../net/ethernet/hisilicon/hns3/hns3_enet.c   | 68 ++++++++++++-
.../net/ethernet/hisilicon/hns3/hns3_enet.h   | 17 ++++
.../ethernet/hisilicon/hns3/hns3_ethtool.c    |  2 +
.../hisilicon/hns3/hns3pf/hclge_debugfs.c     | 14 +++
6 files changed, 154 insertions(+), 43 deletions(-)
[PATCH net 0/3] net: hns3: three fixes for hns3 driver
Posted by Jijie Shao 1 week, 2 days ago
This series contains three bug fixes for the HNS3 driver.

Patch 1 fixes a vector resource leak in the error path of
hns3_nic_alloc_vector_data, where a devm_kcalloc failure after
successful get_vector() leaves allocated vectors unreleased.

Patch 2 fixes an interface stall that occurs when the hardware RX
queue is full and memory allocation fails.  Without an RX interrupt,
NAPI is never scheduled and the queue cannot drain.  A delayed work
re-arms NAPI polling on affected vectors to break the deadlock.

Patch 3 fixes a use-after-free in debugfs read callbacks that can
access priv->ring and ring->desc while reset, driver unload, or
ethtool ring resize is freeing those resources.  A mutex is added
to synchronize debugfs readers against resource teardown.

Jijie Shao (3):
  net: hns3: fix vector resource leak in hns3_nic_alloc_vector_data
  net: hns3: fix interface stuck after OOM with full hardware rx queue
  net: hns3: fix use-after-free in debugfs read during reset/unload

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
 .../ethernet/hisilicon/hns3/hns3_debugfs.c    | 95 +++++++++++--------
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 68 ++++++++++++-
 .../net/ethernet/hisilicon/hns3/hns3_enet.h   | 17 ++++
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  2 +
 .../hisilicon/hns3/hns3pf/hclge_debugfs.c     | 14 +++
 6 files changed, 154 insertions(+), 43 deletions(-)


base-commit: 78445023439506ebd83b86d40b1e428a3b309d4a
-- 
2.43.0