wireless: radiotap: fix parsing buffer overrun
authorJohannes Berg <johannes.berg@intel.com>
Fri, 11 Oct 2013 12:47:05 +0000 (14:47 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 28 Nov 2013 14:02:04 +0000 (14:02 +0000)
commitd58900877a2845d03b40638fc3b4f2b2d0afe652
tree52dd5adfa6ecd997fc0a9ae85f67fadc2d5270b7
parentd6c0dfc93890ac6621b64a33ceeefa283aebec64
wireless: radiotap: fix parsing buffer overrun

commit f5563318ff1bde15b10e736e97ffce13be08bc1a upstream.

When parsing an invalid radiotap header, the parser can overrun
the buffer that is passed in because it doesn't correctly check
 1) the minimum radiotap header size
 2) the space for extended bitmaps

The first issue doesn't affect any in-kernel user as they all
check the minimum size before calling the radiotap function.
The second issue could potentially affect the kernel if an skb
is passed in that consists only of the radiotap header with a
lot of extended bitmaps that extend past the SKB. In that case
a read-only buffer overrun by at most 4 bytes is possible.

Fix this by adding the appropriate checks to the parser.

Reported-by: Evan Huus <eapache@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/wireless/radiotap.c