|
@@ -6379,6 +6379,13 @@ int mgmt_control(struct hci_mgmt_chan *chan, struct sock *sk,
|
|
|
|
|
|
|
|
handler = &chan->handlers[opcode];
|
|
handler = &chan->handlers[opcode];
|
|
|
|
|
|
|
|
|
|
+ if (!hci_sock_test_flag(sk, HCI_SOCK_TRUSTED) &&
|
|
|
|
|
+ !(handler->flags & HCI_MGMT_UNTRUSTED)) {
|
|
|
|
|
+ err = mgmt_cmd_status(sk, index, opcode,
|
|
|
|
|
+ MGMT_STATUS_PERMISSION_DENIED);
|
|
|
|
|
+ goto done;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (index != MGMT_INDEX_NONE) {
|
|
if (index != MGMT_INDEX_NONE) {
|
|
|
hdev = hci_dev_get(index);
|
|
hdev = hci_dev_get(index);
|
|
|
if (!hdev) {
|
|
if (!hdev) {
|