From: Johannes Berg If TDLS setup packets are created by AF_PACKET or so, then the payload may not be present. Since we only care about those mac80211 generated (which are linear), just replace the skb->len check with a skb_headlen() check to avoid any out-of-bounds accesses. Assisted-by: LLM Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 27294466958d..8a9466ad9fe3 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2606,7 +2606,7 @@ static inline bool ieee80211_is_tdls_setup(struct sk_buff *skb) u16 ethertype = (skb->data[12] << 8) | skb->data[13]; return ethertype == ETH_P_TDLS && - skb->len > 14 && + skb_headlen(skb) > 14 && skb->data[14] == WLAN_TDLS_SNAP_RFTYPE; } -- 2.55.0