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