summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-02-20 20:54:10 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-20 23:06:43 +0200
commit801f13bd8ecc58f2cf42ec602a2b5db10fc5a132 (patch)
tree1b6a79e7e9890d6442d796f4f29e268d42faca1e
parentcd82e61c110a36e398323e422896fcfe05879fed (diff)
Bluetooth: Restrict access to management interface
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>
-rw-r--r--net/bluetooth/hci_sock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 213697d2377..8c429a179aa 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -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;