[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230913104119.3344592-1-make_ruc2021@163.com>
Date: Wed, 13 Sep 2023 18:41:19 +0800
From: Ma Ke <make_ruc2021@....com>
To: shshaikh@...vell.com, manishc@...vell.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
GR-Linux-NIC-Dev@...vell.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Ma Ke <make_ruc2021@....com>
Subject: [PATCH] net/qlcnic: fix possible use-after-free bugs in qlcnic_alloc_rx_skb()
In qlcnic_alloc_rx_skb(), when dma_map_single() fails, skb is freed
immediately. And skb could be freed again. This issue could allow a
local attacker to crash the system due to a use-after-free flaw.
Signed-off-by: Ma Ke <make_ruc2021@....com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 41894d154013..6501aaf2b5ce 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -832,6 +832,7 @@ static int qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
if (dma_mapping_error(&pdev->dev, dma)) {
adapter->stats.rx_dma_map_error++;
dev_kfree_skb_any(skb);
+ skb = NULL;
return -ENOMEM;
}
--
2.37.2
Powered by blists - more mailing lists