From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53334C4321E for ; Fri, 11 Nov 2022 02:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232657AbiKKChC (ORCPT ); Thu, 10 Nov 2022 21:37:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232906AbiKKCga (ORCPT ); Thu, 10 Nov 2022 21:36:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD0286AEE3; Thu, 10 Nov 2022 18:35:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 497D961E8C; Fri, 11 Nov 2022 02:35:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FD1AC4347C; Fri, 11 Nov 2022 02:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668134103; bh=5rxYowfdHwVc7t0KFNR8oRROSUrH+1lc0DcJxLJwSXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L+oYX93clEbPhMB0kOzw6Uc9x8BiDXX3hUmYY60BSc/2RILj18fxHJsDy18nwIY50 znZ3qiifo9VmY4WkrO6Wot1MFfan7DcLPyjjAYFJuEG/hWzxnjg0MiQ6XNUVQtFhPl BUnYiWw28B/YptOHcqynF0+jqDtzxT1CFsmriKKDHQXd0Jdny/Y2w/0ATPsfN8F35L pzPJ4awRN5wDRsvXROe7OU7lPZhtvsLkfAB0H+h2C5YmsIwHCdq2623VQ/lX7m1aeI hxcUMs99PJQXgN9T99QRSEGUc/Jtgd9XoLd7rBYTuDBY8o24vMytCRy04CDOLKPybI cVnQ4A0Rr9icA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luiz Augusto von Dentz , Tedd Ho-Jeong An , Sasha Levin , marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 26/30] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Thu, 10 Nov 2022 21:33:34 -0500 Message-Id: <20221111023340.227279-26-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221111023340.227279-1-sashal@kernel.org> References: <20221111023340.227279-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luiz Augusto von Dentz [ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ] l2cap_global_chan_by_psm shall not return fixed channels as they are not meant to be connected by (S)PSM. Signed-off-by: Luiz Augusto von Dentz Reviewed-by: Tedd Ho-Jeong An Signed-off-by: Sasha Levin --- net/bluetooth/l2cap_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 1f34b82ca0ec..3334d45a91ea 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1990,7 +1990,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm, if (link_type == LE_LINK && c->src_type == BDADDR_BREDR) continue; - if (c->psm == psm) { + if (c->chan_type != L2CAP_CHAN_FIXED && c->psm == psm) { int src_match, dst_match; int src_any, dst_any; -- 2.35.1