Luiz Augusto von Dentz
d1e894f950
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 12:35:37 +02:00
..
2021-06-26 07:12:40 +02:00
2022-01-27 11:03:03 +01:00
2021-06-26 07:12:40 +02:00
2022-10-26 12:34:44 +02:00
2021-06-26 07:12:41 +02:00
2021-06-26 07:12:41 +02:00
2020-02-28 08:30:02 +01:00
2021-01-29 16:51:45 +01:00
2021-06-26 07:12:41 +02:00
2019-06-05 17:36:37 +02:00
2021-04-06 14:11:23 -07:00
2021-04-06 14:11:23 -07:00
2021-03-13 00:04:03 +11:00
2021-04-27 17:05:53 -07:00
2022-04-08 14:23:41 +02:00
2022-10-26 12:34:46 +02:00
2021-06-26 07:12:44 +02:00
2022-07-12 16:35:07 +02:00
2022-06-09 10:22:58 +02:00
2020-11-09 13:33:19 +01:00
2021-08-05 12:15:24 -07:00
2022-10-26 12:35:36 +02:00
2021-04-06 14:11:23 -07:00
2022-10-26 12:35:37 +02:00
2022-01-27 11:03:58 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-05-11 12:16:27 +02:00
2021-04-06 14:11:23 -07:00
2021-06-26 07:12:42 +02:00
2020-06-18 13:11:03 +03:00
2022-01-27 11:03:31 +01:00
2021-06-26 07:12:42 +02:00
2021-04-08 12:26:34 +02:00
2022-07-29 17:25:30 +02:00
2021-03-13 00:04:03 +11:00
2021-06-26 07:12:43 +02:00
2021-06-26 07:12:37 +02:00