From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org, avekceeb@gmail.com, jasowang@redhat.com,
mst@redhat.com
Subject: Re: [Patch net] tun: call dev_get_valid_name() before register_netdevice()
Date: Mon, 16 Oct 2017 21:04:47 +0100 (WEST) [thread overview]
Message-ID: <20171016.210447.1449711502806536612.davem@davemloft.net> (raw)
In-Reply-To: <20171013185853.21353-1-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Fri, 13 Oct 2017 11:58:53 -0700
> register_netdevice() could fail early when we have an invalid
> dev name, in which case ->ndo_uninit() is not called. For tun
> device, this is a problem because a timer etc. are already
> initialized and it expects ->ndo_uninit() to clean them up.
>
> We could move these initializations into a ->ndo_init() so
> that register_netdevice() knows better, however this is still
> complicated due to the logic in tun_detach().
>
> Therefore, I choose to just call dev_get_valid_name() before
> register_netdevice(), which is quicker and much easier to audit.
> And for this specific case, it is already enough.
>
> Fixes: 96442e42429e ("tuntap: choose the txq based on rxq")
> Reported-by: Dmitry Alexeev <avekceeb@gmail.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied and queued up for -stable.
prev parent reply other threads:[~2017-10-16 20:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 18:58 [Patch net] tun: call dev_get_valid_name() before register_netdevice() Cong Wang
2017-10-16 20:04 ` 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=20171016.210447.1449711502806536612.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=avekceeb@gmail.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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).