]> git.baikalelectronics.ru Git - kernel.git/commit
wcn36xx: Fix firmware crash due to corrupted buffer address
authorLoic Poulain <loic.poulain@linaro.org>
Tue, 27 Mar 2018 08:26:57 +0000 (11:26 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 29 Mar 2018 08:57:19 +0000 (11:57 +0300)
commit425e96dd9c18a734933ca4262b1387992cf08c64
tree8db4be4b6eb3c1940ef73d71045669d1f218ddf5
parent60f3fd64984cce298127768b719054a3e622ccfb
wcn36xx: Fix firmware crash due to corrupted buffer address

wcn36xx_start_tx function retrieves the buffer descriptor from the
channel control queue to start filling tx buffer information. However,
nothing prevents this same buffer to be concurrently accessed in a
concurent tx call, leading to potential buffer coruption and firmware
crash (observed during iperf test). The channel control queue should
only be accessed and updated with the channel lock.

Fix this issue by using a local buffer descriptor which will be copied
in the thread-safe wcn36xx_dxe_tx_frame.

Note that buffer descriptor size is few bytes so the introduced copy
overhead is insignificant. Moreover, this allows to keep the locked
section minimal.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/dxe.c
drivers/net/wireless/ath/wcn36xx/dxe.h
drivers/net/wireless/ath/wcn36xx/txrx.c