Skip to content

Commit ea3a6ef

Browse files
Bluetooth: L2CAP: Fix use-after-free
jira VULN-155022 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 43c0309 commit ea3a6ef

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
@@ -6345,9 +6345,14 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
63456345
if (!chan)
63466346
goto done;
63476347

6348+
chan = l2cap_chan_hold_unless_zero(chan);
6349+
if (!chan)
6350+
goto done;
6351+
63486352
l2cap_chan_lock(chan);
63496353
l2cap_chan_del(chan, ECONNREFUSED);
63506354
l2cap_chan_unlock(chan);
6355+
l2cap_chan_put(chan);
63516356

63526357
done:
63536358
mutex_unlock(&conn->chan_lock);

0 commit comments

Comments
 (0)