From: Till Immanuel Patzschke <tip@internetwork-ag.de>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
paulus@samba.org
Cc: linux-ppp@vger.kernel.org
Subject: [PATCH] ppp_generic causes skput:under: w/ pppoatm and vc-encaps
Date: Tue, 13 Nov 2001 22:30:24 +0100 [thread overview]
Message-ID: <3BF190F0.3FB26BD0@internetwork-ag.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 836 bytes --]
Hi,
using pppoatm from Mitchell Blank jr resulted in a BUG "skput:under: ..." when
used w/ vc-encapsulation. The problem is (at least w/ the iphase driver) that
the skb's headroom is 0 (since the vc-encaps. is nothing but the PPP frame) and
ppp_receive_nonmp_frame unconditionally calls skb_push -> BUG(skput:under: ...")
in the CONFIG_PPP_FILTER section.
I've attached a patch, checking for headroom first, and - if necessary -
reallocating a larger buffer for the skb_push.
Please check and apply - or find a better fix!
Thanks,
Immanuel
--
Till Immanuel Patzschke mailto: tip@internetwork-ag.de
interNetwork AG Phone: +49-(0)611-1731-121
Bierstadter Str. 7 Fax: +49-(0)611-1731-31
D-65189 Wiesbaden Web: http://www.internetwork-ag.de
[-- Attachment #2: qq2 --]
[-- Type: text/plain, Size: 1092 bytes --]
diff -Naur linux-2.4.10/drivers/net/ppp_generic.c linux-2.4.10-new/drivers/net/ppp_generic.c
--- linux-2.4.10/drivers/net/ppp_generic.c Sun Sep 9 19:45:43 2001
+++ linux-2.4.10-new/drivers/net/ppp_generic.c Tue Nov 13 21:48:29 2001
@@ -1470,6 +1470,23 @@
/* check if the packet passes the pass and active filters */
/* the filter instructions are constructed assuming
a four-byte PPP header on each packet */
+ /* make sure we have room for the following skb_push... */
+ if (skb_headroom(skb) < PPP_HDRLEN) {
+ struct sk_buff *ns;
+
+ ns = alloc_skb(skb->len + PPP_HDRLEN*2,GFP_ATOMIC);
+ if (ns == 0) {
+ printk(KERN_DEBUG "PPP: inbound skb not resizeable.\n");
+ kfree_skb(skb);
+ return;
+ }
+ skb_reserve(ns, PPP_HDRLEN*2);
+ memcpy(skb_put(ns, skb->len), skb->data, skb->len);
+ kfree_skb(skb);
+ skb = ns;
+ if (ppp->debug & 1)
+ printk(KERN_DEBUG "PPP: inbound skb resized.\n");
+ }
*skb_push(skb, 2) = 0;
if (ppp->pass_filter.filter
&& sk_run_filter(skb, ppp->pass_filter.filter,
next reply other threads:[~2001-11-13 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-13 21:30 Till Immanuel Patzschke [this message]
2001-11-14 5:02 ` [PATCH] ppp_generic causes skput:under: w/ pppoatm and vc-encaps David S. Miller
2001-11-14 11:13 ` [PATCH] ppp_generic causes skput:under: w/ pppoatm andvc-encaps Till Immanuel Patzschke
2001-11-14 11:48 ` David S. Miller
2001-11-14 14:23 ` [PATCH] ppp_generic causes skput:under: w/ pppoatm and vc-encaps Michal Ostrowski
2001-11-14 14:28 ` David S. Miller
2001-11-14 14:41 ` Till Immanuel Patzschke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BF190F0.3FB26BD0@internetwork-ag.de \
--to=tip@internetwork-ag.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ppp@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.