ath10k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: Check return value of ath10k_get_arvif in ath10k_wmi_event_tdls_peer
@ 2022-10-03  9:12 Peter Kosyh
  2022-10-13  6:21 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kosyh @ 2022-10-03  9:12 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Peter Kosyh, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, ath10k, linux-wireless, netdev, linux-kernel

Return value of a function 'ath10k_get_arvif' is dereferenced without
checking for null in ath10k_wmi_event_tdls_peer, but it is usually checked
for this function.

Make ath10k_wmi_event_tdls_peer do check retval of ath10k_get_arvif.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Peter Kosyh <pkosyh@yandex.ru>
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 876410a47d1d..1f2c37c642ff 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -585,6 +585,11 @@ static void ath10k_wmi_event_tdls_peer(struct ath10k *ar, struct sk_buff *skb)
 			goto exit;
 		}
 		arvif = ath10k_get_arvif(ar, __le32_to_cpu(ev->vdev_id));
+		if (!arvif) {
+			ath10k_warn(ar, "no vif for vdev_id %d found\n",
+				__le32_to_cpu(ev->vdev_id));
+			goto exit;
+		}
 		ieee80211_tdls_oper_request(
 					arvif->vif, station->addr,
 					NL80211_TDLS_TEARDOWN,
-- 
2.37.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: Check return value of ath10k_get_arvif in ath10k_wmi_event_tdls_peer
  2022-10-03  9:12 [PATCH] ath10k: Check return value of ath10k_get_arvif in ath10k_wmi_event_tdls_peer Peter Kosyh
@ 2022-10-13  6:21 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-10-13  6:21 UTC (permalink / raw)
  To: Peter Kosyh
  Cc: Peter Kosyh, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, ath10k, linux-wireless, netdev, linux-kernel

Peter Kosyh <pkosyh@yandex.ru> wrote:

> Return value of a function ath10k_get_arvif() is dereferenced without
> checking for null in ath10k_wmi_event_tdls_peer(), but it is usually checked
> for this function.
> 
> Make ath10k_wmi_event_tdls_peer() do check retval of ath10k_get_arvif().
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Peter Kosyh <pkosyh@yandex.ru>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

473118917cc3 wifi: ath10k: Check return value of ath10k_get_arvif() in ath10k_wmi_event_tdls_peer()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221003091217.322598-1-pkosyh@yandex.ru/

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


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2022-10-13  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03  9:12 [PATCH] ath10k: Check return value of ath10k_get_arvif in ath10k_wmi_event_tdls_peer Peter Kosyh
2022-10-13  6:21 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).