android_kernel_samsung_msm8976/drivers/net
Cong Wang 71ee59f2d8 tun: call dev_get_valid_name() before register_netdevice()
commit 0ad646c81b2182f7fa67ec0c8c825e0ee165696d upstream.

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")
Change-Id: Ibc9f82d0b26a34c56ccc0a076de37db534823a48
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>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:45:50 +02:00
..
appletalk
arcnet
bonding
caif
can This is the 3.10.99 stable release 2017-04-18 17:17:46 +02:00
cris
danipc
dsa
ethernet net: korina: Fix NAPI versus resources freeing 2019-07-27 21:44:35 +02:00
fddi
hamradio
hippi
hyperv
ieee802154
irda
phy net: phy: fix marvell phy status reading 2019-07-27 21:44:34 +02:00
plip
ppp ppp: Destroy the mutex when cleanup 2019-07-27 21:45:26 +02:00
slip
team team: fix memory leaks 2019-07-27 21:44:43 +02:00
usb cdc_ncm: workaround for EM7455 "silent" data interface 2019-07-27 21:41:55 +02:00
vmxnet3
wan
wimax
wireless mwifiex: printk() overflow with 32-byte SSIDs 2019-07-27 21:42:43 +02:00
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
ifb.c
loopback.c
macvlan.c
macvtap.c tun/tap: sanitize TUNSETSNDBUF input 2019-07-27 21:45:41 +02:00
mdio.c
mii.c
netconsole.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c tun: call dev_get_valid_name() before register_netdevice() 2019-07-27 21:45:50 +02:00
veth.c
virtio_net.c
vxlan.c vxlan: correctly validate VXLAN ID against VXLAN_N_VID 2019-07-27 21:43:11 +02:00
xen-netfront.c