Commit dfe6e81d authored by Andy Green's avatar Andy Green Committed by David S. Miller

[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: default avatarAndy Green <andy@warmcat.com>
Signed-off-by: default avatarJiri Benc <jbenc@suse.cz>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0ec0b7ac
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/unaligned.h>
/* Radiotap header version (from official NetBSD feed) */ /* Radiotap header version (from official NetBSD feed) */
#define IEEE80211RADIOTAP_VERSION "1.5" #define IEEE80211RADIOTAP_VERSION "1.5"
...@@ -261,7 +262,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data) ...@@ -261,7 +262,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data)
struct ieee80211_radiotap_header *hdr = struct ieee80211_radiotap_header *hdr =
(struct ieee80211_radiotap_header *)data; (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 */ #endif /* IEEE80211_RADIOTAP_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment