From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [BUG] af_packet FANOUT and device dismantle
Date: Fri, 02 Sep 2016 17:37:30 -0700 (PDT) [thread overview]
Message-ID: <20160902.173730.771175006796901877.davem@davemloft.net> (raw)
In-Reply-To: <1472774683.5439.8.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 01 Sep 2016 17:04:43 -0700
> When you added fanout in commit dc99f600698dcac,
> it seems a device dismantle is not properly handled.
>
> packet_notifier() does properly finds all sockets attached to the
> device and we call __unregister_prot_hook()
>
> But the actual dev_remove_pack() is called when the last socket attached
> to the FANOUT group is _closed_ , possibly minutes after the device
> disappeared.
>
> So we trigger the BUG_ON(!list_empty(&dev->ptype_all)); in
> netdev_run_todo(), that came with linux-4.0 in
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7866a621043fbaca3d7389e9b9f69dd1a2e5a855
>
> Fix would be to call dev_remote_pack() from __fanout_unlink() when
> num_members becomes 0.
>
> Let me know if you agree with this, thanks.
I completely agree with your analysis, good catch.
prev parent reply other threads:[~2016-09-03 0:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 0:04 [BUG] af_packet FANOUT and device dismantle Eric Dumazet
2016-09-03 0:37 ` David Miller [this message]
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=20160902.173730.771175006796901877.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.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;
as well as URLs for NNTP newsgroup(s).