Skip to content

Commit cffdec2

Browse files
committed
Bluetooth: L2CAP: Fix use-after-free
jira VULN-155015 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: Brett Mastbergen <bmastbergen@ciq.com>
1 parent dcd9e0a commit cffdec2

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
@@ -5709,9 +5709,14 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
57095709
if (!chan)
57105710
goto done;
57115711

5712+
chan = l2cap_chan_hold_unless_zero(chan);
5713+
if (!chan)
5714+
goto done;
5715+
57125716
l2cap_chan_lock(chan);
57135717
l2cap_chan_del(chan, ECONNREFUSED);
57145718
l2cap_chan_unlock(chan);
5719+
l2cap_chan_put(chan);
57155720

57165721
done:
57175722
mutex_unlock(&conn->chan_lock);

0 commit comments

Comments
 (0)