From patchwork Sat Dec 3 18:40:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1711738 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=f2ZoP8tf; 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 4NPdvp0f3xz23n4 for ; Sun, 4 Dec 2022 05:42:14 +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 1p1XSj-0003Nu-15; Sat, 03 Dec 2022 18:42:09 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1p1XSh-0003Ln-1E for kernel-team@lists.ubuntu.com; Sat, 03 Dec 2022 18:42:07 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (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-1.canonical.com (Postfix) with ESMTPS id D10E13F32E for ; Sat, 3 Dec 2022 18:42:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1670092926; bh=D72F1EGy1wkvUu3c3CYmSIOxxTVrH7my5Bda4ZKMgE4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f2ZoP8tfxmJfdEr6nbJ46JdUoKW3LbkPMYvIu+H2swvg8oYWgV8Hex3Nf0l5HAO3E kql8rI02KvjsiGFJEWIky5TEuVy2X03C3e1bV25jMHSidhj6EuEryP8WAgNahMY+N6 CibG02szX6mKHXykaGO0WTwmx4BqwaI6izdTwcPFLEBLBfa1LIdzdRfCGiNfUQi11F n9pPv+x3+OKcyNVb9ahmOsEXR+VXbW3lcRbR80OzCkfpoB89oX4kPZeWs9ZJws/X3g 4smXE+Q1Whk3OAHbTXliJb3eusDiwA0ARvE+YSK8jfdpf2NS7UxlLSqDYmUa78gMMz vsOOALfGKBa+Q== Received: by mail-wm1-f72.google.com with SMTP id bg25-20020a05600c3c9900b003cf3ed7e27bso4277858wmb.4 for ; Sat, 03 Dec 2022 10:42:06 -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=D72F1EGy1wkvUu3c3CYmSIOxxTVrH7my5Bda4ZKMgE4=; b=0SIAYuDvjoCJurx7umeLWiTMoTmXCDTgPwoQy/+f3cEgSoBWQE7vNWmwa9NHTH82dF 9YaogNPb5aQ6q9Ri0dvBK4XzGe1vC0drtItYencfKuZBAHft28SnhpFjHYtnckIDi/80 fsakppI1GWu4CqsOkQDMSZqX/ZCqyT7wrvPKAWXvGbESWsvurizFVNeTPUpvlMdbZ4lj zgv9ivcNgr9pvKymb69JxVeyESsY3s1JyDc1ctPHb66+jQqi2XPtmoME893YPNdiuYbo QWT9+Es5HOYDi7krcDC94HIkvnEf255k+HHK9RUt8YHrQxc2x190O0EdmCUkLT/trbAX lMig== X-Gm-Message-State: ANoB5pnxUAK9n6EPyiHdaOFzOjIzI/vnPaBuU8COPVNyfPQH0nmYesf8 4/lLBra0cgX2YeO6XQJmXO+i+aH23R5kOvlTw2Hvyvy2FAlq4sqEbnPBcfqtY4dbgdZxqklJM7s WDDM+aTE+EwQQ2m96FgO3J4wnI7JEUcPn+Iu1A8wRqQ== X-Received: by 2002:a05:600c:a3a2:b0:3cf:7267:5b40 with SMTP id hn34-20020a05600ca3a200b003cf72675b40mr55970285wmb.164.1670092926250; Sat, 03 Dec 2022 10:42:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Ln4oUx6ncWtd0bTp3A1gilJoZDGH+7xhnsLLj+VVmzSGgoMsrtB75EtNdDx2ceA3nFUqETg== X-Received: by 2002:a05:600c:a3a2:b0:3cf:7267:5b40 with SMTP id hn34-20020a05600ca3a200b003cf72675b40mr55970279wmb.164.1670092926004; Sat, 03 Dec 2022 10:42:06 -0800 (PST) Received: from localhost ([92.44.145.54]) by smtp.gmail.com with ESMTPSA id c2-20020a05600c0a4200b003cfd4cf0761sm17503214wmq.1.2022.12.03.10.42.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Dec 2022 10:42:05 -0800 (PST) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Focal v2 4/4] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Sat, 3 Dec 2022 21:40:51 +0300 Message-Id: <20221203184046.554244-5-cengiz.can@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221203184046.554244-1-cengiz.can@canonical.com> References: <20221203184046.554244-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 052f1360aec3..76ca7efff25e 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1908,7 +1908,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;