From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA7152EBB84; Tue, 12 May 2026 17:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778607977; cv=none; b=IB6nZfjmcFPiNRTjarB0AFiONfBLUyI1XzL0B/J12OFq23MrMsLDTT6nujZQuOYSHkc72GC+K7y/Ju9lMgiJP9iYu0XmEe2XWmBaisL5xisz+vTgY+GJ3yVUq8UjGfJD+nvnq3WKgq/KDRLq3nn8FCEYx+sCo8Y9bzU7n8t1baw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778607977; c=relaxed/simple; bh=GJcP4HyWDJ50vXRfHY0t5OIVPYbDtpcRrSo6TvUORRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SDJh+9RHLyuiCH1o1FcP7az0+/jhdWQ0jTAze9AR5YR6zEfUDk1nP+0AXpCgVABQpq/La046fuQTr1wom/Y84I+UrVE0524lcsoVFU3w/2l/IoCICqPLSgHT0zjLfJmllyJ75gnBBaSJP85se65ETH9prM+JN8fTg8K9XG5Vu6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QEAWBGkh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QEAWBGkh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 701DBC2BCB0; Tue, 12 May 2026 17:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778607977; bh=GJcP4HyWDJ50vXRfHY0t5OIVPYbDtpcRrSo6TvUORRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEAWBGkh6NaR2Pu1G20uWXN0a8GKGJXOnofRQGQdV2NZLBitQD0WO0JsocIkEUmTo g2PW6pxMm6GZkGxzM11DGG3GfEbtojZWpbG4GgT+peKxiQk7ts41nywNzPlM40lpk4 zJM9plBPeHMoQoBQbzn8jOTe1EiaHIwu0Mq/9YHI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Siwei Zhang , Luiz Augusto von Dentz Subject: [PATCH 6.12 066/206] Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb() Date: Tue, 12 May 2026 19:38:38 +0200 Message-ID: <20260512173934.241452348@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173932.810559588@linuxfoundation.org> References: <20260512173932.810559588@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Siwei Zhang commit 2ff1a41a912de8517b4482e946dd951b7d80edbf upstream. Add the same NULL guard already present in l2cap_sock_resume_cb() and l2cap_sock_ready_cb(). Fixes: 89bc500e41fc ("Bluetooth: Add state tracking to struct l2cap_chan") Cc: stable@kernel.org Signed-off-by: Siwei Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/l2cap_sock.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -1630,6 +1630,9 @@ static void l2cap_sock_state_change_cb(s { struct sock *sk = chan->data; + if (!sk) + return; + sk->sk_state = state; if (err)