netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, jussi.kivilinna@mbnet.fi
Subject: Re: [PATCH] sch_teql: should not dereference skb after ndo_start_xmit
Date: Tue, 19 May 2009 03:34:03 +0200	[thread overview]
Message-ID: <4A120C8B.80108@cosmosbay.com> (raw)
In-Reply-To: <20090518.151256.217066131.davem@davemloft.net>

David Miller a écrit :
> From: Eric Dumazet <dada1@cosmosbay.com>
> 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 <dada1@cosmosbay.com>
> 
> 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...


  reply	other threads:[~2009-05-19  1:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 10:31 [PATCH] sch_teql: should not dereference skb after ndo_start_xmit Eric Dumazet
2009-05-18 22:12 ` David Miller
2009-05-19  1:34   ` Eric Dumazet [this message]
2009-05-19  2:34     ` David Miller
2009-05-19  5:43       ` [PATCH] sch_teql: Use net_device internal stats Eric Dumazet
2009-05-19 22:16         ` David Miller
2009-08-03  1:59     ` [PATCH] sch_teql: should not dereference skb after ndo_start_xmit David Miller

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=4A120C8B.80108@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=jussi.kivilinna@mbnet.fi \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).