linux-stable/drivers/net
Cong Wang 4df0bfc799 tun: fix a memory leak for tfile->tx_array
tfile->tun could be detached before we close the tun fd,
via tun_detach_all(), so it should not be used to check for
tfile->tx_array.

As Jason suggested, we probably have to clean it up
unconditionally both in __tun_deatch() and tun_detach_all(),
but this requires to check if it is initialized or not.
Currently skb_array_cleanup() doesn't have such a check,
so I check it in the caller and introduce a helper function,
it is a bit ugly but we can always improve it in net-next.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: 1576d98605 ("tun: switch to use skb array for tx")
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-17 15:08:28 -05:00
..
appletalk
arcnet
bonding bonding: use nla_get_u64 to extract the value for IFLA_BOND_AD_ACTOR_SYSTEM 2017-11-28 15:56:40 -05:00
caif treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
can can: ems_usb: improve error reporting for error warning and error passive 2018-01-04 16:14:38 +01:00
cris drivers/net: cris: Convert timers to use timer_setup() 2017-11-21 15:46:44 -08:00
dsa net: dsa: b53: Turn off Broadcom tags for more switches 2018-01-04 09:57:12 -05:00
ethernet qed: Fix potential use-after-free in qed_spq_post() 2018-01-16 14:57:34 -05:00
fddi
fjes
hamradio treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts 2017-11-21 16:35:54 -08:00
hippi hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close 2017-12-13 14:52:57 -05:00
hyperv hv_netvsc: preserve hw_features on mtu/channels/ringparam changes 2017-11-16 10:49:00 +09:00
ieee802154
ipvlan ipvlan: Add the skb->mark as flow4's member to lookup route 2017-12-03 09:44:02 -05:00
phy mdio-sun4i: Fix a memory leak 2018-01-08 14:30:28 -05:00
plip
ppp ppp: unlock all_ppp_mutex before registering device 2018-01-15 13:22:03 -05:00
slip treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
team
usb lan78xx: Fix failure in USB Full Speed 2018-01-16 14:50:15 -05:00
vmxnet3
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-29 13:10:25 -08:00
wimax
wireless mac80211_hwsim: validate number of different channels 2018-01-15 09:34:45 +01:00
xen-netback xen-netback: Fix logging message with spurious period after newline 2017-12-06 15:10:32 -05:00
dummy.c
eql.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
geneve.c geneve: update skb dst pmtu on tx path 2018-01-02 12:34:59 -05:00
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c genetlink: fix genlmsg_nlhdr() 2017-11-16 10:49:00 +09:00
macvlan.c macvlan: Fix one possible double free 2018-01-02 13:30:14 -05:00
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tap: free skb if flags error 2017-12-02 21:31:03 -05:00
thunderbolt.c net: thunderbolt: Stop using zero to mean no valid DMA mapping 2017-11-25 23:56:02 +09:00
tun.c tun: fix a memory leak for tfile->tx_array 2018-01-17 15:08:28 -05:00
veth.c
virtio_net.c virtio: bugfixes 2017-12-08 12:58:51 -08:00
vrf.c
vsockmon.c
vxlan.c vxlan: update skb dst pmtu on tx path 2017-12-19 13:37:27 -05:00
xen-netfront.c xen-netfront: enable device after manual module load 2018-01-08 14:17:03 -05:00