Commit ec2e93cf authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Kalle Valo

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: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent aeffda6b
...@@ -2590,18 +2590,13 @@ static void b43_request_firmware(struct work_struct *work) ...@@ -2590,18 +2590,13 @@ static void b43_request_firmware(struct work_struct *work)
err = ieee80211_register_hw(wl->hw); err = ieee80211_register_hw(wl->hw);
if (err) if (err)
goto err_one_core_detach; goto out;
wl->hw_registered = true; wl->hw_registered = true;
b43_leds_register(wl->current_dev); b43_leds_register(wl->current_dev);
/* Register HW RNG driver */ /* Register HW RNG driver */
b43_rng_init(wl); b43_rng_init(wl);
goto out;
err_one_core_detach:
b43_one_core_detach(dev->dev);
out: out:
kfree(ctx); kfree(ctx);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment