From: Joel Cunningham <joel.cunningham@me.com>
To: netdev@vger.kernel.org
Subject: sk_buff and reference counting netdev pointers
Date: Mon, 23 Jan 2017 16:37:06 -0600 [thread overview]
Message-ID: <E593AEBC-5FD1-4CEF-A119-2C032DB574FC@me.com> (raw)
Hi,
I’m working on a research effort to understand the synchronization mechanisms for accessing and modifying a struct net_device object. One area that isn’t clear is the net device pointer (dev) stored in a struct sk_buff. From my investigation, the pointer appears to be assigned without increasing the struct net_device’s reference count (example __netdev_alloc_skb doesn’t call dev_hold) and also when the sk_buff is freed (kfree_skb) no call to dev_put() is made. This seems to leave a possibility of an skb referencing a stale net device unless something is cleaning up all the skbs during unregister_netdevice() (which waits for all outstanding references to be released). Any insight in understanding how this is working would be appreciated!
Joel
next reply other threads:[~2017-01-23 23:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-23 22:37 Joel Cunningham [this message]
2017-01-23 23:45 ` sk_buff and reference counting netdev pointers Cong Wang
2017-01-25 21:31 ` Joel Cunningham
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=E593AEBC-5FD1-4CEF-A119-2C032DB574FC@me.com \
--to=joel.cunningham@me.com \
--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