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

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