From: Jia-Ju Bai Date: Sat, 4 May 2019 09:10:00 +0000 (+0800) Subject: b43: Avoid possible double calls to b43_one_core_detach() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=ec2e93cf1910d4517bb68cd67f2925665c5ef005;p=openwrt%2Fstaging%2Fblogic.git b43: Avoid possible double calls to b43_one_core_detach() In b43_request_firmware(), when ieee80211_register_hw() fails, b43_one_core_detach() is called. In b43_bcma_remove() and b43_ssb_remove(), b43_one_core_detach() is called again. In this case, null-pointer dereferences and double-free problems can occur when the driver is removed. To fix this bug, the call to b43_one_core_detach() in b43_request_firmware() is deleted. This bug is found by a runtime fuzzing tool named FIZZER written by us. Signed-off-by: Jia-Ju Bai Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index 20815a71680b..b85603e91c7a 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -2590,18 +2590,13 @@ start_ieee80211: err = ieee80211_register_hw(wl->hw); if (err) - goto err_one_core_detach; + goto out; wl->hw_registered = true; b43_leds_register(wl->current_dev); /* Register HW RNG driver */ b43_rng_init(wl); - goto out; - -err_one_core_detach: - b43_one_core_detach(dev->dev); - out: kfree(ctx); }