Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v3] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out
Date: Thu, 23 Sep 2010 16:41:52 +0200	[thread overview]
Message-ID: <1285252912.2509.29.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTik4d76GBa9Jwn9BOnC07_0CnMsy-XoKM_MhF_sc@mail.gmail.com>

Le jeudi 23 septembre 2010 à 22:17 +0800, Changli Gao a écrit :
> On Thu, Sep 23, 2010 at 8:29 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Le jeudi 23 septembre 2010 à 18:15 +0800, Changli Gao a écrit :
> >> Since skb->destructor() is used to account socket memory, and maybe called
> >> before the skb is sent out, a corrupt skb maybe sent out finally.
> >>
> >> A new destructor is added into structure skb_shared_info(), and it won't
> >> be called until the last reference to the data of an skb is put. af_packet
> >> uses this destructor instead.
> >>
> >> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> >> ---
> >> v3: rename destructor to data_destructor, destructor_arg to data_destructor_arg,
> >>     fix splice the skbs generated by AF_PACKET socket to the pipe.
> >
> > I dont understand this.
> >
> > Could you describe how splice(from af_packet to pipe) is possible with
> > af_packet send path ?
> 
> af_packet sends packets to lo(127.0.0.1), and a local socket is
> receiving packets via splice.

Ouch

I am pretty sure too many things will break if we allow such packets to
get back in input path.

(think of tcp coalescing for example...)




  reply	other threads:[~2010-09-23 14:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 10:15 [PATCH v3] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out Changli Gao
2010-09-23 12:29 ` Eric Dumazet
2010-09-23 14:17   ` Changli Gao
2010-09-23 14:41     ` Eric Dumazet [this message]
2010-09-24  6:36 ` Jarek Poplawski
2010-09-24  7:01   ` Eric Dumazet
2010-09-27  1:25     ` David Miller
2010-09-27  5:40       ` Eric Dumazet
2010-09-27  1:22   ` David Miller
2010-09-27  5:30     ` Jarek Poplawski
2010-09-27  6:56       ` David Miller
2010-09-27  1:24   ` Changli Gao
2010-09-27  5:46     ` Jarek Poplawski

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=1285252912.2509.29.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=xiaosuo@gmail.com \
    /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