]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_event: Ignore multiple conn complete events
authorSoenke Huster <soenke.huster@eknoes.de>
Sun, 23 Jan 2022 14:06:24 +0000 (15:06 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 25 Jan 2022 02:38:14 +0000 (18:38 -0800)
commit911b983bc55ca164bd32677e9197ec93af77b1fe
tree070e0ba892719aa7921ba90d864ade2eb59a6812
parent8bc437a69cc256e7354e7a0d6bf7bbb06384b439
Bluetooth: hci_event: Ignore multiple conn complete events

When one of the three connection complete events is received multiple
times for the same handle, the device is registered multiple times which
leads to memory corruptions. Therefore, consequent events for a single
connection are ignored.

The conn->state can hold different values, therefore HCI_CONN_HANDLE_UNSET
is introduced to identify new connections. To make sure the events do not
contain this or another invalid handle HCI_CONN_HANDLE_MAX and checks
are introduced.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=215497
Signed-off-by: Soenke Huster <soenke.huster@eknoes.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c