mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] mwifiex: fix use-after-free for FW reinit errors
@ 2017-03-28 23:59 Brian Norris
  2017-03-28 23:59 ` [PATCH 2/2] mwifiex: catch mwifiex_fw_dpc() errors properly in reset Brian Norris
  2017-04-05 12:44 ` [1/2] mwifiex: fix use-after-free for FW reinit errors Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Norris @ 2017-03-28 23:59 UTC (permalink / raw)
  To: Amitkumar Karwar, Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu
  Cc: linux-kernel, Kalle Valo, linux-wireless, Brian Norris

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>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 30f49944661f..98c83453ba5b 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -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:
-- 
2.12.2.564.g063fe858b8-goog

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-05 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 23:59 [PATCH 1/2] mwifiex: fix use-after-free for FW reinit errors Brian Norris
2017-03-28 23:59 ` [PATCH 2/2] mwifiex: catch mwifiex_fw_dpc() errors properly in reset Brian Norris
2017-04-05 12:44 ` [1/2] mwifiex: fix use-after-free for FW reinit errors Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®