From: Ma Ke <make_ruc2021@163.com>
To: shshaikh@marvell.com, manishc@marvell.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
GR-Linux-NIC-Dev@marvell.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Ma Ke <make_ruc2021@163.com>
Subject: [PATCH] net/qlcnic: fix possible use-after-free bugs in qlcnic_alloc_rx_skb()
Date: Wed, 13 Sep 2023 18:41:19 +0800 [thread overview]
Message-ID: <20230913104119.3344592-1-make_ruc2021@163.com> (raw)
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@163.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
next reply other threads:[~2023-09-13 10:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 10:41 Ma Ke [this message]
2023-09-15 5:45 ` Simon Horman
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=20230913104119.3344592-1-make_ruc2021@163.com \
--to=make_ruc2021@163.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shshaikh@marvell.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®