* [PATCH] drivers/net: fix a null-ptr-deref bug in drivers/net/wireless/marvell/mwifiex/uap_txrx.c
@ 2020-12-09 13:26 tangzhenhao
2020-12-17 16:33 ` Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: tangzhenhao @ 2020-12-09 13:26 UTC (permalink / raw)
To: linux-wireless; +Cc: amitkarwar, tangzhenhao
At line 257 in drivers/net/wireless/marvell/mwifiex/uap_txrx.c, the ret-val of skb_copy should be checked to avoid null-ptr-deref bug.
Signed-off-by: tangzhenhao <tzh18@mails.tsinghua.edu.cn>
---
drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
index 9bbdb8dfce62..d89311851594 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_txrx.c
@@ -255,6 +255,11 @@ int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
if (is_multicast_ether_addr(ra)) {
skb_uap = skb_copy(skb, GFP_ATOMIC);
+ if (!likely(skb_uap)) {
+ mwifiex_dbg(adapter, ERROR, "failed to allocate skb_uap");
+ dev_kfree_skb_any(skb);
+ return 0;
+ }
mwifiex_uap_queue_bridged_pkt(priv, skb_uap);
} else {
if (mwifiex_get_sta_entry(priv, ra)) {
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-03 8:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-09 13:26 [PATCH] drivers/net: fix a null-ptr-deref bug in drivers/net/wireless/marvell/mwifiex/uap_txrx.c tangzhenhao
2020-12-17 16:33 ` Kalle Valo
2021-01-03 8:20 ` Zhi Han
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox