Skip to content

Commit f779a96

Browse files
Bluetooth: L2CAP: Fix use-after-free
jira VULN-155020 cve CVE-2023-53305 commit-author Zhengping Jiang <[email protected]> commit f752a0b Fix potential use-after-free in l2cap_le_command_rej. Signed-off-by: Zhengping Jiang <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit f752a0b) Signed-off-by: Shreeya Patel <[email protected]>
1 parent b439ee3 commit f779a96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/bluetooth/l2cap_core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6347,9 +6347,14 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
63476347
if (!chan)
63486348
goto done;
63496349

6350+
chan = l2cap_chan_hold_unless_zero(chan);
6351+
if (!chan)
6352+
goto done;
6353+
63506354
l2cap_chan_lock(chan);
63516355
l2cap_chan_del(chan, ECONNREFUSED);
63526356
l2cap_chan_unlock(chan);
6357+
l2cap_chan_put(chan);
63536358

63546359
done:
63556360
mutex_unlock(&conn->chan_lock);

0 commit comments

Comments
 (0)