Skip to contentSkip to conversation

Bluetooth: Restrict access to management interface

PATCH Applied Marcel Holtmann 2 participants 2 messages Feb 20, 2012

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Restrict access to management interface

The management interface on the HCI control channel should be restricted to applications with CAP_NET_ADMIN permission.

---
 net/bluetooth/hci_sock.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/bluetooth/hci_sock.c +5 -0
index 213697d..8c429a1 100644
@@ -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;
 
Signature · 1 line
1.7.7.6
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

The management interface on the HCI control channel should be restricted to applications with CAP_NET_ADMIN permission.

---
 net/bluetooth/hci_sock.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Applied to my bluetooth-next tree. Thanks.

Johan