From: Govind Singh Date: Thu, 20 Sep 2018 05:04:26 +0000 (+0530) Subject: ath10k: disable napi before resource cleanup to avoid "use after free" X-Git-Tag: v5.4-rc1~2266^2~144^2~24^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=393b9b0f830efc21c26a4ef9a9ce4d517eb98463;p=platform%2Fkernel%2Flinux-rpi.git ath10k: disable napi before resource cleanup to avoid "use after free" CE buffers are cleaned up prior to napi disable and this is causing NULL pointer dereference due to "use after free". Disable napi before resource cleanup to avoid "use after free". Signed-off-by: Govind Singh Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 3470310..f7b5b85 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -731,9 +731,9 @@ static void ath10k_snoc_buffer_cleanup(struct ath10k *ar) static void ath10k_snoc_hif_stop(struct ath10k *ar) { ath10k_snoc_irq_disable(ar); - ath10k_snoc_buffer_cleanup(ar); napi_synchronize(&ar->napi); napi_disable(&ar->napi); + ath10k_snoc_buffer_cleanup(ar); ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n"); }