Skip to content

Commit fa0eb5b

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 75517d9 commit fa0eb5b

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
@@ -6353,9 +6353,14 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
63536353
if (!chan)
63546354
goto done;
63556355

6356+
chan = l2cap_chan_hold_unless_zero(chan);
6357+
if (!chan)
6358+
goto done;
6359+
63566360
l2cap_chan_lock(chan);
63576361
l2cap_chan_del(chan, ECONNREFUSED);
63586362
l2cap_chan_unlock(chan);
6363+
l2cap_chan_put(chan);
63596364

63606365
done:
63616366
mutex_unlock(&conn->chan_lock);

0 commit comments

Comments
 (0)