Commit b837f83
committed
Bluetooth: L2CAP: Fix user-after-free
jira VULN-155527
cve CVE-2022-50386
commit-author Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
commit 35fcbc4
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>
(cherry picked from commit 35fcbc4)
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>1 parent f02ba3a commit b837f83
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4032 | 4032 | | |
4033 | 4033 | | |
4034 | 4034 | | |
| 4035 | + | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
| 4040 | + | |
4035 | 4041 | | |
4036 | 4042 | | |
4037 | 4043 | | |
| |||
4062 | 4068 | | |
4063 | 4069 | | |
4064 | 4070 | | |
| 4071 | + | |
4065 | 4072 | | |
4066 | 4073 | | |
4067 | 4074 | | |
| |||
0 commit comments