Blame SOURCES/0001-HOGP-must-only-accept-data-from-bonded-devices.patch

dd1e8a
From 89fb68570e72a854f10d50bec99112d294597483 Mon Sep 17 00:00:00 2001
dd1e8a
From: Gopal Tiwari <gtiwari@redhat.com>
dd1e8a
Date: Fri, 24 Apr 2020 16:06:37 +0530
dd1e8a
Subject: [PATCH BlueZ 1/2]     HOGP must only accept data from bonded devices.
dd1e8a
dd1e8a
commit 8cdbd3b09f29da29374e2f83369df24228da0ad1
dd1e8a
Author: Alain Michaud <alainm@chromium.org>
dd1e8a
Date:   Tue Mar 10 02:35:16 2020 +0000
dd1e8a
dd1e8a
    HOGP must only accept data from bonded devices.
dd1e8a
dd1e8a
    HOGP 1.0 Section 6.1 establishes that the HOGP must require bonding.
dd1e8a
dd1e8a
    Reference:
dd1e8a
    https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.htm
dd1e8a
---
dd1e8a
 profiles/input/hog.c | 4 ++++
dd1e8a
 1 file changed, 4 insertions(+)
dd1e8a
dd1e8a
diff --git a/profiles/input/hog.c b/profiles/input/hog.c
dd1e8a
index 23c9c1529..f8a82bc20 100644
dd1e8a
--- a/profiles/input/hog.c
dd1e8a
+++ b/profiles/input/hog.c
dd1e8a
@@ -186,6 +186,10 @@ static int hog_accept(struct btd_service *service)
dd1e8a
 			return -EINVAL;
dd1e8a
 	}
dd1e8a
 
dd1e8a
+	/* HOGP 1.0 Section 6.1 requires bonding */
dd1e8a
+	if (!device_is_bonded(device, btd_device_get_bdaddr_type(device)))
dd1e8a
+		return -ECONNREFUSED;
dd1e8a
+
dd1e8a
 	/* TODO: Replace GAttrib with bt_gatt_client */
dd1e8a
 	bt_hog_attach(dev->hog, attrib);
dd1e8a
 
dd1e8a
-- 
dd1e8a
2.21.1
dd1e8a