Skip to content

Commit ab77c8b

Browse files
fourdimgregkh
authored andcommitted
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_new_connection_cb()
commit 0a120d9 upstream. Add the same NULL guard already present in l2cap_sock_resume_cb() and l2cap_sock_ready_cb(). Fixes: 80808e4 ("Bluetooth: Add l2cap_chan_ops abstraction") Cc: stable@kernel.org Signed-off-by: Siwei Zhang <oss@fourdim.xyz> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6cb7f67 commit ab77c8b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/bluetooth/l2cap_sock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,9 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
14641464
{
14651465
struct sock *sk, *parent = chan->data;
14661466

1467+
if (!parent)
1468+
return NULL;
1469+
14671470
lock_sock(parent);
14681471

14691472
/* Check for backlog size */

0 commit comments

Comments
 (0)