aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2016-08-27 14:23:37 -0400
committerMarcel Holtmann <marcel@holtmann.org>2016-09-19 14:19:34 -0400
commit47b0f573f2fa7634860e16ea31f2bc3057a1022a (patch)
tree068e289e966ce0b1fe50da06f2dd2b5467f5d1fc /net/bluetooth
parent7e8524591ffffe3536bd363827ff4477a5672c65 (diff)
Bluetooth: Check SOL_HCI for raw socket options
The SOL_HCI level should be enforced when using socket options on the HCI raw socket interface. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_sock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 96f04b7b9556..99dd1503ef56 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -1440,6 +1440,9 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
1440 1440
1441 BT_DBG("sk %p, opt %d", sk, optname); 1441 BT_DBG("sk %p, opt %d", sk, optname);
1442 1442
1443 if (level != SOL_HCI)
1444 return -ENOPROTOOPT;
1445
1443 lock_sock(sk); 1446 lock_sock(sk);
1444 1447
1445 if (hci_pi(sk)->channel != HCI_CHANNEL_RAW) { 1448 if (hci_pi(sk)->channel != HCI_CHANNEL_RAW) {
@@ -1523,6 +1526,9 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname,
1523 1526
1524 BT_DBG("sk %p, opt %d", sk, optname); 1527 BT_DBG("sk %p, opt %d", sk, optname);
1525 1528
1529 if (level != SOL_HCI)
1530 return -ENOPROTOOPT;
1531
1526 if (get_user(len, optlen)) 1532 if (get_user(len, optlen))
1527 return -EFAULT; 1533 return -EFAULT;
1528 1534