[PATCH] Convert pppoe to new style protocol

STALE8522d

4 messages, 3 authors, 2003-06-18 · open the first message on its own page

[PATCH] Convert pppoe to new style protocol

From: Andi Kleen <hidden>
Date: 2003-06-17 22:04:20

Convert pppoe to a new style protocol, otherwise it is unusable 
on SMP compiled kernels because of the printk in deliver*old_ones.
It works fine here, but only tested on a UP box.

I checked with paulus and he confirmed that ppp_input is safe
to be called with the new softirq semantics. The PPP path also 
appears to work with shared skbs (never modify skb data, 
not 100% audited however) but not with non linear skbs.

The pppoe code itself is safe because it never uses timers
or does anything complicated.

If someone knows a place in ppp_input that modifies the data 
area then please contain now so that a skb_copy can be added.
 
-Andi

diff -u linux-2.5.72-work/drivers/net/pppoe.c-o linux-2.5.72-work/drivers/net/pppoe.c
--- linux-2.5.72-work/drivers/net/pppoe.c-o	2003-06-14 23:42:51.000000000 +0200
+++ linux-2.5.72-work/drivers/net/pppoe.c	2003-06-17 23:15:11.000000000 +0200
@@ -348,6 +348,9 @@
 	struct pppox_opt *po = pppox_sk(sk);
 	struct pppox_opt *relay_po = NULL;
 
+	if (skb_is_nonlinear(skb) && skb_linearize(skb, GFP_ATOMIC))
+		goto abort_kfree;
+
 	if (sk->sk_state & PPPOX_BOUND) {
 		skb_pull(skb, sizeof(struct pppoe_hdr));
 		ppp_input(&po->chan, skb);
@@ -463,11 +466,13 @@
 struct packet_type pppoes_ptype = {
 	.type	= __constant_htons(ETH_P_PPP_SES),
 	.func	= pppoe_rcv,
+	.data =	(void*) 1,
 };
 
 struct packet_type pppoed_ptype = {
 	.type	= __constant_htons(ETH_P_PPP_DISC),
 	.func	= pppoe_disc_rcv,
+	.data =	(void*) 1,
 };
 
 /***********************************************************************

Re: [PATCH] Convert pppoe to new style protocol

From: David S. Miller <hidden>
Date: 2003-06-17 22:07:51

   From: Andi Kleen [off-list ref]
   Date: Wed, 18 Jun 2003 00:04:20 +0200

   Convert pppoe to a new style protocol, otherwise it is unusable 
   on SMP compiled kernels because of the printk in deliver*old_ones.
   It works fine here, but only tested on a UP box.

Please don't add new skb_linearize() users, I'm trying
to make that only local to net/core/dev.c

Otherwise I'm fine with your patch.

Re: [PATCH] Convert pppoe to new style protocol

From: Andi Kleen <hidden>
Date: 2003-06-18 08:01:18

On Tue, Jun 17, 2003 at 03:07:51PM -0700, David S. Miller wrote:
   From: Andi Kleen [off-list ref]
   Date: Wed, 18 Jun 2003 00:04:20 +0200

   Convert pppoe to a new style protocol, otherwise it is unusable 
   on SMP compiled kernels because of the printk in deliver*old_ones.
   It works fine here, but only tested on a UP box.

Please don't add new skb_linearize() users, I'm trying
to make that only local to net/core/dev.c
Then offer a flag or something for protocols that also doesn't trigger
printks ?

Otherwise I'm fine with your patch.
How else should it be done? 

I'm not going through the whole PPP layer now to audit it for non linear
skb cleanliness...

-Andi

Re: [PATCH] Convert pppoe to new style protocol

From: David S. Miller <hidden>
Date: 2003-06-18 17:15:35

   From: Andi Kleen [off-list ref]
   Date: Wed, 18 Jun 2003 10:01:18 +0200

   I'm not going through the whole PPP layer now to audit it for non
   linear skb cleanliness...
   
Then you're not making it a compatible protocol.
And the printk will remain until someone fixes it.

If I could get Rusty to fixup _ALL_ of netfilter, I can get
you to fix just _ONE_ thing.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help