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=1796388902; b=M/y5kZ62zTTLxNROhDv6F1vIniaS7syd3TYQjipFMbgcxGGelM/k/o/j+g/pZeTqvhyr EC1Xwd3hpsG11lm+SmaXxj/XqiltRoelTBbGeZTT3xVzIstGqB8VEVZVNzP1ckGiVcGaR MtYpnnXz2Hk5NmLtuu0mJjSIMqGal5VACynXn7nhwEaCY9IT7GkzYDigXUnHG//f5T2pl 41kuNbTtqDAqphBa7AlPLMIY7splHx6mluFUAXiN4aXACr0u7fRZYeYGu6npx6ko+KTaA U2I5dsVKCgH/hvZZRi8URcRYWfCFobBQGwGFtThNUSgeQAz/hXZBh9YJ/KUFF525Gow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388902; 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=lyo3GU4S6UMyuCnfHTv3Pu+mQchvfdJCPI+KUt5oAJI=; b=NogPk8ymZ4xh/35u+UX3qNys9tm9BnprNG4wFEmgmKwoPNKcrW9on0VWpF5iHEhu7SUN 8cmnRxX5lwKTFGS/Gf6SnsUF8ctTRwBQpVl7h1/NzoHjgtoh14FN5U48pgcbyVhuLzM5s BGNlVWMs3MEYdMVJKGOG2D7GiI4AsKSGLlCdkaRa6I8phteOmkWkuJNuArs/keUlZVzIs Il9Ri0m69fu7vfpe666c7ZiYj8yzOZdmApHVLkZLfTNQwJL3qi3MbLv+xPPwxB/DGniYN ltubgtzqHyv6PQ0zlE8x26nXy3RXcaK8tGCWfmZ6Q26aEIqGabzQ5r5m+9fPgiShkfg== 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=ZGxDSfIT; 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 C0F99606A32D; Fri, 4 Dec 2026 12:55:02 +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=ZGxDSfIT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 503091F000CE; Fri, 4 Dec 2026 12:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388902; bh=lyo3GU4S6UMyuCnfHTv3Pu+mQchvfdJCPI+KUt5oAJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZGxDSfITb5H3EYCLACt09vcWv6JE4i2CI7WzqgbDdfEffxaRwb74R530cJ3l8s/N7 52j1UHYnviGBAPiKTHio6NT3eDiXXK8OQt2IQz7YHk1BpXCSB9HEjqCAGLdZ6gVH0T DpthMNKx72RJ/Y60VjrL29g7I11sZ76XNduXwkco= 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.1 0793/1059] Bluetooth: SMP: Check smp_data before using SMP_DEV() Date: Fri, 4 Dec 2026 19:05:24 +0900 Message-ID: <20261204100704.574471541@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 d5c183855ae50..46a9d187fc6e1 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1770,7 +1770,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 */ @@ -1956,7 +1957,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