From patchwork Sat Dec 3 17:48:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1711730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=TFAXwgQ1; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NPcl95RhYz23np for ; Sun, 4 Dec 2022 04:49:41 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1p1Wdo-0007dh-Pr; Sat, 03 Dec 2022 17:49:32 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1p1Wdi-0007Rt-Uw for kernel-team@lists.ubuntu.com; Sat, 03 Dec 2022 17:49:27 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A1E943F1C3 for ; Sat, 3 Dec 2022 17:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1670089765; bh=M2B5I49VWGeYNWHOrUgBjvCQqEQzdXCF4JHazDPyyoY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TFAXwgQ1VIvkKIJCcDXl8ihqO9B9IUD2f8MOQ1AqDjr7KuyvHmMOje3YVb+dY1JBk TZXhHvaYO2wnUgjAIk2A20ZjUb6AsyQBeQrZlhz4pU/krIAjkePuBDQduKWxP2XPj3 ybOtHGX6si4QpemsgXh7GobR2o6nKXDO8RVMRKVFPQ2n6JgV1jIWgfEpbjZI0KFnVK 4RDxGYYthAvnbqxjve6nibIkSaZdbx3xDLXEfNXliPzKyK8N6wCugfsIAd5UCOTmzh dl5mzynd27p3Mz19X3uMr+EifsCzSLAFa2DfjVGrUWowGhHtr1Ga/MWRBE/JHSMQPv d+JvK03xdzaOg== Received: by mail-wr1-f69.google.com with SMTP id v14-20020adf8b4e000000b0024174021277so1631870wra.13 for ; Sat, 03 Dec 2022 09:49:25 -0800 (PST) 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=M2B5I49VWGeYNWHOrUgBjvCQqEQzdXCF4JHazDPyyoY=; b=cMEvBVRiwok56Kv3T8NLtjSgKKjAx7pdnldd43zE1ANR8yibzTRe1qV6Wx8NCOKmDO wGpyMFFDKz14LODmHXvulbK8LG6geZRwn9xHqnerdP+dhmOL/5K/JdI2xMEszWY6L+K0 qEgF5Vqxo8OsCS7VXZH1M5pccg1872k1z5O2l/nY+ocWMxBuQgCCfjmlPnQnnSUXYbOe kye44UROTUfaId7mnmC5Klvu1FZqJ2UBGRfP5/7TD4hZquBASKDAdKOqxpbexCgK2DLm EPDESewIFcLMFASdSKhmDKRg/RSgk1bNAGq40jI4MBk64nRKi0hRy2h2xUvp4rDn6Yby BNfw== X-Gm-Message-State: ANoB5pkQt9Y9AN5amBvQk/SK0yzVQAE9+XE9x8kF2xT4XiGxq8/eh3Nw cK2WT1aUW4bc8z8x686n/QHBz6OnUe5soPxsut0xomSgpTCpPCdDouhFT8Y+f6pPXTRfaJLs8Ka nqAeOHDIUpJl5fm8XVmSeBZYvz0Qutk/ODWZ1Dh6BGg== X-Received: by 2002:a05:600c:a52:b0:3d0:73ab:461d with SMTP id c18-20020a05600c0a5200b003d073ab461dmr12105026wmq.73.1670089765101; Sat, 03 Dec 2022 09:49:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5LQcYx7LkLzZWs5VZZ/ziAjQ9XmbLwoYePBXAQ7xaUBsz5zG8vFfviBcoBbWfglMiipNdvtA== X-Received: by 2002:a05:600c:a52:b0:3d0:73ab:461d with SMTP id c18-20020a05600c0a5200b003d073ab461dmr12105018wmq.73.1670089764860; Sat, 03 Dec 2022 09:49:24 -0800 (PST) Received: from localhost ([92.44.145.54]) by smtp.gmail.com with ESMTPSA id b6-20020a5d6346000000b00242442c8ebdsm5074373wrw.111.2022.12.03.09.49.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Dec 2022 09:49:24 -0800 (PST) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Bionic v2 8/8] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Sat, 3 Dec 2022 20:48:43 +0300 Message-Id: <20221203174842.543278-9-cengiz.can@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221203174842.543278-1-cengiz.can@canonical.com> References: <20221203174842.543278-1-cengiz.can@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 Reviewed-by: Tedd Ho-Jeong An CVE-2022-42896 (cherry picked from commit f937b758a188d6fd328a81367087eddbb2fce50f) Signed-off-by: Cengiz Can --- 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 cb3d81cd4d36..144e14e954db 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1900,7 +1900,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;