From patchwork Fri Dec 2 18:19:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cengiz Can X-Patchwork-Id: 1711665 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=aPRDlO9S; 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 4NPLn72Mm0z23yf for ; Sat, 3 Dec 2022 18:20:25 +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 1p1Moj-0004QX-Lv; Sat, 03 Dec 2022 07:20:09 +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 1p1AdV-0004Yz-48 for kernel-team@lists.ubuntu.com; Fri, 02 Dec 2022 18:19:45 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (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 E50D142259 for ; Fri, 2 Dec 2022 18:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1670005183; bh=y3jXFj59bwwKbVzDsxVAbcNgDutb6zGGK+JODswsHJc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aPRDlO9SQlgF4etHxa2PZcmp5LdpBmoWFzUzRAkNc8j5hB1CKIVaJdIrzV7UtA/Ir HNDKUaAu0rLAzS08x5MIF5/6j93kp8enbAQ+jAoY/Fj1nv6fu1/0tkUx9n5DgoMYgN nafd+trOAVUjPMA2iyrzqRCJASFNFtn3WI8t/a0sjtdVljBcOy7+5/0E/JwzeE5HrX K9BkzwGYZCjn93Mp0/L0IaDABnh88bBs9Qpysjr+EwCv1S4vA0JUibSVvnmQXSgDS6 z6XbrT9IJje6PKM1G6jmkYNBLXd8bz5fX06VcfLrafEP4qlrfA2tV2Z28UESHwfvor 9BAd5sAKIDqJw== Received: by mail-wm1-f70.google.com with SMTP id v125-20020a1cac83000000b003cfa148576dso2866717wme.3 for ; Fri, 02 Dec 2022 10:19:43 -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=y3jXFj59bwwKbVzDsxVAbcNgDutb6zGGK+JODswsHJc=; b=WneKnuPQ/77v1qbsXzrKU7VNAqKnVCJDSTL27VYKQ6JiccZWmCxr7wXdmN8kP3IqzO CRCliyOvqI1LHAZCRNBrC8NLce7Oe2LdFLw4ZVOZR3s7KSmKD86arVYQXwakJdDTKVun /CwznplBPkUfL5M4rvxu+TXnkbXAnxDOnjVOVc7jWCXQxpQRF8lHao9w9H5fNBDiU7HI KWprBWtuzf4hMFPLSry9rLwI6nLECfF3Qlf8nLETmKc/a2pISIUGZgkQtSbxwUH9poXJ 1yHMctyOw3m3nQmti3/pfxvc4Je0tEDtJbXLJryRMIe45DsS8GhBTTxRC6gHFsdeJZxF 20LQ== X-Gm-Message-State: ANoB5pkA5HC6yUTNX6YM7ZBCuVek5YSUFCp2keoqs3fKrbhrkgIoBtQL z/RFMTxSTI68BIzv/uYW9tqpGIyRwIPQSC0cCY+kLg4kwvfqPoaq+H83CzbmHPNThA8Z6XfDP3z snhEB+gQaWeFfx6YiFgZpxWJdFQ00L4R+i/d3RWD76Q== X-Received: by 2002:a5d:51ce:0:b0:236:78cd:f3e7 with SMTP id n14-20020a5d51ce000000b0023678cdf3e7mr42777100wrv.140.1670005183386; Fri, 02 Dec 2022 10:19:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7yc44cnpOxFP+MCSOhodmEEURBjpB2GSvt2G9seO6aSpTij68Gok0h2eK6vgjmolHz1Pt07A== X-Received: by 2002:a5d:51ce:0:b0:236:78cd:f3e7 with SMTP id n14-20020a5d51ce000000b0023678cdf3e7mr42777093wrv.140.1670005183175; Fri, 02 Dec 2022 10:19:43 -0800 (PST) Received: from localhost ([92.44.145.54]) by smtp.gmail.com with ESMTPSA id fn7-20020a05600c688700b003c6b70a4d69sm9010785wmb.42.2022.12.02.10.19.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 10:19:42 -0800 (PST) From: Cengiz Can To: kernel-team@lists.ubuntu.com Subject: [SRU Focal 2/2] Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm Date: Fri, 2 Dec 2022 21:19:24 +0300 Message-Id: <20221202181922.406993-3-cengiz.can@canonical.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221202181922.406993-1-cengiz.can@canonical.com> References: <20221202181922.406993-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 6f32f728b978..92dcc5742b54 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1833,7 +1833,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;