linux-uconsole/drivers/net/wireless
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
..
admtek
ath ath10k: adjust skb length in ath10k_sdio_mbox_rx_packet 2020-01-27 14:51:13 +01:00
atmel at76c50x-usb: Don't register led_trigger if usb_register_driver failed 2019-05-31 06:46:05 -07:00
broadcom brcmfmac: fix leak of mypkt on error return path 2020-01-27 14:50:38 +01:00
cisco wireless: airo: potential buffer overflow in sprintf() 2019-12-01 09:17:23 +01:00
intel iwlwifi: mvm: fix RSS config command 2020-01-27 14:50:19 +01:00
intersil p54usb: Fix race between disconnect and firmware loading 2019-07-14 08:11:19 +02:00
marvell libertas_tf: Use correct channel range in lbtf_geo_init 2020-01-27 14:51:02 +01:00
mediatek mt76: usb: fix possible memory leak in mt76u_buf_free 2020-01-27 14:50:23 +01:00
quantenna qtnfmac: drop error reports for out-of-bounds key indexes 2019-11-24 08:20:21 +01:00
ralink rt2x00: do not increment sequence number while re-transmitting 2019-04-27 09:36:38 +02:00
realtek rtlwifi: Fix file release memory leak 2020-01-27 14:51:11 +01:00
rsi rsi: release skb if rsi_prepare_beacon fails 2019-12-13 08:50:57 +01:00
st cw1200: Fix a signedness bug in cw1200_load_firmware() 2020-01-23 08:21:36 +01:00
ti wlcore: Fix the return value in case of error in 'wlcore_vendor_cmd_smart_config_start()' 2019-12-01 09:17:21 +01:00
zydas
Kconfig
mac80211_hwsim.c mac80211_hwsim: Fix possible null-pointer dereferences in hwsim_dump_radio_nl() 2019-08-29 08:28:33 +02:00
mac80211_hwsim.h
Makefile
ray_cs.c ray_cs: remove redundant pointer 'p' 2018-07-31 10:19:50 +03:00
ray_cs.h
rayctl.h
rndis_wlan.c
wl3501.h
wl3501_cs.c