summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btqca.c
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2024-05-01 14:34:53 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-05-03 19:05:33 +0200
commit0adcf6be1445ed50bfd4a451a7a782568f270197 (patch)
tree44c21f15bd73fe34a4acc9e45938df97d968ebfd /drivers/bluetooth/btqca.c
parentBluetooth: qca: fix info leak when fetching fw build id (diff)
downloadlinux-0adcf6be1445ed50bfd4a451a7a782568f270197.tar.xz
linux-0adcf6be1445ed50bfd4a451a7a782568f270197.zip
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: a7f8dedb4be2 ("Bluetooth: qca: add support for QCA2066") Cc: stable@vger.kernel.org # 6.7 Cc: Tim Jiang <quic_tjiang@quicinc.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth/btqca.c')
-rw-r--r--drivers/bluetooth/btqca.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 664db524b1dd..8d8a664620a3 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -252,6 +252,11 @@ static int qca_read_fw_board_id(struct hci_dev *hdev, u16 *bid)
goto out;
}
+ if (skb->len < 3) {
+ err = -EILSEQ;
+ goto out;
+ }
+
*bid = (edl->data[1] << 8) + edl->data[2];
bt_dev_dbg(hdev, "%s: bid = %x", __func__, *bid);