]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: bail out if cipher schemes are invalid
authorJohannes Berg <johannes.berg@intel.com>
Thu, 8 Apr 2021 12:31:50 +0000 (14:31 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Apr 2021 13:32:48 +0000 (15:32 +0200)
commit9624baf8c3e7f13e0de2cd0cc11bf51e685cca12
tree8603111f6c5337e61dec142d0af0d225477e6686
parentf05d8db8244d0044279e67dc78dc8a8be1daf3e0
mac80211: bail out if cipher schemes are invalid

If any of the cipher schemes specified by the driver are invalid, bail
out and fail the registration rather than just warning.  Otherwise, we
might later crash when we try to use the invalid cipher scheme, e.g.
if the hdr_len is (significantly) less than the pn_offs + pn_len, we'd
have an out-of-bounds access in RX validation.

Fixes: e5deb36ffc6e ("mac80211: add generic cipher scheme support")
Link: https://lore.kernel.org/r/20210408143149.38a3a13a1b19.I6b7f5790fa0958ed8049cf02ac2a535c61e9bc96@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c