summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-16 12:04:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 12:24:23 -0800
commit6646ce885ff19da84a20193b1b36629f7953305a (patch)
tree209af9d4c83ba64c7c3301c7dd4b0dc15dd2d485 /net/wireless
parent4e7255f33a03b219d76b32b7e7e1cb395004668a (diff)
downloadlinux-3.10-6646ce885ff19da84a20193b1b36629f7953305a.tar.gz
linux-3.10-6646ce885ff19da84a20193b1b36629f7953305a.tar.bz2
linux-3.10-6646ce885ff19da84a20193b1b36629f7953305a.zip
radiotap: fix bitmap-end-finding buffer overrun
commit bd02cd2549cfcdfc57cb5ce57ffc3feb94f70575 upstream. Evan Huus found (by fuzzing in wireshark) that the radiotap iterator code can access beyond the length of the buffer if the first bitmap claims an extension but then there's no data at all. Fix this. Reported-by: Evan Huus <eapache@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/radiotap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index a271c27fac7..722da616438 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -124,6 +124,10 @@ int ieee80211_radiotap_iterator_init(
/* find payload start allowing for extended bitmap(s) */
if (iterator->_bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT)) {
+ if ((unsigned long)iterator->_arg -
+ (unsigned long)iterator->_rtheader + sizeof(uint32_t) >
+ (unsigned long)iterator->_max_length)
+ return -EINVAL;
while (get_unaligned_le32(iterator->_arg) &
(1 << IEEE80211_RADIOTAP_EXT)) {
iterator->_arg += sizeof(uint32_t);