Linux wireless drivers development
 help / color / mirror / Atom feed
* [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

* Re: [PATCH] drivers/net: fix a null-ptr-deref bug in drivers/net/wireless/marvell/mwifiex/uap_txrx.c
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2020-12-17 16:33 UTC (permalink / raw)
  To: tangzhenhao; +Cc: linux-wireless, amitkarwar, tangzhenhao

tangzhenhao <tzh18@mails.tsinghua.edu.cn> wrote:

> 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>

The title does not use the correct format and the commit log is not word
wrapped.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201209132640.36031-1-tzh18@mails.tsinghua.edu.cn/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/net: fix a null-ptr-deref bug in drivers/net/wireless/marvell/mwifiex/uap_txrx.c
  2020-12-17 16:33 ` Kalle Valo
@ 2021-01-03  8:20   ` Zhi Han
  0 siblings, 0 replies; 3+ messages in thread
From: Zhi Han @ 2021-01-03  8:20 UTC (permalink / raw)
  To: tangzhenhao; +Cc: Kalle Valo, linux-wireless, amitkarwar

tangzhenhao <tzh18@mails.tsinghua.edu.cn> wrote:

> 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>

"\n" should be added at the end of message to avoid corrupting other logs
and to output timely.

^ permalink raw reply	[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