From: Andy Green Date: Fri, 27 Jul 2007 13:43:24 +0000 (+0200) Subject: [MAC80211]: Add get_unaligned to ieee80211_get_radiotap_len X-Git-Tag: v2.6.24-rc1~1454^2~847 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=dfe6e81deaa79c85086c0cc8d85b229e444ab97f;p=linux-2.6-omap-h63xx.git [MAC80211]: 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. Signed-off-by: Andy Green Signed-off-by: Jiri Benc Signed-off-by: John W. Linville --- diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 22e047758ba..dfd8bf66ce2 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h @@ -40,6 +40,7 @@ #include #include +#include /* Radiotap header version (from official NetBSD feed) */ #define IEEE80211RADIOTAP_VERSION "1.5" @@ -261,7 +262,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data) struct ieee80211_radiotap_header *hdr = (struct ieee80211_radiotap_header *)data; - return le16_to_cpu(hdr->it_len); + return le16_to_cpu(get_unaligned(&hdr->it_len)); } #endif /* IEEE80211_RADIOTAP_H */