Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp891403ybh; Tue, 10 Mar 2020 10:12:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtO1WCkioVrPAdruUGpYCYO+m4dBEwOyO8bZ8CAc5ae82JsbF1LCEGBlp06jT7qzMqXj2Yi X-Received: by 2002:aca:af93:: with SMTP id y141mr1866576oie.144.1583860376171; Tue, 10 Mar 2020 10:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583860376; cv=none; d=google.com; s=arc-20160816; b=bCsZeigXxA1ju9uyqOEwco+iOxlufsVhjGCBbWbB6yphnbhqplkm+no9m3v55aSlz6 oTY0NdHhdLUjUypXDfY88Rg3atd+z5bZNj6kvapzpt4tQH5C9nCPwZwS8GL2JY2xQCkI 6h0ihA0HlSi8fRjApDRFR1XCv0Td7lCSWzHcOTFQer8s4iLyPk8iqLz1pYuWINAzTDZF A2/eZa/Do2f69ZmyphLlFewz3Fpy2QM4OXej5N1sqGeCrnRqTwWPSLrU/N8haJHyvaSv T2glI+e6YS/MsptAqqa560DijF4+q9ceT2KY0jYu4792Qj7pDFMa+3vhKUr9cop3kb/K 0dxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VNTMuhLCvkDG+9h02ML+SwAIQ60m2wuHbvBXRAYffIs=; b=s1g5Acv4ccHdAJxDgTlkILN5JmBu3eOOrDUBXKW1VKkfuWfTcLbJ0GyJsMVMImmTGv mNnuryrW4lT496OxqVeH97Q1bKaxjQRFoMid2y34KxdYw4Hnr6a2w89mNZ9mbz16XNCx FpEidd7josJ4UW2IMaCtJAzrpQXJX1XxNxOUZ3Q3lj3E2k0zcEVzrGlTvy+OvIFWXYei GsjQHwL5ezF9afy0E5hEZWg696j9MtMh+6nRtTytajqM6FBF6H/drXEO7vQ7gN/+AlE9 bdwwO23M8swja1yaHErDVLqLCbbB+yUuB+CDCg0x+PDav6zlXOuSTBFndlvVyDjNy7WO 6mBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mGYq5V+w; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v142si530053oie.217.2020.03.10.10.12.41; Tue, 10 Mar 2020 10:12:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mGYq5V+w; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 S1726437AbgCJRM3 (ORCPT + 99 others); Tue, 10 Mar 2020 13:12:29 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:34494 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgCJRM3 (ORCPT ); Tue, 10 Mar 2020 13:12:29 -0400 Received: by mail-oi1-f196.google.com with SMTP id g6so14669646oiy.1 for ; Tue, 10 Mar 2020 10:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VNTMuhLCvkDG+9h02ML+SwAIQ60m2wuHbvBXRAYffIs=; b=mGYq5V+wF2Poqrw/Xv0dsQ82xtrZp2zyNvLh0Pd4vXouoeClLjWIGhlWJH9rrmXosa oKrZHLwNGaGzXxWjITDkUJAKV/1YRuWoTrYwgeKncn87YkfH2H9KXl6M7MMwW+F9diwW Nlt13EOck/XTYcseG6VXL01yYJ41X9TEZDNgZ54erRlOCg9a77dbgmu37MTrmvF0kCqc doKHjStL0e6eZZfBgMrFUk7dNUFmoHYj8hB7LvVU54cPY2kMfC/23+QABwxwi+Eu+U3Y 8Oyh1EiX3YBJuyYjWfNNf6N9BGS00ADQ8apBpIfnQSteZv5gZL8zl1QVkRBmhRihUiyA 43IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VNTMuhLCvkDG+9h02ML+SwAIQ60m2wuHbvBXRAYffIs=; b=ZmFw8Q716Xuu3CieNyHtLUAYIWL9s8cRxqwwsii8a2EZwc7G8k8GtpJ8MtLNZ85GeE xrkcb5Ng0xz6JiXFEooGYnbVhKiq6NU9BxKCMLv8hm33VYgQw/YVJB/Bb1RQYYxyyJ6X rOiRB7AV32ccJLFBYyJTzCizwN1UDlYzW0ABiaQN0acKKlRqaJgdh6GvpLDoVzW8fLZl YHMpeztA+8lgcmVeECwDjcsXc8pI+NsdjVT93R2m/tdMK/KJHDcq1e0GXVd3+YFQ11Bl tVjWXz+D/oG/tgHTKDJnsggauUCtXi9tOM8Nacl3SkY73EoEhN6K0NaOPhxIah83Jc7/ L3+A== X-Gm-Message-State: ANhLgQ1zmeFW0Xh9bPkeZjZx3d6QtUpkFONefAOsB42AJXJm8KYyiFIQ H7/C4At1i5Ilgf4kA35XFgyXuh4pTkBwv5RHOvBE5ne2 X-Received: by 2002:a05:6808:10b:: with SMTP id b11mr1939724oie.110.1583860347761; Tue, 10 Mar 2020 10:12:27 -0700 (PDT) MIME-Version: 1.0 References: <20200310023516.209146-1-alainm@chromium.org> <87A4E633-63CF-4C71-9BF6-916894790EED@holtmann.org> In-Reply-To: From: Luiz Augusto von Dentz Date: Tue, 10 Mar 2020 10:12:15 -0700 Message-ID: Subject: Re: [BlueZ PATCH 0/2] HID and HOGP connections from non-bonded devices. To: Alain Michaud Cc: Marcel Holtmann , Alain Michaud , Bluez mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, On Tue, Mar 10, 2020 at 5:30 AM Alain Michaud wrote: > > Hi Luiz, > > On Tue, Mar 10, 2020 at 2:27 AM Luiz Augusto von Dentz > wrote: > > > > Hi Marcel, > > > > On Mon, Mar 9, 2020 at 10:26 PM Marcel Holtmann wrote: > > > > > > Hi Alain, > > > > > > > It was discovered that BlueZ's HID and HOGP profiles implementations > > > > don't specifically require bonding between the device and the host. > > > > > > > > This creates an opportunity for an malicious device to connect to a > > > > target host to either impersonate an existing HID device without > > > > security or to cause an SDP or GATT service discovery to take place > > > > which would allow HID reports to be injected to the input subsystem from > > > > a non-bonded source. > > > > > > > > This patch series addresses the issue by ensuring that only connections > > > > from devices that are bonded are accepted by the HID and HOGP profile > > > > implementation. > > > > > > > > More information about the vulnerability is available here: > > > > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.html > > > > > > > > Alain Michaud (2): > > > > HOGP must only accept data from bonded devices. > > > > HID accepts bonded device connections only. > > > > > > > > profiles/input/device.c | 23 ++++++++++++++++++++++- > > > > profiles/input/device.h | 1 + > > > > profiles/input/hog.c | 4 ++++ > > > > profiles/input/input.conf | 8 ++++++++ > > > > profiles/input/manager.c | 13 ++++++++++++- > > > > 5 files changed, 47 insertions(+), 2 deletions(-) > > > > > > both patches have been applied. > > > > > > However I changed BrBondedOnly configuration name into ClassicBondedOnly since that name seemed more obvious to me. The prefix Br has never been used and the Bluetooth SIG started calling it Classic a while back. > > > > Looks like you were quicker than me, anyway I do fill like we should > > attempt to bump to security instead of just refuse to connection in > > case of HoG since we are the central and the peripheral is not > > mandated to started it either it may be just the client application is > > attempting to connect to trigger pairing on demand, that would usually > > kick latter when reading the characteristics but with this changes it > > doesn't even get to that point if the devices was not bonded already. > The specification for HoG is that the device is bonded. If client or > server attempts to access the service before it is bonded, it would > violate the specification. For this reason, I believe it is both > safer and simpler to just reject any attempts to access the service > without first being bonded. Ive sent a patch for it, we would not be accessing anything while the security is being bump as the kernel would block that, so in practice this would just initiate the pairing procedure if the device is not bonded . -- Luiz Augusto von Dentz