mac80211: twt: don't use potentially unaligned pointer
authorJohannes Berg <johannes.berg@intel.com>
Mon, 27 Sep 2021 09:51:24 +0000 (11:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:25 +0000 (19:16 +0100)
commit6adf16c2e5a2d32ca29c097282c18a51da5f9b60
treee83832fc6c31c2ee92795853d20a3ffdc3cc74b0
parent80adbd8c450235c6618311103ab578190a80bfd0
mac80211: twt: don't use potentially unaligned pointer

[ Upstream commit 7ff379ba2d4b7b205240e666601fe302207d73f8 ]

Since we're pointing into a frame, the pointer to the
twt_agrt->req_type struct member is potentially not
aligned properly. Open-code le16p_replace_bits() to
avoid passing an unaligned pointer.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: f5a4c24e689f ("mac80211: introduce individual TWT support in AP mode")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20210927115124.e1208694f37b.Ie3de9bcc5dde5a79e3ac81f3185beafe4d214e57@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/s1g.c