linux/drivers/net/hamradio
Lin Ma 81b1d548d0 hamradio: remove needs_free_netdev to avoid UAF
The former patch "defer 6pack kfree after unregister_netdev" reorders
the kfree of two buffer after the unregister_netdev to prevent the race
condition. It also adds free_netdev() function in sixpack_close(), which
is a direct copy from the similar code in mkiss_close().

However, in sixpack driver, the flag needs_free_netdev is set to true in
sp_setup(), hence the unregister_netdev() will free the netdev
automatically. Therefore, as the sp is netdev_priv, use-after-free
occurs.

This patch removes the needs_free_netdev = true and just let the
free_netdev to finish this deallocation task.

Fixes: 0b9111922b ("hamradio: defer 6pack kfree after unregister_netdev")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Link: https://lore.kernel.org/r/20211111141402.7551-1-linma@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-12 19:56:47 -08:00
..
6pack.c hamradio: remove needs_free_netdev to avoid UAF 2021-11-12 19:56:47 -08:00
baycom_epp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +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: use dev_addr_set() for setting device address 2021-10-13 09:41:37 -07:00
dmascc.c hamradio: use dev_addr_set() for setting device address 2021-10-13 09:41:37 -07:00
hdlcdrv.c hamradio: use dev_addr_set() for setting device address 2021-10-13 09:41:37 -07: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
mkiss.c hamradio: defer ax25 kfree after unregister_netdev 2021-11-09 11:48:39 +00:00
scc.c hamradio: use dev_addr_set() for setting device address 2021-10-13 09:41:37 -07:00
yam.c hamradio: use dev_addr_set() for setting device address 2021-10-13 09:41:37 -07: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