netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Vague maybe ppp-related panic report for 2.6.23-rc9
@ 2007-10-04 18:12 Roland Dreier
  2007-10-04 20:51 ` David Miller
  2007-10-05  1:59 ` Roland Dreier
  0 siblings, 2 replies; 5+ messages in thread
From: Roland Dreier @ 2007-10-04 18:12 UTC (permalink / raw)
  To: linux-kernel, netdev

I'm running 2.6.23-rc9 on my laptop, and when in a coffee shop I use
a Verizon EVDO card to get network access.  This is a kyocera device
that looks like a serial adapter behind an ohci usb controller, and
uses the airprime driver (for usb device 0c88:17da).  The actual IP
networking is ppp over that serial adapter.

The connection is slightly flaky (I blame this on the Verizon
coverage), so I end up restarting things every so often.  The point of
this email (at last) is that I've just seen my second panic (only
info: blinking caps lock led, since I've been in X) that seems
correlated to stopping/restarting pppd.

Sorry for the lack of detail -- I've just switched to running in the
console so if I can provoke the crash again I'll get a little more
info.  I just wanted to mention this in case someone has seen
something similar or has any good ideas about how to capture debugging
output on a laptop (when I'm not home and have no other boxes handy).

 - R.

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

* Re: Vague maybe ppp-related panic report for 2.6.23-rc9
  2007-10-04 18:12 Vague maybe ppp-related panic report for 2.6.23-rc9 Roland Dreier
@ 2007-10-04 20:51 ` David Miller
  2007-10-04 20:53   ` Roland Dreier
  2007-10-05  0:49   ` Herbert Xu
  2007-10-05  1:59 ` Roland Dreier
  1 sibling, 2 replies; 5+ messages in thread
From: David Miller @ 2007-10-04 20:51 UTC (permalink / raw)
  To: rdreier; +Cc: linux-kernel, netdev, herbert

From: Roland Dreier <rdreier@cisco.com>
Date: Thu, 04 Oct 2007 11:12:42 -0700

> Sorry for the lack of detail -- I've just switched to running in the
> console so if I can provoke the crash again I'll get a little more
> info.  I just wanted to mention this in case someone has seen
> something similar or has any good ideas about how to capture debugging
> output on a laptop (when I'm not home and have no other boxes handy).

I don't want to jump the gun on the analysis but it just might
be the packet sharing fixes Herbert put in a short time ago.

What you could do is go back to say rc2 and see if you still get
the panics, then bisect from there to narrow it down.

If rc2 still gives the panic, it's something else, perhaps device
specific.

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

* Re: Vague maybe ppp-related panic report for 2.6.23-rc9
  2007-10-04 20:51 ` David Miller
@ 2007-10-04 20:53   ` Roland Dreier
  2007-10-05  0:49   ` Herbert Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2007-10-04 20:53 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, netdev, herbert

 > I don't want to jump the gun on the analysis but it just might
 > be the packet sharing fixes Herbert put in a short time ago.
 > 
 > What you could do is go back to say rc2 and see if you still get
 > the panics, then bisect from there to narrow it down.
 > 
 > If rc2 still gives the panic, it's something else, perhaps device
 > specific.

OK thanks.  I'm still trying to find a good way to reproduce it, so
I'm going to try to get it to happen with -rc9 while running in the
console, and at least take a picture of the backtrace.  If I find a
good way to make it happen then I'll try rc2 and let you know.

 - R.

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

* Re: Vague maybe ppp-related panic report for 2.6.23-rc9
  2007-10-04 20:51 ` David Miller
  2007-10-04 20:53   ` Roland Dreier
@ 2007-10-05  0:49   ` Herbert Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2007-10-05  0:49 UTC (permalink / raw)
  To: David Miller; +Cc: rdreier, linux-kernel, netdev

On Thu, Oct 04, 2007 at 01:51:13PM -0700, David Miller wrote:
> 
> I don't want to jump the gun on the analysis but it just might
> be the packet sharing fixes Herbert put in a short time ago.

I think the only change of mine that could affect ppp over a
serial line is this one.  I couldn't see anything obvious in
it but maybe someone else can.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
2a38b775b77f99308a4e571c13d908df78ac5e57
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 7e21342..4b49d0e 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1525,7 +1525,7 @@ ppp_input_error(struct ppp_channel *chan, int code)
 static void
 ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
-	if (skb->len >= 2) {
+	if (pskb_may_pull(skb, 2)) {
 #ifdef CONFIG_PPP_MULTILINK
 		/* XXX do channel-level decompression here */
 		if (PPP_PROTO(skb) == PPP_MP)
@@ -1577,7 +1577,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
 		if (ppp->vj == 0 || (ppp->flags & SC_REJ_COMP_TCP))
 			goto err;
 
-		if (skb_tailroom(skb) < 124) {
+		if (skb_tailroom(skb) < 124 || skb_cloned(skb)) {
 			/* copy to a new sk_buff with more tailroom */
 			ns = dev_alloc_skb(skb->len + 128);
 			if (ns == 0) {
@@ -1648,23 +1648,29 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
 		/* check if the packet passes the pass and active filters */
 		/* the filter instructions are constructed assuming
 		   a four-byte PPP header on each packet */
-		*skb_push(skb, 2) = 0;
-		if (ppp->pass_filter
-		    && sk_run_filter(skb, ppp->pass_filter,
-				     ppp->pass_len) == 0) {
-			if (ppp->debug & 1)
-				printk(KERN_DEBUG "PPP: inbound frame not passed\n");
-			kfree_skb(skb);
-			return;
-		}
-		if (!(ppp->active_filter
-		      && sk_run_filter(skb, ppp->active_filter,
-				       ppp->active_len) == 0))
-			ppp->last_recv = jiffies;
-		skb_pull(skb, 2);
-#else
-		ppp->last_recv = jiffies;
+		if (ppp->pass_filter || ppp->active_filter) {
+			if (skb_cloned(skb) &&
+			    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+				goto err;
+
+			*skb_push(skb, 2) = 0;
+			if (ppp->pass_filter
+			    && sk_run_filter(skb, ppp->pass_filter,
+					     ppp->pass_len) == 0) {
+				if (ppp->debug & 1)
+					printk(KERN_DEBUG "PPP: inbound frame "
+					       "not passed\n");
+				kfree_skb(skb);
+				return;
+			}
+			if (!(ppp->active_filter
+			      && sk_run_filter(skb, ppp->active_filter,
+					       ppp->active_len) == 0))
+				ppp->last_recv = jiffies;
+			__skb_pull(skb, 2);
+		} else
 #endif /* CONFIG_PPP_FILTER */
+			ppp->last_recv = jiffies;
 
 		if ((ppp->dev->flags & IFF_UP) == 0
 		    || ppp->npmode[npi] != NPMODE_PASS) {
@@ -1762,7 +1768,7 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 	struct channel *ch;
 	int mphdrlen = (ppp->flags & SC_MP_SHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
 
-	if (!pskb_may_pull(skb, mphdrlen) || ppp->mrru == 0)
+	if (!pskb_may_pull(skb, mphdrlen + 1) || ppp->mrru == 0)
 		goto err;		/* no good, throw it away */
 
 	/* Decode sequence number and begin/end bits */

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

* Re: Vague maybe ppp-related panic report for 2.6.23-rc9
  2007-10-04 18:12 Vague maybe ppp-related panic report for 2.6.23-rc9 Roland Dreier
  2007-10-04 20:51 ` David Miller
@ 2007-10-05  1:59 ` Roland Dreier
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2007-10-05  1:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Just as a quick update -- I seem to only be able to reproduce this
crash when my ppp session drops, which seems associated with marginal
signal.  And unfortunately I have great coverage at home so I haven't
been able to reproduce this again today.  Maybe on the train tomorrow
I can crash my laptop...

 - R.

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

end of thread, other threads:[~2007-10-05  1:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04 18:12 Vague maybe ppp-related panic report for 2.6.23-rc9 Roland Dreier
2007-10-04 20:51 ` David Miller
2007-10-04 20:53   ` Roland Dreier
2007-10-05  0:49   ` Herbert Xu
2007-10-05  1:59 ` Roland Dreier

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).