Bluetooth: Check SOL_HCI for raw socket options
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/5 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 <[email protected]>
--- net/bluetooth/hci_sock.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/bluetooth/hci_sock.c +6 -0
@@ -1440,6 +1440,9 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,BT_DBG ("sk %p, opt %d" , sk, optname); +if (level !=SOL_HCI ) +return -ENOPROTOOPT ; +lock_sock (sk);if (hci_pi (sk)->channel !=HCI_CHANNEL_RAW ) {
@@ -1523,6 +1526,9 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname,BT_DBG ("sk %p, opt %d" , sk, optname); +if (level !=SOL_HCI ) +return -ENOPROTOOPT ; +if (get_user (len, optlen))return -EFAULT ;
Signature · 1 line
2.7.4
Hi Marcel,
Quoted 7 lines · Marcel Holtmann
The
SOL_HCIlevel should be enforced when using socket options on the HCI raw socket interface.Signed-off-by Marcel Holtmann <[email protected]>--- net/bluetooth/hci_sock.c | 6 ++++++ 1 file changed, 6 insertions(+)
All five patches in this set have been applied to bluetooth-next. They seem to work quite nicely with the latest btmon in bluez.git.
Johan