summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiwei Zhang <oss@fourdim.xyz>2026-04-15 16:49:59 -0400
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-05-06 16:21:09 -0400
commit0a120d96166301d7a95be75b52f843837dbd1219 (patch)
treebf22aa3447538d499049cdf2e00c5aa381a4cc31
parent78a88d43dab8d23aeef934ed8ce34d40e6b3d613 (diff)
Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_new_connection_cb()
Add the same NULL guard already present in l2cap_sock_resume_cb() and l2cap_sock_ready_cb(). Fixes: 80808e431e1e ("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>
-rw-r--r--net/bluetooth/l2cap_sock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 879c9f90269a..cf590a67d364 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1498,6 +1498,9 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
{
struct sock *sk, *parent = chan->data;
+ if (!parent)
+ return NULL;
+
lock_sock(parent);
/* Check for backlog size */