linux-stable/drivers/net/hamradio
Lin Ma cfa98ffc42 hamradio: remove needs_free_netdev to avoid UAF
commit 81b1d548d0 upstream.

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>
Signed-off-by: Xu Jia <xujia39@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:23:09 +02:00
..
6pack.c hamradio: remove needs_free_netdev to avoid UAF 2022-04-20 09:23:09 +02:00
baycom_epp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
baycom_par.c
baycom_ser_fdx.c
baycom_ser_hdx.c
bpqether.c net: change addr_list_lock back to static key 2020-06-09 12:59:45 -07:00
dmascc.c
hdlcdrv.c
Kconfig docs: networking: move baycom to the hw driver section 2020-06-26 16:08:44 -07:00
Makefile
mkiss.c hamradio: fix macro redefine warning 2022-03-08 19:09:39 +01:00
scc.c drivers: net: hamradio: fix document location 2020-10-15 07:49:47 +02:00
yam.c yam: fix a memory leak in yam_siocdevprivate() 2022-02-01 17:25:47 +01:00
z8530.h