summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/iso.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-03 23:41:46 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-11 20:53:50 +0200
commitb7f923b1ef6a2e76013089d30c9552257056360a (patch)
tree6031531940adcb262bf629be95c627472fab48db /net/bluetooth/iso.c
parentBluetooth: hci_sync: Fix UAF on hci_abort_conn_sync (diff)
downloadlinux-b7f923b1ef6a2e76013089d30c9552257056360a.tar.xz
linux-b7f923b1ef6a2e76013089d30c9552257056360a.zip
Bluetooth: ISO: Fix not checking for valid CIG/CIS IDs
Valid range of CIG/CIS are 0x00 to 0xEF, so this checks they are properly checked before attempting to use HCI_OP_LE_SET_CIG_PARAMS. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth/iso.c')
-rw-r--r--net/bluetooth/iso.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 358954bfbb32..6b66d6a88b9a 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1187,6 +1187,12 @@ static bool check_io_qos(struct bt_iso_io_qos *qos)
static bool check_ucast_qos(struct bt_iso_qos *qos)
{
+ if (qos->ucast.cig > 0xef && qos->ucast.cig != BT_ISO_QOS_CIG_UNSET)
+ return false;
+
+ if (qos->ucast.cis > 0xef && qos->ucast.cis != BT_ISO_QOS_CIS_UNSET)
+ return false;
+
if (qos->ucast.sca > 0x07)
return false;