mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFT v2] [media] siano: FIX use-after-free in worker_thread
@ 2017-09-27 18:32 Arvind Yadav
  2017-09-27 18:48 ` Andrey Konovalov
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-09-27 18:32 UTC (permalink / raw)
  To: andreyknvl, mchehab, kcc, dvyukov, mchehab, javier, sakari.ailus,
	laurent.pinchart
  Cc: linux-media, linux-kernel, syzkaller

Call flush_work() on failure and disconnect. Work initialize and schedule
in smsusb_onresponse(). it should be freed in smsusb_stop_streaming().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
This bug report by Andrey Konovalov "usb/media/smsusb: use-after-free in
worker_thread".
changes in v2 : 
              call flush_work() in smsusb_stop_streaming().

 drivers/media/usb/siano/smsusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 8c1f926..8142ba4 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -192,6 +192,8 @@ static void smsusb_stop_streaming(struct smsusb_device_t *dev)
 	for (i = 0; i < MAX_URBS; i++) {
 		usb_kill_urb(&dev->surbs[i].urb);
 
+		flush_work(&dev->surbs[i].wq);
+
 		if (dev->surbs[i].cb) {
 			smscore_putbuffer(dev->coredev, dev->surbs[i].cb);
 			dev->surbs[i].cb = NULL;
-- 
2.7.4

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

end of thread, other threads:[~2017-09-27 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27 18:32 [RFT v2] [media] siano: FIX use-after-free in worker_thread Arvind Yadav
2017-09-27 18:48 ` Andrey Konovalov

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®