Skip to contentSkip to conversation

WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.

PATCH Applied Krzysztof Halasa 3 participants 5 messages Apr 15, 2010 – Apr 22, 2010

Subsystems (3)
lore
Share & tools
lore

Krzysztof Halasa

author maintainer
#0 lore raw

PATCH 1/1 WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.

tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

drivers/net/wan/hdlc_ppp.c +6 -0
index b9b9d6b..941f053 100644
@@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *dev)
 	ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL);
 }
 
+static void ppp_close(struct net_device *dev)
+{
+	ppp_tx_flush();
+}
+
 static struct hdlc_proto proto = {
 	.start		= ppp_start,
 	.stop		= ppp_stop,
+	.close		= ppp_close,
 	.type_trans	= ppp_type_trans,
 	.ioctl		= ppp_ioctl,
 	.netif_rx	= ppp_rx,
maintainer Applied
#1 lore raw

From: Krzysztof Halasa <[email protected]>
Date: Thu, 15 Apr 2010 02:09:52 +0200

Quoted 8 lines

tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

Applied, thank you.

#2 lore raw
In reply to Krzysztof Halasa
Quoted 6 lines · Krzysztof Halasa

tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

Great - thanks. Will this be going into -stable?

Signature · 1 line
Michael Barkowski
maintainer
#3 lore raw

From: Michael Barkowski <[email protected]>
Date: Thu, 22 Apr 2010 15:17:13 -0400

Quoted 9 lines
Quoted 6 lines · Krzysztof Halasa

tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

Great - thanks. Will this be going into -stable?

When I think it's cooked long enough in Linus's tree and I submit it there. That can take a few weeks.

#4 lore raw
Quoted 9 lines · David Miller

From: Michael Barkowski <[email protected]>
Date: Thu, 22 Apr 2010 15:17:13 -0400

Quoted 6 lines
Quoted 5 lines · Krzysztof Halasa

tx_queue is used as a temporary queue when not allowed to queue skb directly to the hw device driver (which may sleep). Most paths flush it before returning, but ppp_start() currently cannot. Make sure we don't leave skbs pointing to a non-existent device.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

Thanks to Michael Barkowski for reporting this problem.

Great - thanks. Will this be going into -stable?

When I think it's cooked long enough in Linus's tree and I submit it there. That can take a few weeks.

Super. By the way, should have mentioned - tested and works for me

Signature · 1 line
Michael Barkowski