1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ieee802154
Dinghao Liu f990874b1c ieee802154: ca8210: Fix a potential UAF in ca8210_probe
If of_clk_add_provider() fails in ca8210_register_ext_clock(),
it calls clk_unregister() to release priv->clk and returns an
error. However, the caller ca8210_probe() then calls ca8210_remove(),
where priv->clk is freed again in ca8210_unregister_ext_clock(). In
this case, a use-after-free may happen in the second time we call
clk_unregister().

Fix this by removing the first clk_unregister(). Also, priv->clk could
be an error code on failure of clk_register_fixed_rate(). Use
IS_ERR_OR_NULL to catch this case in ca8210_unregister_ext_clock().

Fixes: ded845a781 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Message-ID: <20231007033049.22353-1-dinghao.liu@zju.edu.cn>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
2023-10-07 20:37:38 +02:00
..
adf7242.c ieee802154/adf7242: Add MODULE_FIRMWARE macro 2023-06-18 11:17:53 +01:00
at86rf230.c net: ieee802154: at86rf230: drop of_match_ptr for ID table 2023-03-15 08:11:02 +00:00
at86rf230.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
atusb.c ieee802154: atusb: add support for trac feature 2022-10-12 19:43:20 +02:00
atusb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
ca8210.c ieee802154: ca8210: Fix a potential UAF in ca8210_probe 2023-10-07 20:37:38 +02:00
cc2520.c Merge tag 'ieee802154-for-net-next-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next 2023-02-20 16:40:52 -08:00
fakelb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
Kconfig net: ieee802154: at86rf230: Forward Tx trac errors 2022-04-25 20:52:22 +02:00
mac802154_hwsim.c ieee802154: hwsim: Fix possible memory leaks 2023-04-12 21:31:32 +02:00
mac802154_hwsim.h ieee802154: hwsim: add replacement for fakelb 2018-08-06 11:21:15 +02:00
Makefile ieee802154: hwsim: add replacement for fakelb 2018-08-06 11:21:15 +02:00
mcr20a.c net: ieee802154: mcr20a: drop of_match_ptr for ID table 2023-03-15 08:11:02 +00:00
mcr20a.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
mrf24j40.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00