• Johannes Berg's avatar
    wireless: radiotap: fix parsing buffer overrun · add8ec07
    Johannes Berg authored
    commit f5563318 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: default avatarEvan Huus <eapache@gmail.com>
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    add8ec07
radiotap.c 11.5 KB