OrangePi_CM5/drivers/net/wireless/ath
Tetsuo Handa 9661724f62 wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg()
[ Upstream commit b383e8abed41cc6ff1a3b34de75df9397fa4878c ]

syzbot is reporting uninit value at ath9k_htc_rx_msg() [1], for
ioctl(USB_RAW_IOCTL_EP_WRITE) can call ath9k_hif_usb_rx_stream() with
pkt_len = 0 but ath9k_hif_usb_rx_stream() uses
__dev_alloc_skb(pkt_len + 32, GFP_ATOMIC) based on an assumption that
pkt_len is valid. As a result, ath9k_hif_usb_rx_stream() allocates skb
with uninitialized memory and ath9k_htc_rx_msg() is reading from
uninitialized memory.

Since bytes accessed by ath9k_htc_rx_msg() is not known until
ath9k_htc_rx_msg() is called, it would be difficult to check minimal valid
pkt_len at "if (pkt_len > 2 * MAX_RX_BUF_SIZE) {" line in
ath9k_hif_usb_rx_stream().

We have two choices. One is to workaround by adding __GFP_ZERO so that
ath9k_htc_rx_msg() sees 0 if pkt_len is invalid. The other is to let
ath9k_htc_rx_msg() validate pkt_len before accessing. This patch chose
the latter.

Note that I'm not sure threshold condition is correct, for I can't find
details on possible packet length used by this protocol.

Link: https://syzkaller.appspot.com/bug?extid=2ca247c2d60c7023de7f [1]
Reported-by: syzbot <syzbot+2ca247c2d60c7023de7f@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/7acfa1be-4b5c-b2ce-de43-95b0593fb3e5@I-love.SAKURA.ne.jp
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:46 +02:00
..
ar5523 ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply 2022-01-27 10:54:10 +01:00
ath5k ath5k: fix OOB in ath5k_eeprom_read_pcal_info_5111 2022-04-13 21:00:54 +02:00
ath6kl ath6kl: fix control-message timeout 2021-11-18 14:03:45 +01:00
ath9k wifi: ath9k: avoid uninit memory read in ath9k_htc_rx_msg() 2022-10-26 13:25:46 +02:00
ath10k wifi: ath10k: add peer map clean up for peer delete in ath10k_sta_state() 2022-10-26 13:25:18 +02:00
ath11k wifi: ath11k: fix number of VHT beamformee spatial streams 2022-10-26 13:25:21 +02:00
carl9170 carl9170: tx: fix an incorrect use of list iterator 2022-06-09 10:21:27 +02:00
wcn36xx wcn36xx: Differentiate wcn3660 from wcn3620 2022-03-28 09:57:10 +02:00
wil6210 wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()` 2022-08-21 15:15:49 +02:00
Kconfig Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2020-06-15 20:18:39 +03:00
Makefile
ath.h ath: Modify ath_key_delete() to not need full key entry 2021-08-26 08:35:32 -04:00
debug.c
dfs_pattern_detector.c ath: dfs_pattern_detector: Fix possible null-pointer dereference in channel_detector_create() 2021-11-18 14:03:57 +01:00
dfs_pattern_detector.h
dfs_pri_detector.c
dfs_pri_detector.h
hw.c
key.c ath: Modify ath_key_delete() to not need full key entry 2021-08-26 08:35:32 -04:00
main.c
reg.h
regd.c Revert "ath: add support for special 0x0 regulatory domain" 2022-03-28 09:57:10 +02:00
regd.h
regd_common.h
spectral_common.h ath11k: add support for spectral scan 2020-06-15 17:21:54 +03:00
trace.c
trace.h