net: wireless: iwlwifi: Fix double-free problems in iwl_req_fw_callback()
Subsystems (3)
PATCH 1/1 net: wireless: iwlwifi: Fix double-free problems in iwl_req_fw_callback()
In the error handling code of iwl_req_fw_callback(), iwl_dealloc_ucode() is called to free data. In iwl_drv_stop(), iwl_dealloc_ucode() is called again, which can cause double-free problems.
To fix this bug, the call to iwl_dealloc_ucode() in iwl_req_fw_callback() is deleted.
This bug is found by a runtime fuzzing tool named FIZZER written by us.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +0 -1
@@ -1579,7 +1579,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) goto free; out_free_fw: -iwl_dealloc_ucode (drv);release_firmware (ucode_raw); out_unbind:complete (&drv->request_firmware_complete);
Signature · 1 line
2.17.0
Luca Coelho
AppliedQuoted 30 lines · Jia-Ju Bai
In the error handling code of
iwl_req_fw_callback(),iwl_dealloc_ucode()
is called to free data. Iniwl_drv_stop(),iwl_dealloc_ucode()is called
again, which can cause double-free problems.To fix this bug, the call to
iwl_dealloc_ucode()iniwl_req_fw_callback()is deleted.This bug is found by a runtime fuzzing tool named FIZZER written by us.
Signed-off-by Jia-Ju Bai <[email protected]>--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 - 1 file changed, 1 deletion(-)drivers/net/wireless/intel/iwlwifi/iwl-drv.c +0
-1@@ -1579,7 +1579,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) goto free; out_free_fw: -iwl_dealloc_ucode (drv);release_firmware (ucode_raw); out_unbind:
Quoted 1 line
complete(&drv->request_firmware_complete);
Thanks! Applied to our internal tree and will reach the mainline following our normal upstreaming process.
--
Cheers,
Luca.