linux-stable/drivers/net/ieee802154
Dinghao Liu 84c6aa0ae5 ieee802154: ca8210: Fix a potential UAF in ca8210_probe
[ Upstream commit f990874b1c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-19 23:05:34 +02:00
..
Kconfig
Makefile
adf7242.c ieee802154/adf7242: defer destroy_workqueue call 2022-09-08 12:28:02 +02:00
at86rf230.c net: ieee802154: at86rf230: Stop leaking skb's 2022-02-23 12:03:04 +01:00
at86rf230.h
atusb.c
atusb.h
ca8210.c ieee802154: ca8210: Fix a potential UAF in ca8210_probe 2023-10-19 23:05:34 +02:00
cc2520.c ieee802154: cc2520: Fix error return code in cc2520_hw_init() 2022-12-14 11:37:23 +01:00
fakelb.c
mac802154_hwsim.c ieee802154: hwsim: Fix possible memory leaks 2023-06-28 10:29:45 +02:00
mac802154_hwsim.h
mcr20a.c net: ieee802154: mcr20a: Fix lifs/sifs periods 2022-02-08 18:34:08 +01:00
mcr20a.h
mrf24j40.c