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

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