android_kernel_motorola_sm6225/net/bluetooth
Luiz Augusto von Dentz d91fc28365 Bluetooth: L2CAP: Fix user-after-free
[ Upstream commit 35fcbc4243aad7e7d020b7c1dfb14bb888b20a4f ]

This uses l2cap_chan_hold_unless_zero() after calling
__l2cap_get_chan_blah() to prevent the following trace:

Bluetooth: l2cap_core.c:static void l2cap_chan_destroy(struct kref
*kref)
Bluetooth: chan 0000000023c4974d
Bluetooth: parent 00000000ae861c08
==================================================================
BUG: KASAN: use-after-free in __mutex_waiter_is_first
kernel/locking/mutex.c:191 [inline]
BUG: KASAN: use-after-free in __mutex_lock_common
kernel/locking/mutex.c:671 [inline]
BUG: KASAN: use-after-free in __mutex_lock+0x278/0x400
kernel/locking/mutex.c:729
Read of size 8 at addr ffff888006a49b08 by task kworker/u3:2/389

Link: https://lore.kernel.org/lkml/20220622082716.478486-1-lee.jones@linaro.org
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:19:38 +02:00
..
bnep net: remove sock_no_poll 2018-05-26 09:16:44 +02:00
cmtp Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails 2022-01-27 09:04:16 +01:00
hidp Bluetooth: hidp: use correct wait queue when removing ctrl_wait 2021-08-26 08:36:45 -04:00
rfcomm Bluetooth: Fix passing NULL to PTR_ERR 2022-07-29 17:10:36 +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 Bluetooth: Add BT_HS config option 2015-07-30 13:31:59 +02:00
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 Bluetooth: Add BT_HS config option 2015-07-30 13:31:59 +02:00
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: Fix the creation of hdev->name 2022-05-15 19:41:58 +02:00
hci_debugfs.c Bluetooth: Store Resolv list size 2018-07-06 12:40:08 +02:00
hci_debugfs.h Bluetooth: Provide option to enable/disable debugfs information 2015-02-15 18:54:13 +02:00
hci_event.c Bluetooth: Fix use after free in hci_send_acl 2022-04-15 14:15:03 +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: hci_sysfs: Fix attempting to call device_add multiple times 2022-10-26 13:19:37 +02:00
Kconfig Revert "Bluetooth: Add option for disabling legacy ioctl interfaces" 2017-09-28 13:20:32 -07:00
l2cap_core.c Bluetooth: L2CAP: Fix user-after-free 2022-10-26 13:19:38 +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 Bluetooth: Add combined LED trigger for controller power 2016-09-19 20:19:34 +02:00
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 networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
mgmt_util.h Bluetooth: Add generic mgmt helper API 2015-03-17 18:03:08 +01:00
sco.c Bluetooth: SCO: Fix sco_send_frame returning skb->len 2022-07-29 17:10:36 +02:00
selftest.c Bluetooth: Fix compiler warning with selftest duration calculation 2017-10-06 21:49:13 +03:00
selftest.h Bluetooth: Add support for self testing framework 2014-12-30 08:53:55 +02:00
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