linux-stable/net/bluetooth
Desmond Cheong Zhi Xi 728ff4b213 Bluetooth: fix init and cleanup of sco_conn.timeout_work
[ Upstream commit 49d8a56064 ]

Before freeing struct sco_conn, all delayed timeout work should be
cancelled. Otherwise, sco_sock_timeout could potentially use the
sco_conn after it has been freed.

Additionally, sco_conn.timeout_work should be initialized when the
connection is allocated, not when the channel is added. This is
because an sco_conn can create channels with multiple sockets over its
lifetime, which happens if sockets are released but the connection
isn't deleted.

Fixes: ba316be1b6 ("Bluetooth: schedule SCO timeouts with delayed_work")
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-26 11:36:07 +01:00
..
bnep net: remove sock_no_poll 2018-05-26 09:16:44 +02:00
cmtp Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow 2021-09-22 11:47:53 +02:00
hidp Bluetooth: hidp: use correct wait queue when removing ctrl_wait 2021-08-26 08:36:45 -04:00
rfcomm Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl 2020-04-13 10:45:14 +02:00
6lowpan.c Bluetooth: add a mutex lock to avoid UAF in do_enale_set 2020-08-19 08:14:50 +02:00
a2mp.c Bluetooth: drop HCI device reference before return 2021-03-04 09:39:34 +01:00
a2mp.h
af_bluetooth.c net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:27:48 +01:00
amp.c Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data 2021-03-07 12:18:58 +01:00
amp.h
ecdh_helper.c Bluetooth: let the crypto subsystem generate the ecc privkey 2017-10-06 20:35:47 +02:00
ecdh_helper.h Fix misc new gcc warnings 2021-05-22 10:59:21 +02:00
hci_conn.c Bluetooth: Disconnect if E0 is used for Level 4 2020-10-17 10:12:57 +02:00
hci_core.c Bluetooth: add timeout sanity check to hci_inquiry 2021-09-22 11:47:54 +02:00
hci_debugfs.c Bluetooth: Store Resolv list size 2018-07-06 12:40:08 +02:00
hci_debugfs.h
hci_event.c Bluetooth: Fix handling of LE Enhanced Connection Complete 2021-09-22 11:48:07 +02:00
hci_request.c bluetooth: eliminate the potential race condition when removing the HCI controller 2021-05-22 10:59:24 +02:00
hci_request.h Bluetooth: Ignore CC events not matching the last HCI command 2019-05-31 06:46:09 -07:00
hci_sock.c Bluetooth: defer cleanup of resources in hci_unregister_dev() 2021-08-12 13:19:40 +02:00
hci_sysfs.c Bluetooth: defer cleanup of resources in hci_unregister_dev() 2021-08-12 13:19:40 +02:00
Kconfig Revert "Bluetooth: Add option for disabling legacy ioctl interfaces" 2017-09-28 13:20:32 -07:00
l2cap_core.c Bluetooth: initialize skb_queue_head at l2cap_chan_create() 2021-05-22 10:59:40 +02:00
l2cap_sock.c Bluetooth: fix use-after-free error in lock_sock_nested() 2021-11-26 11:36:03 +01:00
leds.c leds: triggers: let struct led_trigger::activate() return an error code 2018-07-05 23:21:10 +02:00
leds.h
lib.c Bluetooth: make baswap src const 2017-09-01 22:49:47 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mgmt.c Bluetooth: Fix the HCI to MGMT status conversion table 2021-07-20 16:16:02 +02:00
mgmt_util.c
mgmt_util.h
sco.c Bluetooth: fix init and cleanup of sco_conn.timeout_work 2021-11-26 11:36:07 +01:00
selftest.c Bluetooth: Fix compiler warning with selftest duration calculation 2017-10-06 21:49:13 +03:00
selftest.h
smp.c Bluetooth: SMP: Fail if remote and local public keys are identical 2021-05-26 11:48:36 +02:00
smp.h Bluetooth: SMP: fix crash in unpairing 2018-09-26 12:39:32 +03:00