From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, jukka.rissanen@linux.intel.com
Subject: Re: [PATCH bluetooth-next] ieee802154: 6lowpan: fix memory leak
Date: Thu, 22 Oct 2015 12:14:34 +0200 [thread overview]
Message-ID: <20151022101433.GA8828@omega> (raw)
In-Reply-To: <1445508687-404-1-git-send-email-alex.aring@gmail.com>
On Thu, Oct 22, 2015 at 12:11:27PM +0200, Alexander Aring wrote:
> Looking at current situation of memory management in 6lowpan receive
> function I detected some invalid handling. After calling
> lowpan_invoke_rx_handlers we will do a kfree_skb and then NET_RX_DROP on
> error handling. We don't do this before, also on
> skb_share_check/skb_unshare which might manipulate the reference
> counters.
>
> After running some 'grep -r "dev_add_pack" net/' to look how others
> packet-layer receive callbacks works I detected that every subsystem do
> a kfree_skb, then NET_RX_DROP without calling skb functions which
> might manipulate the skb reference counters. This is the reason why we
> should do the same here like all others subsystems. I didn't find any
> documentation how the packet-layer receive callbacks handle NET_RX_DROP
> return values either.
>
> This patch will add a kfree_skb, then NET_RX_DROP handling for the
> "trivial checks", in case of skb_share_check/skb_unshare the kfree_skb
> call will be done inside these functions.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> References how other filesystem handle the callback:
s/filesystem/subsystems/
- Alex
next prev parent reply other threads:[~2015-10-22 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 10:11 [PATCH bluetooth-next] ieee802154: 6lowpan: fix memory leak Alexander Aring
2015-10-22 10:14 ` Alexander Aring [this message]
2015-10-22 10:25 ` Marcel Holtmann
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=20151022101433.GA8828@omega \
--to=alex.aring@gmail.com \
--cc=jukka.rissanen@linux.intel.com \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@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