Thread (1 message) 1 message, 1 author, 2025-05-20

Re: [PATCH] wifi: Check if socket flags are valid

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2025-05-20 13:22:10
Also in: linux-next, linux-wireless, lkml

Hi Bert,

Thank you _very_ much for doing all this debug. I was somewhat following
along on my phone, but was out over the weekend.
quoted hunk
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -618,7 +618,7 @@ static inline bool wil_need_txstat(struct sk_buff *skb)
 	const u8 *da = wil_skb_get_da(skb);
 
 	return is_unicast_ether_addr(da) && skb->sk &&
-	       sock_flag(skb->sk, SOCK_WIFI_STATUS);
+	       sk_fullsock(skb->sk) && sock_flag(skb->sk, SOCK_WIFI_STATUS);
I feel like in line with sk_is_refcounted(), maybe we could add

static inline bool
sk_requests_wifi_status(struct sock *sk)
{
	return sk && sk_fullsock(sk) && sock_flag(sk,
SOCK_WIFI_STATUS);
}

perhaps?

That's basically all the checks in all the callers.

I can also just do that though if you don't want to resend.

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help