linux-uconsole/drivers/net/wireless/ath
Nicolas Boichat c0469da299 ath10k: adjust skb length in ath10k_sdio_mbox_rx_packet
[ Upstream commit b713996083 ]

When the FW bundles multiple packets, pkt->act_len may be incorrect
as it refers to the first packet only (however, the FW will only
bundle packets that fit into the same pkt->alloc_len).

Before this patch, the skb length would be set (incorrectly) to
pkt->act_len in ath10k_sdio_mbox_rx_packet, and then later manually
adjusted in ath10k_sdio_mbox_rx_process_packet.

The first problem is that ath10k_sdio_mbox_rx_process_packet does not
use proper skb_put commands to adjust the length (it directly changes
skb->len), so we end up with a mismatch between skb->head + skb->tail
and skb->data + skb->len. This is quite serious, and causes corruptions
in the TCP stack, as the stack tries to coalesce packets, and relies
on skb->tail being correct (that is, skb_tail_pointer must point to
the first byte_after_ the data).

Instead of re-adjusting the size in ath10k_sdio_mbox_rx_process_packet,
this moves the code to ath10k_sdio_mbox_rx_packet, and also add a
bounds check, as skb_put would crash the kernel if not enough space is
available.

Tested with QCA6174 SDIO with firmware
WLAN.RMH.4.4.1-00007-QCARMSWP-1.

Fixes: 8530b4e7b2 ("ath10k: sdio: set skb len for all rx packets")
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:51:13 +01:00
..
ar5523 ar5523: check NULL before memcpy() in ar5523_cmd() 2019-12-17 20:34:57 +01:00
ath5k ath5k: remove redundant pointer rf 2018-07-30 20:55:55 +03:00
ath6kl ath6kl: Fix off by one error in scan completion 2019-12-05 09:20:41 +01:00
ath9k ath9k: dynack: fix possible deadlock in ath_dynack_node_{de}init 2020-01-27 14:51:10 +01:00
ath10k ath10k: adjust skb length in ath10k_sdio_mbox_rx_packet 2020-01-27 14:51:13 +01:00
carl9170 carl9170: fix misuse of device driver API 2019-07-14 08:11:21 +02:00
wcn36xx wcn36xx: use dynamic allocation for large variables 2020-01-27 14:51:10 +01:00
wil6210 wil6210: fix locking in wmi_call 2019-12-01 09:17:20 +01:00
ath.h
debug.c
dfs_pattern_detector.c ath: DFS JP domain W56 fixed pulse type 3 RADAR detection 2019-07-26 09:13:58 +02:00
dfs_pattern_detector.h
dfs_pri_detector.c
dfs_pri_detector.h
hw.c
Kconfig
key.c
main.c
Makefile
reg.h
regd.c
regd.h
regd_common.h
spectral_common.h
trace.c
trace.h