WSL2-Linux-Kernel/drivers/net/hamradio
Zhengchao Shao 7b6bc50f65 hamradio: fix issue of dev reference count leakage in bpq_device_event()
[ Upstream commit 85cbaf032d ]

When following tests are performed, it will cause dev reference counting
leakage.
a)ip link add bond2 type bond mode balance-rr
b)ip link set bond2 up
c)ifenslave -f bond2 rose1
d)ip link del bond2

When new bond device is created, the default type of the bond device is
ether. And the bond device is up, bpq_device_event() receives the message
and creates a new bpq device. In this case, the reference count value of
dev is hold once. But after "ifenslave -f bond2 rose1" command is
executed, the type of the bond device is changed to rose. When the bond
device is unregistered, bpq_device_event() will not put the dev reference
count.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-16 09:58:18 +01:00
..
6pack.c hamradio: remove needs_free_netdev to avoid UAF 2022-04-20 09:34:04 +02:00
Kconfig dmascc: add CONFIG_VIRT_TO_BUS dependency 2021-09-28 13:12:07 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
baycom_epp.c hamradio: baycom_epp: fix build for UML 2021-10-18 12:57:42 +01:00
baycom_par.c hamradio: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
baycom_ser_fdx.c hamradio: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
baycom_ser_hdx.c hamradio: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
bpqether.c hamradio: fix issue of dev reference count leakage in bpq_device_event() 2022-11-16 09:58:18 +01:00
dmascc.c dmascc: use proper 'virt_to_bus()' rather than casting to 'int' 2021-09-19 10:49:42 -07:00
hdlcdrv.c hamradio: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
mkiss.c hamradio: fix macro redefine warning 2022-03-08 19:12:55 +01:00
scc.c hamradio: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
yam.c yam: fix a memory leak in yam_siocdevprivate() 2022-02-01 17:27:13 +01:00
z8530.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00