Skip to content

Commit d5bd404

Browse files
committed
wifi: iwlwifi: mvm: don't set replay counters to 0xff
The firmware (later) actually uses the values even for keys that are invalid as far as the host is concerned, later in rekeying, and then only sets the low 48 bits since the PNs are only 48 bits over the air. It does, however, compare the full 64 bits later, obviously causing problems. Remove the memset and use kzalloc instead to avoid any old heap data leaking to the firmware. We already init all the other fields in the struct anyway. This leaves the data set to zero for any unused fields, so the firmware can look at them safely even if they're not used right now. Fixes: 79e561f ("iwlwifi: mvm: d3: implement RSC command version 5") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240206175739.462101146fef.I10f3855b99417af4247cff04af78dcbc6cb75c9c@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 5f4e099 commit d5bd404

File tree

1 file changed

+1
-3
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm,
461461
struct wowlan_key_rsc_v5_data data = {};
462462
int i;
463463

464-
data.rsc = kmalloc(sizeof(*data.rsc), GFP_KERNEL);
464+
data.rsc = kzalloc(sizeof(*data.rsc), GFP_KERNEL);
465465
if (!data.rsc)
466466
return -ENOMEM;
467467

468-
memset(data.rsc, 0xff, sizeof(*data.rsc));
469-
470468
for (i = 0; i < ARRAY_SIZE(data.rsc->mcast_key_id_map); i++)
471469
data.rsc->mcast_key_id_map[i] =
472470
IWL_MCAST_KEY_MAP_INVALID;

0 commit comments

Comments
 (0)