linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] p54usb: fix usb_kill_urb hang with slub_debug=P
@ 2008-12-05 14:47 Christian Lamparter
  2008-12-05 15:14 ` Larry Finger
  2008-12-05 15:53 ` Greg KH
  0 siblings, 2 replies; 11+ messages in thread
From: Christian Lamparter @ 2008-12-05 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: Johannes Berg, John W Linville, linux-usb, gregkh, linux-kernel

This patch fixes a problem identified by Johannes Berg.

It looks like this is a classic case of "use-after-freed". 
A module which should reproduce the problem on
any other USB device can be found right here:
http://kerneltrap.org/mailarchive/linux-usb/2008/12/4/4317064

Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
CC: stable@vger.kernel.org
---
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 3444f52..0b9a922 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -209,7 +209,14 @@ static void p54u_free_urbs(struct ieee80211_hw *dev)
 		if (!info->urb)
 			continue;
 
+		/*
+		 * usb_get_urb and usb_free_urb are part of a temporary
+		 * workaround. Otherwise we get a pretty bad freeze,
+		 * if SLUB's poisoning debug option is enabled.
+		 */
+		usb_get_urb(info->urb);
 		usb_kill_urb(info->urb);
+		usb_free_urb(info->urb);
 		kfree_skb(skb);
 	}
 }


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

end of thread, other threads:[~2008-12-08 14:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-05 14:47 [PATCH] p54usb: fix usb_kill_urb hang with slub_debug=P Christian Lamparter
2008-12-05 15:14 ` Larry Finger
2008-12-05 15:58   ` Christian Lamparter
2008-12-05 15:53 ` Greg KH
2008-12-05 23:18   ` Larry Finger
2008-12-05 23:23     ` Greg KH
2008-12-06 20:09       ` [RFC][PATCH] p54usb: rewriting rx/tx routines to make use of usb_anchor's facilities Christian Lamparter
2008-12-06 21:47         ` Larry Finger
2008-12-07  4:15           ` Alan Stern
2008-12-08 14:06             ` [RFC][PATCH v2] " Christian Lamparter
2008-12-05 23:28     ` [PATCH] p54usb: fix usb_kill_urb hang with slub_debug=P Christian Lamparter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).