Skip to content

Commit fe3dace

Browse files
committed
Bluetooth: L2CAP: Fix use-after-free
jira VULN-155018 jira VULN-155017 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: Jonathan Maple <jmaple@ciq.com>
1 parent 4c85420 commit fe3dace

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
@@ -6336,9 +6336,14 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
63366336
if (!chan)
63376337
goto done;
63386338

6339+
chan = l2cap_chan_hold_unless_zero(chan);
6340+
if (!chan)
6341+
goto done;
6342+
63396343
l2cap_chan_lock(chan);
63406344
l2cap_chan_del(chan, ECONNREFUSED);
63416345
l2cap_chan_unlock(chan);
6346+
l2cap_chan_put(chan);
63426347

63436348
done:
63446349
mutex_unlock(&conn->chan_lock);

0 commit comments

Comments
 (0)