From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796386204; b=TnE88YJfrjT2DnocwDaVwGqMFYvsEtwR9bMilKw9h2jcqiofq4gX8cHfnr/2bJ9U2aiE xNWxN2mvYvSYbh7FvkuImAak4mMBXPbM9jf5IR3NSxVvoJHjP/lcAjNdXiZ/mO/3qF4WS sz46iQ3KIZuIudqMPp7/ygqTuUZWyxtUV6eag7IGpkL8SLJR9dwhS9RSv3pPsn/g7mIjd pJpAEO7/jJtKUOILtgiI7iSdiQmouSkpPNF23AXZtrT/30CTYhVL4z7xPGH99KxDfFrPI /ZTl6Syav7NK+GzOZu5JgSrpM11e2pLIY71+1nYpFWrP/7VGv9VgfFK310kZjxJR6VQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386204; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=favZTy+WuqflZnpMSxfacuFjy5JFYbQOBV8p6YytfWk=; b=dPdJ/1S1nG/6BoOj8SMqFZcpMjiQqzdCHNzPr6fVVx7Na7OrF3FafJ/t0BUW2Lyge3jV VH27RhXW9X51p+SuTaCiuI+Y2UJxzPrTuWozRGxggW995ifbYJclKD8K324k+mXYnbPQ+ 1Vaw7evksZz2gI9do8j/Pj6T//8SvdLMseQeOJXnWLLM74WieTb9rPQwmgYXJJLPuAVfl KG0+QfNTI37Dmnjj2Dp0so8cPQiIPRcjmweRNix2rmGQ2vUsg0eurot09ZQkYkDyYHEIu 1w2pfrwa/Pwu4Th9qhmlZ6fvav0RqofnBISj/r6KleH+kJ2Ue5OZ0L1OzOtHa9syZ8Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qu8F+zC1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 420A2606A32C; Fri, 4 Dec 2026 12:10:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=qu8F+zC1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAFC71F000CE; Fri, 4 Dec 2026 12:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386204; bh=favZTy+WuqflZnpMSxfacuFjy5JFYbQOBV8p6YytfWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qu8F+zC11u3XWL0TElwdZrY91DdGcvxlTYNe8ShVtsKdSPwGsdT2YHF8T8e89eFpf KuMponJEzAn2fXlGUscynsG3h/R5DjuRCLf6ysvNXPo5amv5tWuJ/aZxUnZFmT1odp MLSGGa9/PSbcJPKRdZLtAyp6wRPMN+bKShfiQCnk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.6 0869/1167] Bluetooth: SMP: Check smp_data before using SMP_DEV() Date: Fri, 4 Dec 2026 19:04:56 +0900 Message-ID: <20261204100724.773858405@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luiz Augusto von Dentz [ Upstream commit e8764a6946341e9ee809393386e7b815179c5f5f ] hdev->smp_data is NULL when the SMP channel could not be registered, so receiving a Pairing Request/Response with the OOB flag set would dereference NULL through SMP_DEV(). Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-9bc9da90-02a8-4a87-a603-87d0a4cf464c Fixes: 94f14e472812 ("Bluetooth: SMP: Fix trying to use non-existent local OOB data") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/smp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index dc556a998ee6e..c89de7c51c78c 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1784,7 +1784,8 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb) * successfully received our local OOB data - therefore set the * flag to indicate that local OOB is in use. */ - if (req->oob_flag == SMP_OOB_PRESENT && SMP_DEV(hdev)->local_oob) + if (req->oob_flag == SMP_OOB_PRESENT && hdev->smp_data && + SMP_DEV(hdev)->local_oob) set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); /* SMP over BR/EDR requires special treatment */ @@ -1970,7 +1971,8 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb) * successfully received our local OOB data - therefore set the * flag to indicate that local OOB is in use. */ - if (rsp->oob_flag == SMP_OOB_PRESENT && SMP_DEV(hdev)->local_oob) + if (rsp->oob_flag == SMP_OOB_PRESENT && hdev->smp_data && + SMP_DEV(hdev)->local_oob) set_bit(SMP_FLAG_LOCAL_OOB, &smp->flags); smp->prsp[0] = SMP_CMD_PAIRING_RSP; -- 2.53.0