Skip to content

Commit

Permalink
b43: Avoid possible double calls to b43_one_core_detach()
Browse files Browse the repository at this point in the history
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 <baijiaju1990@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
XidianGeneral authored and Kalle Valo committed May 28, 2019
1 parent aeffda6 commit ec2e93c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/net/wireless/broadcom/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2590,18 +2590,13 @@ static void b43_request_firmware(struct work_struct *work)

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);
}
Expand Down

0 comments on commit ec2e93c

Please sign in to comment.