From 9c1ae6f3cb39813e7097275ea858c020f7df5f57 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 2 Nov 2021 03:50:41 -0400 Subject: [PATCH] import bluez-5.52-5.el8_4 --- ...t-to-set-security-level-if-not-bonde.patch | 55 +++++++++++++++++++ SPECS/bluez.spec | 7 ++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-input-hog-Attempt-to-set-security-level-if-not-bonde.patch diff --git a/SOURCES/0001-input-hog-Attempt-to-set-security-level-if-not-bonde.patch b/SOURCES/0001-input-hog-Attempt-to-set-security-level-if-not-bonde.patch new file mode 100644 index 0000000..491ce5a --- /dev/null +++ b/SOURCES/0001-input-hog-Attempt-to-set-security-level-if-not-bonde.patch @@ -0,0 +1,55 @@ +From 1e083c2cd7c0284cf9dd389359a27aa6d354538c Mon Sep 17 00:00:00 2001 +From: Gopal Tiwari +Date: Wed, 26 May 2021 11:31:04 +0530 +Subject: [PATCH BlueZ 1/2] input: hog: Attempt to set security level if not + bonded + +commit 35d8d895cd0b724e58129374beb0bb4a2edf9519 +Author: Luiz Augusto von Dentz +Date: Tue Mar 10 09:59:07 2020 -0700 + + input: hog: Attempt to set security level if not bonded + + This attempts to set the security if the device is not bonded, the + kernel will block any communication on the ATT socket while bumping + the security and if that fails the device will be disconnected which + is better than having the device dangling around without being able to + communicate with it until it is properly bonded. +--- + profiles/input/hog.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/profiles/input/hog.c b/profiles/input/hog.c +index dfac68921..f0226ebbd 100644 +--- a/profiles/input/hog.c ++++ b/profiles/input/hog.c +@@ -49,6 +49,8 @@ + #include "src/shared/util.h" + #include "src/shared/uhid.h" + #include "src/shared/queue.h" ++#include "src/shared/att.h" ++#include "src/shared/gatt-client.h" + #include "src/plugin.h" + + #include "suspend.h" +@@ -187,8 +189,15 @@ static int hog_accept(struct btd_service *service) + } + + /* HOGP 1.0 Section 6.1 requires bonding */ +- if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) +- return -ECONNREFUSED; ++ if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) { ++ struct bt_gatt_client *client; ++ ++ client = btd_device_get_gatt_client(device); ++ if (!bt_gatt_client_set_security(client, ++ BT_ATT_SECURITY_MEDIUM)) { ++ return -ECONNREFUSED; ++ } ++ } + + /* TODO: Replace GAttrib with bt_gatt_client */ + bt_hog_attach(dev->hog, attrib); +-- +2.26.2 + diff --git a/SPECS/bluez.spec b/SPECS/bluez.spec index dee1387..c22ecaa 100644 --- a/SPECS/bluez.spec +++ b/SPECS/bluez.spec @@ -1,7 +1,7 @@ Name: bluez Summary: Bluetooth utilities Version: 5.52 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ URL: http://www.bluez.org/ @@ -39,6 +39,7 @@ Patch24: 0001-adapter-Don-t-refresh-adv_manager-for-non-LE-devices.patch Patch27: 0001-HOGP-must-only-accept-data-from-bonded-devices.patch Patch28: 0002-HID-accepts-bonded-device-connections-only.patch Patch29: 0001-shared-att-Fix-possible-crash-on-disconnect.patch +Patch30: 0001-input-hog-Attempt-to-set-security-level-if-not-bonde.patch BuildRequires: git-core BuildRequires: dbus-devel >= 1.6 @@ -276,6 +277,10 @@ make check %changelog +* Thu Jul 1 2021 Gopal Tiwari - 5.52-5 ++ bluez-5.52-5 +- Fixing (#1972918) + * Thu Oct 22 2020 Gopal Tiwari - 5.52-4 + bluez-5.52-4 - Fixing (#1885378)