linux-stable/net
Xiyu Yang f872de8185 batman-adv: Fix refcnt leak in batadv_show_throughput_override
batadv_show_throughput_override() invokes batadv_hardif_get_by_netdev(),
which gets a batadv_hard_iface object from net_dev with increased refcnt
and its reference is assigned to a local pointer 'hard_iface'.

When batadv_show_throughput_override() returns, "hard_iface" becomes
invalid, so the refcount should be decreased to keep refcount balanced.

The issue happens in the normal path of
batadv_show_throughput_override(), which forgets to decrease the refcnt
increased by batadv_hardif_get_by_netdev() before the function returns,
causing a refcnt leak.

Fix this issue by calling batadv_hardif_put() before the
batadv_show_throughput_override() returns in the normal path.

Fixes: 0b5ecc6811 ("batman-adv: add throughput override attribute to hard_ifaces")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2020-04-21 10:08:05 +02:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv batman-adv: Fix refcnt leak in batadv_show_throughput_override 2020-04-21 10:08:05 +02:00
bluetooth
bpf
bpfilter SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
bridge
caif
can
ceph
core neigh: support smaller retrans_time settting 2020-04-02 17:55:26 -07:00
dcb
dccp
decnet
dns_resolver
dsa net: dsa: dsa_bridge_mtu_normalization() can be static 2020-04-02 06:51:56 -07:00
ethernet
ethtool
hsr
ieee802154
ife
ipv4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-03-31 17:29:33 -07:00
ipv6 ipv6: rpl: fix loop iteration 2020-04-06 10:05:42 -07:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc
mac80211
mac802154
mpls
mptcp mptcp: add some missing pr_fmt defines 2020-04-03 16:06:32 -07:00
ncsi
netfilter x86: update AS_* macros to binutils >=2.23, supporting ADX and AVX2 2020-04-09 00:12:48 +09:00
netlabel
netlink
netrom
nfc
nsh
openvswitch net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry 2020-04-02 17:48:12 -07:00
packet
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched net_sched: fix a missing refcnt in tcindex_init() 2020-04-03 16:00:08 -07:00
sctp
smc
strparser
sunrpc NFS client updates for Linux 5.7 2020-04-07 13:51:39 -07:00
switchdev
tipc
tls
unix
vmw_vsock
wimax
wireless SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
x25
xdp
xfrm
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c