Skip to content

Commit ce63c2c

Browse files
committed
Bluetooth: L2CAP: Fix use-after-free
jira VULN-155016 cve CVE-2023-53305 commit-author Zhengping Jiang <jiangzp@google.com> commit f752a0b Fix potential use-after-free in l2cap_le_command_rej. Signed-off-by: Zhengping Jiang <jiangzp@google.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit f752a0b) Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent 01c578f commit ce63c2c

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

6349+
chan = l2cap_chan_hold_unless_zero(chan);
6350+
if (!chan)
6351+
goto done;
6352+
63496353
l2cap_chan_lock(chan);
63506354
l2cap_chan_del(chan, ECONNREFUSED);
63516355
l2cap_chan_unlock(chan);
6356+
l2cap_chan_put(chan);
63526357

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

0 commit comments

Comments
 (0)