Commit ed1b28a4 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Limit userspace exposure of stack internal events

The stack internal events that are exposed to userspace should be
limited to HCI_DEV_REG, HCI_DEV_UNREG, HCI_DEV_UP and HCI_DEV_DOWN.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent b224d3ff
...@@ -392,14 +392,12 @@ static void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) ...@@ -392,14 +392,12 @@ static void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
void hci_sock_dev_event(struct hci_dev *hdev, int event) void hci_sock_dev_event(struct hci_dev *hdev, int event)
{ {
struct hci_ev_si_device ev;
BT_DBG("hdev %s event %d", hdev->name, event); BT_DBG("hdev %s event %d", hdev->name, event);
/* Send event to monitor */
if (atomic_read(&monitor_promisc)) { if (atomic_read(&monitor_promisc)) {
struct sk_buff *skb; struct sk_buff *skb;
/* Send event to monitor */
skb = create_monitor_event(hdev, event); skb = create_monitor_event(hdev, event);
if (skb) { if (skb) {
hci_send_to_channel(HCI_CHANNEL_MONITOR, skb, hci_send_to_channel(HCI_CHANNEL_MONITOR, skb,
...@@ -408,10 +406,14 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event) ...@@ -408,10 +406,14 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
} }
} }
/* Send event to sockets */ if (event <= HCI_DEV_DOWN) {
ev.event = event; struct hci_ev_si_device ev;
ev.dev_id = hdev->id;
hci_si_event(NULL, HCI_EV_SI_DEVICE, sizeof(ev), &ev); /* Send event to sockets */
ev.event = event;
ev.dev_id = hdev->id;
hci_si_event(NULL, HCI_EV_SI_DEVICE, sizeof(ev), &ev);
}
if (event == HCI_DEV_UNREG) { if (event == HCI_DEV_UNREG) {
struct sock *sk; struct sock *sk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment