Luiz Augusto von Dentz
11e40d6c08
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:15:46 +02:00
..
2017-08-30 10:21:52 +02:00
2022-01-27 08:47:33 +01:00
2021-12-14 10:04:46 +01:00
2020-04-13 10:32:57 +02:00
2020-08-21 11:01:57 +02:00
2021-03-03 17:44:32 +01:00
2015-07-30 13:31:59 +02:00
2018-03-22 09:17:52 +01:00
2021-03-07 11:25:57 +01:00
2015-07-30 13:31:59 +02:00
2014-12-03 16:51:16 +01:00
2014-12-03 16:51:16 +01:00
2020-10-17 11:02:19 +02:00
2022-05-15 19:39:17 +02:00
2016-07-18 09:33:28 +03:00
2015-02-15 18:54:13 +02:00
2022-04-20 09:06:43 +02:00
2021-05-22 10:40:20 +02:00
2016-10-19 18:42:37 +02:00
2021-08-15 13:01:02 +02:00
2022-10-26 13:15:46 +02:00
2016-02-23 20:29:35 +01:00
2022-10-26 13:15:46 +02:00
2021-11-26 11:48:27 +01:00
2016-09-19 20:19:34 +02:00
2016-09-19 20:19:34 +02:00
2015-09-24 16:25:44 +02:00
2016-02-23 20:29:35 +01:00
2016-09-19 20:19:34 +02:00
2015-03-17 18:03:08 +01:00
2021-07-20 16:21:08 +02:00
2022-06-14 16:52:32 +02:00
2015-04-02 08:47:38 +03:00
2014-12-30 08:53:55 +02:00
2021-05-26 11:29:09 +02:00
2018-11-10 07:42:42 -08:00