linux_dsm_epyc7002/drivers/net
Taehee Yoo 2bce1ebed1 macsec: fix refcnt leak in module exit routine
When a macsec interface is created, it increases a refcnt to a lower
device(real device). when macsec interface is deleted, the refcnt is
decreased in macsec_free_netdev(), which is ->priv_destructor() of
macsec interface.

The problem scenario is this.
When nested macsec interfaces are exiting, the exit routine of the
macsec module makes refcnt leaks.

Test commands:
    ip link add dummy0 type dummy
    ip link add macsec0 link dummy0 type macsec
    ip link add macsec1 link macsec0 type macsec
    modprobe -rv macsec

[  208.629433] unregister_netdevice: waiting for macsec0 to become free. Usage count = 1

Steps of exit routine of macsec module are below.
1. Calls ->dellink() in __rtnl_link_unregister().
2. Checks refcnt and wait refcnt to be 0 if refcnt is not 0 in
netdev_run_todo().
3. Calls ->priv_destruvtor() in netdev_run_todo().

Step2 checks refcnt, but step3 decreases refcnt.
So, step2 waits forever.

This patch makes the macsec module do not hold a refcnt of the lower
device because it already holds a refcnt of the lower device with
netdev_upper_dev_link().

Fixes: c09440f7dc ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-24 14:53:48 -07:00
..
appletalk
arcnet drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
bonding bonding: use dynamic lockdep key instead of subclass 2019-10-24 14:53:48 -07:00
caif
can drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
dsa net: dsa: microchip: Add shared regmap mutex 2019-10-17 15:38:46 -04:00
ethernet net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
fddi
fjes
hamradio net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
hippi
hyperv net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
ieee802154 Merge tag 'ieee802154-for-davem-2019-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2019-09-30 17:14:45 -07:00
ipvlan net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
netdevsim netdevsim: Fix error handling in nsim_fib_init and nsim_fib_exit 2019-10-13 11:30:14 -07:00
phy net: phy: smsc: LAN8740: add PHY_RST_AFTER_CLK_EN flag 2019-10-23 21:44:44 -07:00
plip
ppp net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
slip
team team: fix nested locking lockdep warning 2019-10-24 14:53:48 -07:00
usb r8152: add device id for Lenovo ThinkPad USB-C Dock Gen 2 2019-10-21 12:06:41 -07:00
vmxnet3
wan net/wan: dscc4: remove broken dscc4 driver 2019-09-16 09:14:41 +02:00
wimax wimax/i2400m: remove unlikely() from WARN*() condition 2019-09-26 10:10:30 -07:00
wireless net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
xen-netback xen/netback: fix error path of xenvif_connect_data() 2019-10-19 11:43:29 -07:00
dummy.c
eql.c
geneve.c Convert usage of IN_MULTICAST to ipv4_is_multicast 2019-09-05 09:38:32 +02:00
gtp.c
ifb.c
Kconfig drivers: net: Fix Kconfig indentation 2019-09-26 08:56:17 +02:00
LICENSE.SRC
loopback.c
macsec.c macsec: fix refcnt leak in module exit routine 2019-10-24 14:53:48 -07:00
macvlan.c net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap: clean up an indentation issue 2019-09-27 20:58:35 +02:00
thunderbolt.c
tun.c tun: remove possible false sharing in tun_flow_update() 2019-10-09 21:29:33 -07:00
veth.c
virtio_net.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
vrf.c net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
vsockmon.c
vxlan.c
xen-netfront.c xen-netfront: do not use ~0U as error return value for xennet_fill_frags() 2019-10-01 21:49:51 -04:00