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