From: Michal Ostrowski <mostrows@earthlink.net>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
ppp-bugs@dp.samba.org
Subject: Re: [PATCH] Advertise PPPoE MTU / avoid memory leak.
Date: Sun, 24 Sep 2006 07:29:25 -0500 [thread overview]
Message-ID: <1159100966.23197.293.camel@brick.austin.ibm.com> (raw)
In-Reply-To: <20060923.145600.51855973.davem@davemloft.net>
On Sat, 2006-09-23 at 14:56 -0700, David Miller wrote:
> From: mostrows@earthlink.net
> Date: Sat, 23 Sep 2006 12:30:23 -0500
>
> > __pppoe_xmit must free any skb it allocates if there is an error
> > submitting the skb downstream.
>
> This isn't right, dev_queue_xmit() can return -ENETDOWN and still
> free the SKB, so your change will cause the SKB to be freed up
> twice in that case, from dev_queue_xmit():
>
> rc = -ENETDOWN;
> rcu_read_unlock_bh();
>
> out_kfree_skb:
> kfree_skb(skb);
> return rc;
>
> dev_queue_xmit() is basically expected to consume the packet,
> error or not.
>
> What case of calling dev_queue_xmit() did you discover that did not
> kfree the SKB on error? We should fix that. On a quick scan on the
> entire dev_queue_xmit() implmentation, I cannot find such a case.
>
I think the call path via dev->hard_start_xmit, if it fails, may result
in an skb not being freed. This appears to be the case with the e100.c
driver. The qdisc_restart path to dev->hard_start_xmit also appears
susceptible to this. It appears that not all devices agree as to who
should clean-up an skb on error.
--
Michal Ostrowski <mostrows@earthlink.net>
next prev parent reply other threads:[~2006-09-24 12:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 17:30 mostrows
2006-09-23 21:56 ` David Miller
2006-09-24 12:29 ` Michal Ostrowski [this message]
2006-09-25 1:41 ` David Miller
2006-09-25 18:16 ` Michal Ostrowski
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=1159100966.23197.293.camel@brick.austin.ibm.com \
--to=mostrows@earthlink.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ppp-bugs@dp.samba.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
all inboxes | Powered by JetHome®