mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs
authorJohannes Berg <johannes.berg@intel.com>
Fri, 26 Feb 2016 21:13:40 +0000 (22:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2016 15:43:00 +0000 (08:43 -0700)
commitdf1ceb2f08f4aef5eddbc17d509d1edb0aa1c2a8
tree0729220a65320254b6ab2aec205c05bc604d04be
parent2f67a4187a42f7d621ab2334b3db20920c1e3db3
mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs

commit 9acc54beb474c81148e2946603d141cf8716b19f upstream.

Just like for CCMP we need to check that for GCMP the fragments
have PNs that increment by one; the spec was updated to fix this
security issue and now has the following text:

The receiver shall discard MSDUs and MMPDUs whose constituent
MPDU PN values are not incrementing in steps of 1.

Adapt the code for CCMP to work for GCMP as well, luckily the
relevant fields already alias each other so no code duplication
is needed (just check the aliasing with BUILD_BUG_ON.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/ieee80211_i.h
net/mac80211/rx.c