Skip to contentSkip to conversation

Patch "mwifiex: sdio: fix use after free issue for save_adapter" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Nov 28, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mwifiex: sdio: fix use after free issue for save_adapter

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mwifiex-sdio-fix-use-after-free-issue-for-save_adapter.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Nov 28 10:49:28 CET 2017

From: Amitkumar Karwar <[email protected]>
Date: Thu, 1 Dec 2016 19:23:31 +0530
Subject: mwifiex: sdio: fix use after free issue for save_adapter

From: Amitkumar Karwar <[email protected]>

[ Upstream commit 74c8719b8ee0922593a5cbec0bd6127d86d8a2f4 ]

If we have sdio work requests received when sdio card reset is happening, we may end up accessing older save_adapter pointer later which is already freed during card reset.
This patch solves the problem by cancelling those pending requests.

---
 drivers/net/wireless/marvell/mwifiex/sdio.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/wireless/marvell/mwifiex/sdio.c +6 -0
@@ -2296,6 +2296,12 @@ static void mwifiex_recreate_adapter(str
 	mmc_hw_reset(func->card->host);
 	sdio_release_host(func);
 
+	/* Previous save_adapter won't be valid after this. We will cancel
+	 * pending work requests.
+	 */
+	clear_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags);
+	clear_bit(MWIFIEX_IFACE_WORK_CARD_RESET, &iface_work_flags);
+
 	mwifiex_sdio_probe(func, device_id);
 }
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/mwifiex-sdio-fix-use-after-free-issue-for-save_adapter.patch