Skip to content

Commit 0adcf6b

Browse files
jhovoldVudentz
authored andcommitted
Bluetooth: qca: fix info leak when fetching board id
Add the missing sanity check when fetching the board id to avoid leaking slab data when later requesting the firmware. Fixes: a7f8ded ("Bluetooth: qca: add support for QCA2066") Cc: [email protected] # 6.7 Cc: Tim Jiang <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent cda0d6a commit 0adcf6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/bluetooth/btqca.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ static int qca_read_fw_board_id(struct hci_dev *hdev, u16 *bid)
252252
goto out;
253253
}
254254

255+
if (skb->len < 3) {
256+
err = -EILSEQ;
257+
goto out;
258+
}
259+
255260
*bid = (edl->data[1] << 8) + edl->data[2];
256261
bt_dev_dbg(hdev, "%s: bid = %x", __func__, *bid);
257262

0 commit comments

Comments
 (0)