Skip to content

Commit

Permalink
Bluetooth: Restrict access to management interface
Browse files Browse the repository at this point in the history
The management interface on the HCI control channel should be restricted
to applications with CAP_NET_ADMIN permission.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Feb 20, 2012
1 parent cd82e61 commit 801f13b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
goto done;
}

if (!capable(CAP_NET_ADMIN)) {
err = -EPERM;
goto done;
}

set_bit(HCI_PI_MGMT_INIT, &hci_pi(sk)->flags);
break;

Expand Down

0 comments on commit 801f13b

Please sign in to comment.