[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1589984008.54508774@decadent.org.uk>
Date: Wed, 20 May 2020 15:13:51 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Siva Rebbagondla" <siva.rebbagondla@...pinesignals.com>,
"Fariya Fatima" <fariyaf@...il.com>,
"Johan Hovold" <johan@...nel.org>,
"Amitkumar Karwar" <amit.karwar@...pinesignals.com>,
"Prameela Rani Garnepudi" <prameela.j04cs@...il.com>,
"Kalle Valo" <kvalo@...eaurora.org>,
syzbot+b563b7f8dbe8223a51e8@...kaller.appspotmail.com
Subject: [PATCH 3.16 23/99] rsi: fix use-after-free on failed probe and unbind
3.16.84-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@...nel.org>
commit e93cd35101b61e4c79149be2cfc927c4b28dc60c upstream.
Make sure to stop both URBs before returning after failed probe as well
as on disconnect to avoid use-after-free in the completion handler.
Reported-by: syzbot+b563b7f8dbe8223a51e8@...kaller.appspotmail.com
Fixes: a4302bff28e2 ("rsi: add bluetooth rx endpoint")
Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: Siva Rebbagondla <siva.rebbagondla@...pinesignals.com>
Cc: Prameela Rani Garnepudi <prameela.j04cs@...il.com>
Cc: Amitkumar Karwar <amit.karwar@...pinesignals.com>
Cc: Fariya Fatima <fariyaf@...il.com>
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Kalle Valo <kvalo@...eaurora.org>
[bwh: Backported to 3.16: There is no BT support, so we only need to
kill one URB on disconnect.]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -245,6 +245,14 @@ static void rsi_rx_done_handler(struct u
rsi_set_event(&dev->rx_thread.event);
}
+static void rsi_rx_urb_kill(struct rsi_hw *adapter)
+{
+ struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
+ struct urb *urb = dev->rx_usb_urb[0];
+
+ usb_kill_urb(urb);
+}
+
/**
* rsi_rx_urb_submit() - This function submits the given URB to the USB stack.
* @adapter: Pointer to the adapter structure.
@@ -510,6 +518,8 @@ static void rsi_disconnect(struct usb_in
if (!adapter)
return;
+ rsi_rx_urb_kill(adapter);
+
rsi_mac80211_detach(adapter);
rsi_deinit_usb_interface(adapter);
rsi_91x_deinit(adapter);
Powered by blists - more mailing lists