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

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