diff mbox series

[BlueZ,1/2] HOGP must only accept data from bonded devices.

Message ID 20200310023516.209146-2-alainm@chromium.org
State New
Headers show
Series [BlueZ,1/2] HOGP must only accept data from bonded devices. | expand

Commit Message

Alain Michaud March 10, 2020, 2:35 a.m. UTC
HOGP 1.0 Section 6.1 establishes that the HOGP must require bonding.

Reference:
https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00352.htm
---

 profiles/input/hog.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 83c017dcb..dfac68921 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -186,6 +186,10 @@  static int hog_accept(struct btd_service *service)
 			return -EINVAL;
 	}
 
+	/* HOGP 1.0 Section 6.1 requires bonding */
+	if (!device_is_bonded(device, btd_device_get_bdaddr_type(device)))
+		return -ECONNREFUSED;
+
 	/* TODO: Replace GAttrib with bt_gatt_client */
 	bt_hog_attach(dev->hog, attrib);