Subject: Re: [PATCH] sch_teql: should not dereference skb after ndo_start_xmit

From: Eric Dumazet <[email-masked]>
Date: Tue, 19 May 2009 03:34:03 +0200

David Miller a écrit :
> From: Eric Dumazet <[email-masked]>
> Date: Mon, 18 May 2009 12:31:57 +0200
> 
>> [PATCH] sch_teql: should not dereference skb after ndo_start_xmit()
>>
>> It is illegal to dereference a skb after a successful ndo_start_xmit()
>> call. We must store skb length in a local variable instead.
>>
>> Bug was introduced in 2.6.27 by commit 0abf77e55a2459aa9905be4b226e4729d5b4f0cb
>> (net_sched: Add accessor function for packet length for qdiscs)
>>
>> Signed-off-by: Eric Dumazet <[email-masked]>
> 
> Applied and queued up for -stable, thanks!

Looking again at teql_master_xmit(), I wonder if there is another
problem in it.

    int subq = skb_get_queue_mapping(skb);

But as a matter of fact, following code assumes subq is 0

struct netdev_queue *slave_txq = netdev_get_tx_queue(slave, 0);
...
if (__netif_subqueue_stopped(slave, subq) ||
...

Either we should set subq to 0, or call dev_pick_tx() to better
take into account multi queue slaves ?

(As teqlN has one queue, I assume original dev_queue_xmit() will
set skb queue_mapping to 0 before entering teql_master_xmit(), but
maybe other paths could call teql_master_xmit() not through dev_queue_xmit() ?

Oh well, time for sleeping a bit...