Files
linux/drivers
Cong Wang 3e2ab0ceef tun: call dev_get_valid_name() before register_netdevice()
[ Upstream commit 0ad646c81b ]

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: 96442e4242 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-18 11:22:21 +01:00
..
2016-12-05 14:53:46 -05:00
2017-10-18 09:35:38 +02:00
2017-10-12 11:51:24 +02:00
2017-11-08 10:08:34 +01:00
2017-09-09 17:39:41 +02:00
2017-10-21 17:21:35 +02:00
2016-09-20 20:57:12 +10:00
2017-04-21 09:31:24 +02:00