netdev
[Top] [All Lists]

Re: [PATCH] PPPOE can kfree SKB twice (was Re: kernel panic problem. (sm

To: mostrows@xxxxxxxxxxxxx
Subject: Re: [PATCH] PPPOE can kfree SKB twice (was Re: kernel panic problem. (smp, iptables?))
From: kuznet@xxxxxxxxxxxxx
Date: Thu, 19 Jul 2001 21:27:05 +0400 (MSK DST)
Cc: davem@xxxxxxxxxx, saai@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, prefect_@xxxxxxx, moritz@xxxxxxxxxxxx, egger@xxxxxxx, srwalter@xxxxxxxxx, rusty@xxxxxxxxxxxxxxx
In-reply-to: <sb6r8vdgkya.fsf@xxxxxxxxxxxxxxxxxxx> from "Michal Ostrowski" at Jul 19, 1 08:30:37 am
Sender: owner-netdev@xxxxxxxxxxx
Hello!

SOme short comment on the patch:


> -     dev_queue_xmit(skb);
> +     /* The skb we are to transmit may be a copy (see above).  If
> +      * this fails, then the caller is responsible for the original
> +      * skb, otherwise we must free it.  Also if this fails we must
> +      * free the copy that we made.
> +      */
> +
> +     if (dev_queue_xmit(skb)<0) {

dev_queue_xmit _frees_ frame, not depending on return value.
Return value is not a criterium to assume anything.



> +             if (old_skb) {
> +                     /* The skb we tried to send was a copy.  We
> +                      * have to free it (the copy) and let the
> +                      * caller deal with the original one.
> +                      */
> +                     skb_unlink(skb);

So, do you pass to dev_queue_xmit some skb, which is on some list?
Not a good idea. Please, clone it and submit clone, if you need to hold
original in some list.

Alexey

<Prev in Thread] Current Thread [Next in Thread>