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=1796380034; b=KuTPwOb++9gMY0Tswugs0+tIksY0g819/L/hW10Oz3C4pfvUOsKRm02dRzudkW+xuP06 BenveLoupa712lS96RtFuOmCzBi1CjbC66HsnEHWt81yjUgC7CyKkX12gQLvs1TPPUlV7 /+K9nA8QVKd0JssTyW/IOvCvttFaAVeExMdKinBIHoT7jhKEQhoJGf67UWIODRoZfFzSs X+40OnnZyKyEuYruLTlTau7v/FErc+9gd2lIdpUGN50CeeDDIWnn0SB3ZJ2++kInGaLxd ZFsvxHk5FTtL9cAUgrlltGf8vtHftYx1vZc+ClaOjf+HImAxcmSVcrMW7+1JLWFyZuA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380034; 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=MqLKvQrItNt8ZKA0gBtND3rhnJVgkkBx47RJT8DNQpo=; b=qXzLNCVEpSZpg8NCOYaGJRsSnbVsq62WHCnhnPSwfl6tcih0Wff/DJNSyPSSqIes6/ml QT3vYeV5q2vqfTToFGkGBaeOtWYVxBAYKxhWBBgoAJChLL1QjDtSH8KVMIfD46f8ZFrHa eC4We+vlUaCIi3Wx/OsWWHWilTczYUyRxIFmBoiTWLX752RjoW12MTjvX9IrgTEvtEB9F SbAjEAvRDcRkQyQb6suX8XlSWIggtzerdNQewKqS6sN5qXgF5tsBLg/HciURVXxpeVd29 UI6MamPoM75sR6O3Lw2Y/v1TrhhdJwv+gIo2KW+KIJNoIWwpWd0lN9hVWX7toJDxs4w== 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=COcSKge9; 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 DBA54606A322; Fri, 4 Dec 2026 10:27:14 +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=COcSKge9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5232E1F000C2; Fri, 4 Dec 2026 10:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380034; bh=MqLKvQrItNt8ZKA0gBtND3rhnJVgkkBx47RJT8DNQpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=COcSKge9WcyO1Qf65x6TJOxypBfKO47nUOTrvxjAwap53Dbh/TEBNNCX8Mrxa5108 orAj+gkagiqzUN3GSHij1/ZcSBZwtvRbjpCbsmcCEOxh1pLKS0q/4M/c3/Vxq9gJBC GYLzkE22KuCnouJ0D1wo4ZFvDxVbyu8OcpTZL8Q4= 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 7.3 100/742] Bluetooth: SMP: Check smp_data before using SMP_DEV() Date: Fri, 4 Dec 2026 18:59:24 +0900 Message-ID: <20261204100637.796512821@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 152ce3cfa0090..ae71a754d176a 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1759,7 +1759,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 */ @@ -1945,7 +1946,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