diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-06-24 07:00:26 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 11:42:46 -0400 |
commit | 58e9293c4e18b9b5f52822e7cbce589c70920721 (patch) | |
tree | 5b0c09311980950e659e957e41e8f6028d2c8a21 /net/bluetooth/mgmt.c | |
parent | af6a9c321384400efab1726636e8189737bbbd09 (diff) |
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>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 634b44ddc9f9..747746b0d2c4 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -2426,6 +2426,12 @@ static int load_link_keys(struct sock *sk, struct hci_dev *hdev, void *data, | |||
2426 | for (i = 0; i < key_count; i++) { | 2426 | for (i = 0; i < key_count; i++) { |
2427 | struct mgmt_link_key_info *key = &cp->keys[i]; | 2427 | struct mgmt_link_key_info *key = &cp->keys[i]; |
2428 | 2428 | ||
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 | |||
2429 | hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val, | 2435 | hci_add_link_key(hdev, NULL, &key->addr.bdaddr, key->val, |
2430 | key->type, key->pin_len, NULL); | 2436 | key->type, key->pin_len, NULL); |
2431 | } | 2437 | } |