• Peng Xu's avatar
    nl80211: Define policy for packet pattern attributes · 6a6c61d8
    Peng Xu authored
    commit ad670233 upstream.
    
    Define a policy for packet pattern attributes in order to fix a
    potential read over the end of the buffer during nla_get_u32()
    of the NL80211_PKTPAT_OFFSET attribute.
    
    Note that the data there can always be read due to SKB allocation
    (with alignment and struct skb_shared_info at the end), but the
    data might be uninitialized. This could be used to leak some data
    from uninitialized vmalloc() memory, but most drivers don't allow
    an offset (so you'd just get -EINVAL if the data is non-zero) or
    just allow it with a fixed value - 100 or 128 bytes, so anything
    above that would get -EINVAL. With brcmfmac the limit is 1500 so
    (at least) one byte could be obtained.
    
    Cc: stable@kernel.org
    Signed-off-by: default avatarPeng Xu <pxu@qti.qualcomm.com>
    Signed-off-by: default avatarJouni Malinen <jouni@qca.qualcomm.com>
    [rewrite description based on SKB allocation knowledge]
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    6a6c61d8
nl80211.c 350 KB