Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp773764rdb; Sun, 1 Oct 2023 05:11:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1RgHt5IlbKe3Wx///j/BvWq114QihBEoWreAUaJRozFGrBAwVZEvMrr0DCUs6jOuJzeF9 X-Received: by 2002:a17:902:c946:b0:1c5:c546:fece with SMTP id i6-20020a170902c94600b001c5c546fecemr14717754pla.34.1696162275972; Sun, 01 Oct 2023 05:11:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696162275; cv=pass; d=google.com; s=arc-20160816; b=TypzoJxcZU/4Os1Mkc1Pa8tWx3CQpO227KH45+WHIC5bSyIIxRa8m3tm5G8cCkw9IL 10jBAXtwDM00jaTDR1Veh1n+L20YPI6APyjAEFJsUHoxyqIIWAAUHQ2PuiDgWPf4+CKU vBWX3Gd4YzlMKU2IgFpCVAlej+X4sji4QGyYnNuBymqObeYTcr2vJtcQv5JXP+4R5l8c M0kAi2XRTgxOdcJoyf8lml5V3vUadWwycPZeNVC4zm6i1K6RdlEDiOz2AVPR/C0H0WBr 2ANBtGQmcGPvNK4Ln/hSgtzEUZqCEi2tCHkMbwRfHvJZgrKeypvochn++Xq/6Ws0ctVk 4ZaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:content-disposition :message-id:subject:cc:to:from:date:dkim-signature; bh=usDYAF7/Uio4et+c3RkYZX2RrThASPQaEumJNzznkQ0=; fh=YoKn3rNui1Uy12poG2FqwVn8fhiNCgV4MVj74J55Nj8=; b=BBVuiFHAIl7ewSR9PFNmm+dyt8KwRRkQ788Q6j5Fr/zJd5hAfuhWaibDxB78Lug3RP DDhMJrMABHdOapfNBCnt5U2Z2B21EL+8QUdr/4oEz51oBT86p/Cvlq/zuqhqYNdktcQW ZLKRpFypg1++13I47D6S4OJEpVezO0KewZretUesx4C3iYIItDk9A4jCovpQ4b3aPdzI AZG+f7asGhfRoyAajWQW9QgRd1JCBJrGPxlgj6SB1XSCyy8BNW1cXW6gdrGCC7lhiPXy f+TdnWBcFVTB11WIl70x7nc1c3CQGd482Morjub+pgki9tfOFrLi8W2U6OzCYw1Eac75 Nepg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=rAbAkF8y; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d6-20020a170903230600b001b8c4168e20si19812391plh.58.2023.10.01.05.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 05:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=rAbAkF8y; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 34AA4802D50F; Sun, 1 Oct 2023 01:08:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234425AbjJAIDk (ORCPT + 99 others); Sun, 1 Oct 2023 04:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234371AbjJAIDj (ORCPT ); Sun, 1 Oct 2023 04:03:39 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CACCC2; Sun, 1 Oct 2023 01:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IS6eLRFz8VGE4r7OyVwTYCYmb2R7ojOJwkHSdkRgTxNzQmBHR9gs/U4Zwufum1C541PCqgPbsjXN6ut0F3PjdJaqPSFpKFsRJGqcdyzC397UuVYsg/WEyG3UV47gti4yS9pFAax4pXR5Vri7IeXuyFZNnkiTSfNkPSlF6ec/5qhYQsjgzAlLDWCRh2vqNT6/du0y7ZzoIoUgf7rJSRAAVeu8C5zJzaff9GPMfqqV1T7OC05CH5kkpdFL26Lyj2kMngpj31vkyXuKDAdtdtXFlci/Evr7x240czPH8W4Ga3GGuVj2YS5vENpBjZCrzHgeeWuFI8OOxhX3si1C5cjUaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=usDYAF7/Uio4et+c3RkYZX2RrThASPQaEumJNzznkQ0=; b=KMTvDIdyF8L6LvaeAO94jWCD+iA/EOYLWE+DxeuY1zuNUyUDEF7/C4pf6BVLffc7JnsvXnChgeXa5gylAWcG6U9zX9AI+cQiqAHRC+272OeXNpqUljmdXyOxXPK/4Uf8kUKqoRNx5KK4fFKbe1cfQZsPJREMpGteR4Kh8AJmPw9Pt2gYZFQOX0mnerFGEZpdkT7zRJDXN7phNwDDNkreE4FNsepOSEo6LNhMqK6FjvhvkaPS6FsqC0WFh1GS2U5giaBZkswdNx2/kGz2J9j8R4evQnacQEY/s1dVmZMr/ryLep8Jb/cJbqKuMKLMY+XocFo+eTuySSP27/wofJEPwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=usDYAF7/Uio4et+c3RkYZX2RrThASPQaEumJNzznkQ0=; b=rAbAkF8yHBDYGBGyxeDCcW+HzqG5i0SGR2Ti6cm3tDhgj6iJrPP6ZbHM3mRLF0V4i8qSvCXn5NUjVG5X0KFazNnr69mOFLl89FJOKyaVtbrKRi5nAmIoa59/75OM/qz71IRwgvZVdIePh1IMMgMqHq393A3nJqedV8kEjxw7b1OFB8toVaVG3DTJPjfPYvMbc6u6ZKqJFHxIFV6E4mpSzvFQNBfyQHlet55y5RK7c/PRn6N+FkBsUSVPIdBk60rybrUjG2XN192ImRPxD0aD8Ar4SzzZyCynrtG/Aa2VjjK0QCYqhhtSNDrr+/RoSWxaVw4Lc6L84LZTw4TbyESsbA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DB8PR04MB7164.eurprd04.prod.outlook.com (2603:10a6:10:129::23) by PA4PR04MB7725.eurprd04.prod.outlook.com (2603:10a6:102:f1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Sun, 1 Oct 2023 08:03:34 +0000 Received: from DB8PR04MB7164.eurprd04.prod.outlook.com ([fe80::8647:4673:b19:acc2]) by DB8PR04MB7164.eurprd04.prod.outlook.com ([fe80::8647:4673:b19:acc2%4]) with mapi id 15.20.6813.027; Sun, 1 Oct 2023 08:03:34 +0000 Date: Sun, 1 Oct 2023 16:03:28 +0800 From: "Lee, Chun-Yi" To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org Subject: [PATCH 0/2] Bluetooth: ignore NULL link key and reject connection with the device which has same BD_ADDR Message-ID: <20231001080328.GA14494@linux-691t> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-ClientProxiedBy: FR2P281CA0087.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::6) To DB8PR04MB7164.eurprd04.prod.outlook.com (2603:10a6:10:129::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8PR04MB7164:EE_|PA4PR04MB7725:EE_ X-MS-Office365-Filtering-Correlation-Id: 0830b3c6-7df8-4bd7-19e6-08dbc254e8e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vO4duyr9wFfT+QcWR4xL8mRquBBB6hw4xqdI3HGgGId8FyxmxvqCfkWftl+wC4RSgNfW2hJPos6e4DLdihgfGaWvaKx0is48cEC8i0Rps2VHPwHzzneDBQs84vzRf0+osdHO1IzuKc6Z6m5xtY3JrSu2is2Ht6K3FXBQLxrtBfHPxGMuQRZjITHmcqicpmZqBqLC1MMreycWwjXMwyPeTzwZE8bcNXmQtsDOa1qXbmIWgv1jDKHUVJ8RcUZ5wci02CgKOiDb7JKybOIWvmeuaYryQxzOAR+INUXXGQ7JTdSdQUrBJ2vC0YZLnfN6ZsXFnnLGo9cAXqWk20Dms8Giy2rEkn6XEGVgcPIA+oWxUgearW0YuGEGV2gt//B4rCC45QWg5DqM6ACecTqeCfuF6C5aZd+i9ZuzPEgYCKBtdEneTODLHqs/yD93P7HqrnEfpnvu8HMjRrcA2CstwnLZyp6mgnjq4g3/rgs4VT3DbS3cMXKbIRo4XKb8FuDG9evM6U9c1W6mEfKzxl570w4ew3VUpWVjKrytssujWMMArXQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR04MB7164.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(396003)(346002)(39860400002)(136003)(366004)(376002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(41300700001)(316002)(26005)(4326008)(2906002)(8936002)(5660300002)(66556008)(8676002)(110136005)(478600001)(966005)(66946007)(66476007)(6486002)(6666004)(6506007)(6512007)(9686003)(1076003)(33716001)(38100700002)(83380400001)(33656002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?r5jwUXqTTPbPG+8OmLfA0fM+6+REJfXLk2wPNmudqLCRG9Ii2cuq9rI7iKkp?= =?us-ascii?Q?cU53Sg+yoByyy3sXdAWQXTORd3JKUa5JS0f4ReHo2FjyFAHXIbMx1GA9eTmC?= =?us-ascii?Q?IsBJdgrNHKpO1TIhivHhLndSTDuRhdqmt3Ab5frhYwdkg9qeRqZwo5cbOg3w?= =?us-ascii?Q?dRDps2wxzF9HDqsJJ2OZETwYJ0nqiANhRelWxGAJvagxUiD5aCg1KzBgOYo7?= =?us-ascii?Q?ZFS5YY5QMLwAKH2ZZ8y8WvCGVlfQCJ7fGguKtmcKuQBbSItmI8uyNvPa5Mu7?= =?us-ascii?Q?cwEEZ/kHRPf1RtRTeaAcVd9dbdAjNWTyOcgi3oYiT6wPU0dCMJlUUiezwJID?= =?us-ascii?Q?Tq6KYFAJDWePETivVL4cKti5+DsbGEHnu1usj7ddVglDSa86itCZ2bxuXUo3?= =?us-ascii?Q?3V6XijPPMx/G10K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=?us-ascii?Q?HdvDQ3RdF+qRZyQDUcNE4GB/Ciegs5BV5Gfdqn/u/Dw3Dp3B5Ggv+WW30F4U?= =?us-ascii?Q?tmEhlGu30nSEfSoEibEIe6vDtKw7CnQ0XL+czcFLFgAeN2aAH0wVyWyWSsqx?= =?us-ascii?Q?t0iZP1wtoZbWvOOZz6I7Kv8shw1dWHuFhy/UEgOncmnazX1Rbb2T2THDss6q?= =?us-ascii?Q?CdagQKOGARWUfDJ2buUrSwL++W80WlkRJjx07q6/nPMhV60LrlEFLqjiuXdG?= =?us-ascii?Q?uyo3vM5ecp2DdZCRwd+PMW8qdnIvTxAudw9LmM+g?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0830b3c6-7df8-4bd7-19e6-08dbc254e8e2 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB7164.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2023 08:03:34.4454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jIsmlvFyB/PXdPpK0y8bfSUbsSau2T92moLoFMFHOktBYjwIvi7QpQeL22k40gFo X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7725 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 01 Oct 2023 01:08:55 -0700 (PDT) This patch set is used to relieve CVE-2020-26555. The description of the CVE: Bluetooth legacy BR/EDR PIN code pairing in Bluetooth Core Specification 1.0B through 5.2 may permit an unauthenticated nearby device to spoof the BD_ADDR of the peer device to complete pairing without knowledge of the PIN. [1] The detail of this attack is in IEEE paper: BlueMirror: Reflections on Bluetooth Pairing and Provisioning Protocols [2] It's a reflection attack. The paper mentioned that attacker can induce the attacked target to generate null link key (zero key) without PIN code. In BR/EDR, the key generation is actually handled in the controller which is below HCI. Thus, we can ignore null link key in the handler of "Link Key Notification event" to relieve the attack. And, a condition of this attack is that attacker should change the BR_ADDR of his hacking device (Host B) to equal to the BR_ADDR with the target device being attacked (Host A). So we reject the connection with device which has same BD_ADDR both on HCI_Create_Connection and HCI_Connection_Request to prevent the attack. Similar implementations also show in btstack project. [3][4][5] Link: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26555 [1] Link: https://ieeexplore.ieee.org/abstract/document/9474325/authors#authors [2] Link: https://github.com/bluekitchen/btstack/blob/master/src/hci.c#L3722 [3] Link: https://github.com/bluekitchen/btstack/blob/master/src/hci.c#L3523 [4] Link: https://github.com/bluekitchen/btstack/blob/master/src/hci.c#L7297 [5] Lee, Chun-Yi (2): Bluetooth: hci_event: Ignore NULL link key Bluetooth: Reject connection with the device which has same BD_ADDR net/bluetooth/hci_conn.c | 7 +++++++ net/bluetooth/hci_event.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) -- 2.35.3