Skip to content

Commit b3f94eb

Browse files
wifi: iwlwifi: mvm: rfi: fix potential response leaks
jira LE-1907 cve CVE-2024-35912 Rebuild_History Non-Buildable kernel-4.18.0-553.16.1.el8_10 commit-author Johannes Berg <[email protected]> commit 06a0938 If the rx payload length check fails, or if kmemdup() fails, we still need to free the command response. Fix that. Fixes: 2125490 ("iwlwifi: mvm: add RFI-M support") Co-authored-by: Anjaneyulu <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240319100755.db2fa0196aa7.I116293b132502ac68a65527330fa37799694b79c@changeid Signed-off-by: Johannes Berg <[email protected]> (cherry picked from commit 06a0938) Signed-off-by: Jonathan Maple <[email protected]>
1 parent b866782 commit b3f94eb

File tree

1 file changed

+6
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+6
-2
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/rfi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,18 @@ struct iwl_rfi_freq_table_resp_cmd *iwl_rfi_get_freq_table(struct iwl_mvm *mvm)
132132
if (ret)
133133
return ERR_PTR(ret);
134134

135-
if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) != resp_size))
135+
if (WARN_ON_ONCE(iwl_rx_packet_payload_len(cmd.resp_pkt) !=
136+
resp_size)) {
137+
iwl_free_resp(&cmd);
136138
return ERR_PTR(-EIO);
139+
}
137140

138141
resp = kmemdup(cmd.resp_pkt->data, resp_size, GFP_KERNEL);
142+
iwl_free_resp(&cmd);
143+
139144
if (!resp)
140145
return ERR_PTR(-ENOMEM);
141146

142-
iwl_free_resp(&cmd);
143147
return resp;
144148
}
145149

0 commit comments

Comments
 (0)