This is a note to let you know that I've just added the patch titled Bluetooth: ISO: Fix not checking for valid CIG/CIS IDs to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bluetooth-iso-fix-not-checking-for-valid-cig-cis-ids.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 50552c4cd6a4230dd5d5243b12b13bf81c6b4945 Author: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Date: Thu Aug 3 14:41:46 2023 -0700 Bluetooth: ISO: Fix not checking for valid CIG/CIS IDs [ Upstream commit b7f923b1ef6a2e76013089d30c9552257056360a ] 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@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 5db4d68c96d5c..fa3765bc8a5cd 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -1216,6 +1216,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;