Skip to contentSkip to conversation

Add get_unaligned to ieee80211_get_radiotap_len

PATCH New warmcat 1 participant 1 message Jul 26, 2007 mac80211

lore
Share & tools
lore

warmcat

author
#0 lore raw

PATCH 1/2 Add get_unaligned to ieee80211_get_radiotap_len

ieee80211_get_radiotap_len() tries to dereference radiotap length without taking care that it is completely unaligned and get_unaligned() is required.

---

 net/mac80211/ieee80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/mac80211/ieee80211.c +1 -1
index a42e70e..6f5c001 100644
@@ -350,7 +350,7 @@ static int ieee80211_get_radiotap_len(struct sk_buff *skb)
 	struct ieee80211_radiotap_header *hdr =
 		(struct ieee80211_radiotap_header *) skb->data;
 
-	return le16_to_cpu(hdr->it_len);
+	return le16_to_cpu(get_unaligned(&hdr->it_len));
 }
 
 #ifdef CONFIG_MAC80211_LOWTX_FRAME_DUMP