From: Erik Hovland <erik@hovland.org>
To: netdev@vger.kernel.org
Cc: trivial@kernel.org
Subject: Re: [PATCH] Make dev_kfree_skb_any check if the skb is valid
Date: Wed, 18 Apr 2007 16:18:15 -0700 [thread overview]
Message-ID: <20070418231808.GF13146@hovland.org> (raw)
In-Reply-To: <20070418.154416.131918019.davem@davemloft.net>
On Wed, Apr 18, 2007 at 03:44:16PM -0700, David Miller wrote:
> From: Erik Hovland <erik@hovland.org>
> Date: Wed, 18 Apr 2007 15:33:44 -0700
>
> > If dev_kfree_skb_any is called and it then calls dev_kfree_skb_irq.
> > That call will dereference the skb. If the skb is invalid, down the
> > drain we go.
> >
> > This one-liner checks to see if the skb is valid as part of the
> > determination of whether to call dev_kfree_skb_irq.
> >
> > Signed-off-by: Erik Hovland <erik@hovland.org>
>
> This should never be invoked with a NULL skb argument.
>
> Who is doing that?
Heh, the reason I came up with this patch is that the code in
drivers/usb/gadget/ether.c at about line 1653 will attempt to allocate
an skb. If it fails then it uses a goto to jump to line 1672 where it
will call dev_kfree_skb_any (skb) on a potentially null skb. I put a
validity check there and sent it off to the USB gadget maintainer. He
asked me to instead make the dev_kfree_skb_any call more robust and see
how that went over on the netdev list. Like a lead balloon?
E
--
Erik Hovland
mail: erik@hovland.org
web: http://hovland.org/
PGP/GPG public key available on request
next prev parent reply other threads:[~2007-04-18 23:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 22:33 [PATCH] Make dev_kfree_skb_any check if the skb is valid Erik Hovland
2007-04-18 22:44 ` David Miller
2007-04-18 23:18 ` Erik Hovland [this message]
2007-04-18 23:27 ` 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=20070418231808.GF13146@hovland.org \
--to=erik@hovland.org \
--cc=netdev@vger.kernel.org \
--cc=trivial@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).