Skip to content

Commit

Permalink
Bluetooth: ISO: Fix not checking for valid CIG/CIS IDs
Browse files Browse the repository at this point in the history
[ Upstream commit b7f923b ]

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: ccf74f2 ("Bluetooth: Add BTPROTO_ISO socket type")
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Vudentz authored and gregkh committed Sep 13, 2023
1 parent c976a72 commit aa4ef8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/bluetooth/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit aa4ef8f

Please sign in to comment.