Bluetooth: Restrict access for raw-only controllers
[deliverable/linux.git] / net / bluetooth / mgmt.c
index 6faa4616cbfed57f2a110fdfafc98aa3e839327d..41b1aec0c5dc64e7597802d4a05f49d4fb6dc681 100644 (file)
@@ -347,6 +347,9 @@ static int read_index_list(struct sock *sk, struct hci_dev *hdev, void *data,
                if (test_bit(HCI_USER_CHANNEL, &d->dev_flags))
                        continue;
 
+               if (test_bit(HCI_QUIRK_RAW_DEVICE, &d->quirks))
+                       continue;
+
                if (d->dev_type == HCI_BREDR) {
                        rp->index[count++] = cpu_to_le16(d->id);
                        BT_DBG("Added hci%u", d->id);
@@ -5066,7 +5069,8 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
                }
 
                if (test_bit(HCI_SETUP, &hdev->dev_flags) ||
-                   test_bit(HCI_USER_CHANNEL, &hdev->dev_flags)) {
+                   test_bit(HCI_USER_CHANNEL, &hdev->dev_flags) ||
+                   test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) {
                        err = cmd_status(sk, index, opcode,
                                         MGMT_STATUS_INVALID_INDEX);
                        goto done;
This page took 0.037252 seconds and 5 git commands to generate.