[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20171016.210447.1449711502806536612.davem@davemloft.net>
Date: Mon, 16 Oct 2017 21:04:47 +0100 (WEST)
From: David Miller <davem@...emloft.net>
To: xiyou.wangcong@...il.com
Cc: netdev@...r.kernel.org, avekceeb@...il.com, jasowang@...hat.com,
mst@...hat.com
Subject: Re: [Patch net] tun: call dev_get_valid_name() before
register_netdevice()
From: Cong Wang <xiyou.wangcong@...il.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@...il.com>
> Cc: Jason Wang <jasowang@...hat.com>
> Cc: "Michael S. Tsirkin" <mst@...hat.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Applied and queued up for -stable.
Powered by blists - more mailing lists