linux/drivers/net/ieee802154
Dongliang Mu 28a5501c33 ieee802154: hwsim: Fix memory leak in hwsim_add_one
No matter from hwsim_remove or hwsim_del_radio_nl, hwsim_del fails to
remove the entry in the edges list. Take the example below, phy0, phy1
and e0 will be deleted, resulting in e1 not freed and accessed in the
future.

              hwsim_phys
                  |
    ------------------------------
    |                            |
phy0 (edges)                 phy1 (edges)
   ----> e1 (idx = 1)             ----> e0 (idx = 0)

Fix this by deleting and freeing all the entries in the edges list
between hwsim_edge_unsubscribe_me and list_del(&phy->list).

Reported-by: syzbot+b80c9959009a9325cdff@syzkaller.appspotmail.com
Fixes: 1c9f4a3fce ("ieee802154: hwsim: fix rcu handling")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20210616020901.2759466-1-mudongliangabcd@gmail.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
2021-06-22 21:09:53 +02:00
..
adf7242.c
at86rf230.c
at86rf230.h
atusb.c drivers: net: fix memory leak in atusb_probe 2021-04-01 15:46:45 -07:00
atusb.h
ca8210.c net: ieee802154: ca8210: Fix incorrectly named function param doc 2020-11-03 16:37:09 -08:00
cc2520.c
fakelb.c
Kconfig
mac802154_hwsim.c ieee802154: hwsim: Fix memory leak in hwsim_add_one 2021-06-22 21:09:53 +02:00
mac802154_hwsim.h
Makefile
mcr20a.c
mcr20a.h
mrf24j40.c net: ieee802154: mrf24j40: Drop unneeded of_match_ptr() 2021-06-03 10:32:04 +02:00