Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp867912qtx; Mon, 31 Oct 2022 16:13:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5RyY71yVih/18Yab05snIlxK90LNu/X1z2Gw25Gms1bMwwAhUuBWq8Tq9ac/r7UHhk2fsG X-Received: by 2002:a50:950d:0:b0:463:298a:448c with SMTP id u13-20020a50950d000000b00463298a448cmr10770998eda.153.1667258023363; Mon, 31 Oct 2022 16:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667258023; cv=none; d=google.com; s=arc-20160816; b=qTpCxBKXyn8TTwz+Aam3ESRIcPrGPnDaGFFkri5a2rn47C0kujSp9ZEajOksM1zSUC /ggrfVeiyWZ+dm1yq8XaHymB7xGPu4vavo7Q1FXHRx65vJ3DSK+iCLhIPURx059jb2Gj vSGekJ8Iz8GnWlV0A001TahvCulQpH7h9arEJBK1/uF798ejbuq5o6/Tt4c+S1qZYfWC xo/jVnRJx1dzKmfJ8QDD44ZJX3J6qkon1VNlt4OsHe2k5bFYD5usME6c6nn+xhbHZvIE czByCOuVo5T0+DakiYUwgc2lXWx1lhz4TQooDJmGNvZYuPUQDI603/rdR5Mec31Wt43x SRdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+zPcZ5mS1uhVLvd0yX1s8m0lmHFPr55m+NTvn4ka+Mg=; b=T3k40EjexSfU5gsPv/y7vm6rv5WK5q8hsLLucL/NYjXyv5zC1LOsfVT954Z1qJoMEy TTuH9KkMmWC6SSnD0UvVZX0V5Nyol+b3Zw2WOfGy+YkYJioUXtuDlDqvtW6WLvaRSvtd EgGEbX73me63kbkxrrarf07knih7PCERaHLuif6rwK4pikDee9aghPNd9wYJnYCGm+MM OsARA4OyOkTkytKSBOlPqO5OGojVPsilf1Dn9DjfEAypBZ8Kfy3/xelDt5l/6D/mDJ5L 4SZRgkSSA2zs491HR49DtK785mrMDZiD8qNbXB7wxoDY3CC+0NCg2FcF6S6zo77BKJHN SZZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XQhSmwIS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj4-20020a1709069c8400b0078adad5930esi10172160ejc.255.2022.10.31.16.13.17; Mon, 31 Oct 2022 16:13:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XQhSmwIS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbiJaXLD (ORCPT + 99 others); Mon, 31 Oct 2022 19:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbiJaXKu (ORCPT ); Mon, 31 Oct 2022 19:10:50 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 148F716597 for ; Mon, 31 Oct 2022 16:10:38 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id io19so12043388plb.8 for ; Mon, 31 Oct 2022 16:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+zPcZ5mS1uhVLvd0yX1s8m0lmHFPr55m+NTvn4ka+Mg=; b=XQhSmwISo/A9A/uJnReuME5uGNYWAMIyI6OYOHCkZoXHfCihmjdcB8X4hsuSuvdabm /NiaHp+bA/OWx+u/hu5ke+a1XvrJeKKCXKV8hqWp6ZusGRs9F3Zvw5AasV2GUnV5ZKR/ 7a6kTuNFBNHNYm5ewO9nIvIiRzFJrb6H67Wfv1TwAkOWaTFlJOWh8JJ4o0Ie+sfzhATQ mH99Yv0S1VMrrSfhCxjp4BK2S6TAu8O765fUEQH08lUNojTXc7BriB6LBHMsB3B9xC/3 VXFekNPByvdKdyx+q7P88v5WifsjjG2XY144NTvfSsB0pGRZ3V49uKTt/biY7LnTWl3K 9PLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+zPcZ5mS1uhVLvd0yX1s8m0lmHFPr55m+NTvn4ka+Mg=; b=XEO0GnPwG6OziDnmDKGSOwTP8RFRj8Xwpqmr9Fl2dWljhe0yRIsdJRgOuJFoR/vZQ/ nid4eSeeYPrFtLIYl3VrdZ551bJajjGZHApEO2URadb+GoeYT2pv2sKKMDFoj2ystSZZ raKyhslvS2rFC7aNDLP+LwAykUOfIyxRfJvTmule+yrCeGwYu03mJ9g3JZkTilKWxkrl q8JLxBeLVNSHNftGzIOFWa2xp2YJdFflSWrdEWC4MPFjrgnfjAzPsZiST7shv8Srtj++ P/EzWl53o0lm6eE6pZA9BA3El6PTeJvExBayuEXfSdnPiHAfBoCPMJthuNeaJzwkzlbm 81ug== X-Gm-Message-State: ACrzQf032jquUqQzxT93J9DauqStI4Sp+jCCVXjusvDpUrvHO16e0usP CXZ/u9xLEQK7QZtogrgWC6GW1Lux9M4= X-Received: by 2002:a17:902:7786:b0:178:48c0:a083 with SMTP id o6-20020a170902778600b0017848c0a083mr16648853pll.125.1667257836971; Mon, 31 Oct 2022 16:10:36 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id b7-20020aa78ec7000000b00561382a5a25sm5104265pfr.26.2022.10.31.16.10.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:10:36 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH 2/2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Mon, 31 Oct 2022 16:10:33 -0700 Message-Id: <20221031231033.2718204-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221031231033.2718204-1-luiz.dentz@gmail.com> References: <20221031231033.2718204-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz 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 --- 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 2978a34ea33f..cdddd2c779f2 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.37.3