Skip to content

Commit c264010

Browse files
committed
Bluetooth: controller: split: Validate chan map and hop value
Add validation of channel map and hop increment value received in CONNECT_IND PDU. Zero bit count leads to controller assert or divide-by-zero fault. Hop increment shall be between 5 and 16 by BT Specification. Relates to #23705. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent d39cb42 commit c264010

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_slave.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ void ull_slave_setup(memq_link_t *link, struct node_rx_hdr *rx,
7979
sizeof(lll->data_chan_map));
8080
lll->data_chan_count = util_ones_count_get(&lll->data_chan_map[0],
8181
sizeof(lll->data_chan_map));
82+
if (lll->data_chan_count < 2) {
83+
return;
84+
}
8285
lll->data_chan_hop = pdu_adv->connect_ind.hop;
86+
if ((lll->data_chan_hop < 5) || (lll->data_chan_hop > 16)) {
87+
return;
88+
}
8389
interval = sys_le16_to_cpu(pdu_adv->connect_ind.interval);
8490
lll->interval = interval;
8591
lll->latency = sys_le16_to_cpu(pdu_adv->connect_ind.latency);

0 commit comments

Comments
 (0)