ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait
authorCarl Huang <cjhuang@codeaurora.org>
Mon, 5 Mar 2018 06:44:02 +0000 (14:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Oct 2018 07:18:56 +0000 (09:18 +0200)
commitbbb4cc291ccd34511189829b69f8f9ce4c6bd2ef
tree962c9320462dbe3693b71e11b48b9cb2b697550c
parent35b80e75a642b6bebda61571176e46b43de0d5dd
ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait

commit 9ef0f58ed7b4a55da4a64641d538e0d9e46579ac upstream.

The skb may be freed in tx completion context before
trace_ath10k_wmi_cmd is called. This can be easily captured when
KASAN(Kernel Address Sanitizer) is enabled. The fix is to move
trace_ath10k_wmi_cmd before the send operation. As the ret has no
meaning in trace_ath10k_wmi_cmd then, so remove this parameter too.

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath10k/trace.h
drivers/net/wireless/ath/ath10k/wmi.c