Skip to content

Commit 58e9293

Browse files
jhedbergholtmann
authored andcommitted
Bluetooth: Fix ignoring debug keys in mgmt_load_link_keys
We should never allow user space to feed back debug keys to the kernel. If the user desires to use debug keys require setting the appropriate debug keys mode and performing a new pairing. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent af6a9c3 commit 58e9293

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎net/bluetooth/mgmt.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,6 +2426,12 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data,
24262426
for (i = 0; i < key_count; i++) {
24272427
struct mgmt_link_key_info *key = &cp->keys[i];
24282428

2429+
/* Always ignore debug keys and require a new pairing if
2430+
* the user wants to use them.
2431+
*/
2432+
if (key->type == HCI_LK_DEBUG_COMBINATION)
2433+
continue;
2434+
24292435
hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val,
24302436
key->type, key->pin_len, NULL);
24312437
}

0 commit comments

Comments
 (0)