]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern
authorWen Gong <quic_wgong@quicinc.com>
Mon, 10 Jan 2022 14:24:13 +0000 (16:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:23 +0000 (14:23 +0200)
commitfeda9eacca6b96e1ed5d10c695631e7490566325
tree83ad96353dc9831bcc04e1edfc85dfc6a436a37b
parent1e4854a0c02c40f4669554cad0cb008e6128ea3c
ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern

[ Upstream commit 60ec828edbcc9f33beaec2b4523e4a9384ca2d87 ]

In function ath10k_wow_convert_8023_to_80211(), it will do memcpy for
the new->pattern, and currently the new->pattern and new->mask is same
with the old, then the memcpy of new->pattern will also overwrite the
old->pattern, because the header format of new->pattern is 802.11,
its length is larger than the old->pattern which is 802.3. Then the
operation of "Copy frame body" will copy a mistake value because the
body memory has been overwrite when memcpy the new->pattern.

Assign another empty value to new_pattern to avoid the overwrite issue.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

Fixes: 35be9fd864fe ("ath10k: convert wow pattern from 802.3 to 802.11")
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211222031347.25463-1-quic_wgong@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/wow.c