Cong Wang
4b27fe34a2
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:11:05 +01:00
..
2016-08-10 11:49:24 +02:00
2017-02-18 16:39:26 +01:00
2017-03-15 09:57:15 +08:00
2017-10-12 11:27:34 +02:00
2016-10-28 03:01:34 -04:00
2017-03-15 09:57:14 +08:00
2016-10-16 17:36:14 +02:00
2016-08-20 18:09:25 +02:00
2017-10-08 10:14:19 +02:00
2017-05-08 07:46:01 +02:00
2016-06-24 10:18:24 -07:00
2017-10-05 09:41:47 +02:00
2017-02-01 08:30:53 +01:00
2017-11-15 17:13:11 +01:00
2016-09-07 08:32:45 +02:00
2017-10-08 10:14:18 +02:00
2016-08-20 18:09:24 +02:00
2016-08-20 18:09:24 +02:00
2016-08-20 18:09:24 +02:00
2016-09-15 08:27:47 +02:00
2016-07-11 09:31:11 -07:00
2017-01-12 11:22:50 +01:00
2017-06-14 13:16:23 +02:00
2016-12-08 07:15:24 +01:00
2017-07-05 14:37:20 +02:00
2016-12-15 08:49:23 -08:00
2017-02-14 15:22:51 -08:00
2017-10-12 11:27:35 +02:00
2017-01-12 11:22:50 +01:00
2017-08-06 19:19:42 -07:00
2017-03-22 12:04:15 +01:00
2016-10-28 03:01:26 -04:00
2017-07-21 07:44:58 +02:00
2016-08-16 09:30:49 +02:00
2017-05-14 13:32:59 +02:00
2017-07-15 11:57:44 +02:00
2016-11-21 10:06:40 +01:00
2017-06-14 13:16:24 +02:00
2017-06-17 06:39:36 +02:00
2016-09-30 10:18:37 +02:00
2017-08-06 19:19:42 -07:00
2017-05-14 13:32:59 +02:00
2016-09-07 08:32:44 +02:00
2017-06-07 12:05:59 +02:00
2017-03-12 06:37:25 +01:00
2016-09-24 10:07:43 +02:00
2017-01-19 20:17:19 +01:00
2016-07-27 09:47:29 -07:00
2016-10-28 03:01:30 -04:00
2017-10-27 10:23:18 +02:00
2017-05-25 14:30:17 +02:00
2017-04-08 09:53:32 +02:00
2017-03-18 19:09:58 +08:00
2017-09-02 07:06:51 +02:00
2017-07-21 07:44:56 +02:00
2017-06-17 06:39:36 +02:00
2017-10-27 10:23:17 +02:00
2017-06-14 13:16:26 +02:00
2016-08-16 09:30:51 +02:00
2017-02-09 08:02:47 +01:00
2017-08-11 09:08:50 -07:00
2017-06-26 07:13:11 +02:00
2017-06-14 13:16:26 +02:00
2017-04-30 05:49:28 +02:00
2016-11-15 07:46:37 +01:00
2016-11-15 07:46:37 +01:00
2016-09-07 08:32:38 +02:00
2016-07-11 09:31:11 -07:00
2017-11-18 11:11:05 +01:00
2017-02-01 08:30:53 +01:00
2016-10-07 15:23:41 +02:00
2016-09-30 10:18:37 +02:00
2017-09-13 14:09:45 -07:00
2016-12-08 07:15:24 +01:00
2017-02-09 08:02:46 +01:00
2016-09-15 08:27:46 +02:00
2017-11-15 17:13:10 +01:00
2017-08-24 17:02:36 -07:00
2016-06-07 18:14:35 -07:00
2016-10-31 04:13:58 -06:00
2017-11-15 17:13:11 +01:00
2017-08-06 19:19:43 -07:00
2017-06-14 13:16:20 +02:00
2016-11-10 16:36:37 +01:00
2017-06-14 13:16:23 +02:00
2017-08-24 17:02:36 -07:00
2016-10-28 03:01:32 -04:00
2017-08-06 19:19:42 -07:00
2016-09-07 08:32:44 +02:00
2017-06-14 13:16:26 +02:00
2017-08-11 09:08:58 -07:00
2016-09-30 10:18:37 +02:00
2016-07-11 09:31:11 -07:00
2016-10-28 03:01:30 -04:00
2016-10-28 03:01:34 -04:00
2016-10-07 15:23:46 +02:00
2017-02-04 09:45:08 +01:00
2016-09-15 08:27:47 +02:00
2017-06-29 12:48:51 +02:00
2017-10-21 17:09:02 +02:00
2017-09-27 11:00:13 +02:00
2016-12-10 19:07:25 +01:00
2017-03-26 12:13:16 +02:00
2017-07-27 15:06:07 -07:00
2017-09-13 14:09:45 -07:00