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 0685D1C31 for ; Wed, 23 Nov 2022 09:42:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C4D2C433C1; Wed, 23 Nov 2022 09:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669196531; bh=4JPnZ2MlGned0lCOIlKHPGB/jtAyKuzjcV6Fb4+haGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HT/OTv4OyKy+p40uxy+wDgK/Plv0TQtyf2cIkBqLlijmJSb2kIXsIQDGAQwGyVXW8 Ev6aSbOBq5aefOIy2TjSZ3zib0x9px0mlvDkkj94iIFMY8yKK6i/rTyJCycr/hFzt8 weJiSLDteUK6oD1Df2CX9I6sRc3SyLbVj58n5cpg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Luiz Augusto von Dentz , Tedd Ho-Jeong An , Sasha Levin Subject: [PATCH 6.0 057/314] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Wed, 23 Nov 2022 09:48:22 +0100 Message-Id: <20221123084628.084558767@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084625.457073469@linuxfoundation.org> References: <20221123084625.457073469@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 4df3d0ed6c80..9c24947aa41e 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