Re: [PATCH] ip multicast route bug fix

2006-07-26 Thread Alexey Kuznetsov
HellO! > I like this. However, since the cloned skb is either discarded in case > of error, or queued in which case the caller discards its reference right > away, wouldn't it be simpler to just do this? Well, if we wanted just to cheat those checking tools, it is nice. But if we want clarity, i

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Herbert Xu
Alexey Kuznetsov <[EMAIL PROTECTED]> wrote: > > I think you mean this. > > Note, it is real skb_clone(), not alloc_skb(). Equeued skb contains > the whole half-prepared netlink message plus room for the rest. > It could be also skb_copy(), if we want to be puristic about mangling > cloned data, b

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread David Miller
From: Alexey Kuznetsov <[EMAIL PROTECTED]> Date: Wed, 26 Jul 2006 01:17:25 +0400 > Hello! > > > Wouldn't it be better to have a consistent interface (skb always freed), > > and clone the skb if needed for deferred processing? > > I think you mean this. > > Note, it is real skb_clone(), not allo

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Stephen Hemminger
On Wed, 26 Jul 2006 01:17:25 +0400 Alexey Kuznetsov <[EMAIL PROTECTED]> wrote: > Hello! > > > Wouldn't it be better to have a consistent interface (skb always freed), > > and clone the skb if needed for deferred processing? > > I think you mean this. > > Note, it is real skb_clone(), not alloc_

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Alexey Kuznetsov
Hello! > Wouldn't it be better to have a consistent interface (skb always freed), > and clone the skb if needed for deferred processing? I think you mean this. Note, it is real skb_clone(), not alloc_skb(). Equeued skb contains the whole half-prepared netlink message plus room for the rest. It c

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Alexey Kuznetsov
Hello! > Wouldn't it be better to have a consistent interface (skb always freed), > and clone the skb if needed for deferred processing? I am sorry, I misunderstood you. I absolutely agree. It is much better, the variant which I suggested is a good sample of bad programming. :-) Alexey - To uns

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Alexey Kuznetsov
Hello! > checking tools because the skb lifetime depends on the return value. > Wouldn't it be better to have a consistent interface (skb always freed), > and clone the skb if needed for deferred processing? But skb is not always freed in any case. Normally it is submitted to netlink_unicast(). I

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Stephen Hemminger
On Tue, 25 Jul 2006 20:20:01 +0400 Alexey Kuznetsov <[EMAIL PROTECTED]> wrote: > Hello! > > > Code was reusing an skb which could lead to use after free or double free. > > No, this does not help. The bug is not here. > > I was so ashamed of this that could not touch the thing. :-) > It startle

[PATCH] ip multicast route bug fix (rev2)

2006-07-25 Thread Stephen Hemminger
IP multicast route code was reusing an skb which causes use after free and double free. Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4/ipmr.c | 22 -- 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index b

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Alexey Kuznetsov
Hello! > Code was reusing an skb which could lead to use after free or double free. No, this does not help. The bug is not here. I was so ashamed of this that could not touch the thing. :-) It startled me a lot, how is it possible that the thing was in production for several years and such bad b

Re: [PATCH] ip multicast route bug fix

2006-07-25 Thread Herbert Xu
Stephen Hemminger <[EMAIL PROTECTED]> wrote: > > @@ -1593,12 +1594,19 @@ int ipmr_get_route(struct sk_buff *skb, >read_unlock(&mrt_lock); >return -ENODEV; >} > - skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); > -

Re: [PATCH] ip multicast route bug fix

2006-07-24 Thread Martin Josefsson
On Wed, 2006-07-19 at 14:57 -0700, Stephen Hemminger wrote: > This should fix the problem reported in > http://bugzilla.kernel.org/show_bug.cgi?id=6186 > where the skb is used after freed. The code in IP multicast route. > > Code was reusing an skb which could lead to use after free or double fre

Re: [PATCH] ip multicast route bug fix

2006-07-24 Thread James Morris
On Wed, 19 Jul 2006, Stephen Hemminger wrote: > This should fix the problem reported in > http://bugzilla.kernel.org/show_bug.cgi?id=6186 > where the skb is used after freed. The code in IP multicast route. > > Code was reusing an skb which could lead to use after free or double free. > > Signe

[PATCH] ip multicast route bug fix

2006-07-24 Thread Stephen Hemminger
This should fix the problem reported in http://bugzilla.kernel.org/show_bug.cgi?id=6186 where the skb is used after freed. The code in IP multicast route. Code was reusing an skb which could lead to use after free or double free. Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]> --- net/ipv4