]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mwifiex: fix use-after-free for FW reinit errors
authorBrian Norris <briannorris@chromium.org>
Tue, 28 Mar 2017 23:59:32 +0000 (16:59 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 5 Apr 2017 12:44:03 +0000 (15:44 +0300)
If we fail to reinit the FW when resetting the device (in the
synchronous version of mwifiex_init_hw_fw() -> mwifiex_fw_dpc()),
mwifiex_fw_dpc() will tear down the interface and free up the adapter.
But we don't actually check for all failure cases of mwifiex_fw_dpc(),
so some of them fall through and dereference adapter->fw_done with a
freed adapter, causing a use-after-free bug.

In any case, mwifiex_fw_dpc() will always signal FW completion -- in the
error OR success case -- so at best, this was repeat work. Let's not do
it.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/main.c

index 30f49944661f016784400e4553072e129c4ca8c5..98c83453ba5be99e0fa7fd42b874d66b699e1720 100644 (file)
@@ -1475,7 +1475,6 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter)
        }
        mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__);
 
-       complete_all(adapter->fw_done);
        return 0;
 
 err_init_fw: