mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs

[ Upstream commit 9acc54beb4 ]

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.)

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
This commit is contained in:
Johannes Berg 2016-02-26 22:13:40 +01:00 • committed by Sasha Levin
commit 87e0016ccb
2 changed files with 28 additions and 10 deletions