Skip to content

Commit e4b0195

Browse files
khfengVudentz
authored andcommitted
Bluetooth: Enforce validation on max value of connection interval
Right now Linux BT stack cannot pass test case "GAP/CONN/CPUP/BV-05-C 'Connection Parameter Update Procedure Invalid Parameters Central Responder'" in Bluetooth Test Suite revision GAP.TS.p44. [0] That was revoled by commit c49a868 ("Bluetooth: validate BLE connection interval updates"), but later got reverted due to devices like keyboards and mice may require low connection interval. So only validate the max value connection interval to pass the Test Suite, and let devices to request low connection interval if needed. [0] https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=229869 Fixes: 68d19d7 ("Revert "Bluetooth: validate BLE connection interval updates"") Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 7e74aa5 commit e4b0195

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6797,6 +6797,10 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, void *data,
67976797
return send_conn_param_neg_reply(hdev, handle,
67986798
HCI_ERROR_UNKNOWN_CONN_ID);
67996799

6800+
if (max > hcon->le_conn_max_interval)
6801+
return send_conn_param_neg_reply(hdev, handle,
6802+
HCI_ERROR_INVALID_LL_PARAMS);
6803+
68006804
if (hci_check_conn_params(min, max, latency, timeout))
68016805
return send_conn_param_neg_reply(hdev, handle,
68026806
HCI_ERROR_INVALID_LL_PARAMS);

net/bluetooth/l2cap_core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5613,7 +5613,13 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,
56135613

56145614
memset(&rsp, 0, sizeof(rsp));
56155615

5616-
err = hci_check_conn_params(min, max, latency, to_multiplier);
5616+
if (max > hcon->le_conn_max_interval) {
5617+
BT_DBG("requested connection interval exceeds current bounds.");
5618+
err = -EINVAL;
5619+
} else {
5620+
err = hci_check_conn_params(min, max, latency, to_multiplier);
5621+
}
5622+
56175623
if (err)
56185624
rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED);
56195625
else

0 commit comments

Comments
 (0)