Skip to content

Commit 9ce8b24

Browse files
Ryan HsuKalle Valo
authored andcommitted
Revert "ath10k: add sanity check to ie_len before parsing fw/board ie"
This reverts commit 9ed4f91. The commit introduced a regression that over read the ie with the padding. - the expected IE information ath10k_pci 0000:03:00.0: found firmware features ie (1 B) ath10k_pci 0000:03:00.0: Enabling feature bit: 6 ath10k_pci 0000:03:00.0: Enabling feature bit: 7 ath10k_pci 0000:03:00.0: features ath10k_pci 0000:03:00.0: 00000000: c0 00 00 00 00 00 00 00 - the wrong IE with padding is read (0x77) ath10k_pci 0000:03:00.0: found firmware features ie (4 B) ath10k_pci 0000:03:00.0: Enabling feature bit: 6 ath10k_pci 0000:03:00.0: Enabling feature bit: 7 ath10k_pci 0000:03:00.0: Enabling feature bit: 8 ath10k_pci 0000:03:00.0: Enabling feature bit: 9 ath10k_pci 0000:03:00.0: Enabling feature bit: 10 ath10k_pci 0000:03:00.0: Enabling feature bit: 12 ath10k_pci 0000:03:00.0: Enabling feature bit: 13 ath10k_pci 0000:03:00.0: Enabling feature bit: 14 ath10k_pci 0000:03:00.0: Enabling feature bit: 16 ath10k_pci 0000:03:00.0: Enabling feature bit: 17 ath10k_pci 0000:03:00.0: Enabling feature bit: 18 ath10k_pci 0000:03:00.0: features ath10k_pci 0000:03:00.0: 00000000: c0 77 07 00 00 00 00 00 Tested-by: Mike Lothian <[email protected]> Signed-off-by: Ryan Hsu <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 4e12d65 commit 9ce8b24

File tree

1 file changed

+7
-7
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+7
-7
lines changed

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,10 +1305,7 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
13051305
len -= sizeof(*hdr);
13061306
data = hdr->data;
13071307

1308-
/* jump over the padding */
1309-
ie_len = ALIGN(ie_len, 4);
1310-
1311-
if (len < ie_len) {
1308+
if (len < ALIGN(ie_len, 4)) {
13121309
ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
13131310
ie_id, ie_len, len);
13141311
ret = -EINVAL;
@@ -1347,6 +1344,9 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
13471344
goto out;
13481345
}
13491346

1347+
/* jump over the padding */
1348+
ie_len = ALIGN(ie_len, 4);
1349+
13501350
len -= ie_len;
13511351
data += ie_len;
13521352
}
@@ -1477,9 +1477,6 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
14771477
len -= sizeof(*hdr);
14781478
data += sizeof(*hdr);
14791479

1480-
/* jump over the padding */
1481-
ie_len = ALIGN(ie_len, 4);
1482-
14831480
if (len < ie_len) {
14841481
ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n",
14851482
ie_id, len, ie_len);
@@ -1585,6 +1582,9 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
15851582
break;
15861583
}
15871584

1585+
/* jump over the padding */
1586+
ie_len = ALIGN(ie_len, 4);
1587+
15881588
len -= ie_len;
15891589
data += ie_len;
15901590
}

0 commit comments

Comments
 (0)