Skip to content

Commit 76083fb

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 665da0b commit 76083fb

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
@@ -1498,6 +1498,9 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
14981498
{
14991499
struct sock *sk, *parent = chan->data;
15001500

1501+
if (!parent)
1502+
return NULL;
1503+
15011504
lock_sock(parent);
15021505

15031506
/* Check for backlog size */

0 commit comments

Comments
 (0)