summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/bluez5/bluez5
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2023-12-18 22:47:18 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-20 07:47:00 +0000
commit0656a5d89df70562900be7030e3b97885875020f (patch)
tree9daed525b41d0b613abe0a818e059d0ddcd248c1 /meta/recipes-connectivity/bluez5/bluez5
parenta1f912e4d8de292d77374d3ad28378284a954937 (diff)
downloadpoky-0656a5d89df70562900be7030e3b97885875020f.tar.gz
bluez5: upgrade 5.70 -> 5.71
(From OE-Core rev: cb1b191fa4a275dab1f7f66a0e60563696c6d64d) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/bluez5/bluez5')
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch2
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch6
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0002-input-Fix-.device_probe-failing-if-SDP-record-is-not.patch313
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0004-src-shared-util.c-include-linux-limits.h.patch7
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch56
5 files changed, 8 insertions, 376 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
index 06ebf1cde6..3546c7c305 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
@@ -1,4 +1,4 @@
1From 7dcc5f46a31ac4eaa67c0ab3aaae38005db7458f Mon Sep 17 00:00:00 2001 1From e8808a2f5e17d375411c7409eaffb17e72f65022 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <Mingli.Yu@windriver.com> 2From: Mingli Yu <Mingli.Yu@windriver.com>
3Date: Fri, 24 Aug 2018 12:04:03 +0800 3Date: Fri, 24 Aug 2018 12:04:03 +0800
4Subject: [PATCH] test-gatt: Fix hung issue 4Subject: [PATCH] test-gatt: Fix hung issue
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
index 7c47cc1a1e..be05093551 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -1,4 +1,4 @@
1From a657fddd13a2e756b0af315301f1c44081e2f668 Mon Sep 17 00:00:00 2001 1From 3724958858b0ee430f37fb83388c3737d2039a3a Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 1 Apr 2016 17:07:34 +0300 3Date: Fri, 1 Apr 2016 17:07:34 +0300
4Subject: [PATCH] tests: add a target for building tests without running them 4Subject: [PATCH] tests: add a target for building tests without running them
@@ -11,10 +11,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11 1 file changed, 3 insertions(+) 11 1 file changed, 3 insertions(+)
12 12
13diff --git a/Makefile.am b/Makefile.am 13diff --git a/Makefile.am b/Makefile.am
14index 7041f8e..25966cd 100644 14index e7221bd..9595fd1 100644
15--- a/Makefile.am 15--- a/Makefile.am
16+++ b/Makefile.am 16+++ b/Makefile.am
17@@ -594,6 +594,9 @@ endif 17@@ -710,6 +710,9 @@ endif
18 TESTS = $(unit_tests) 18 TESTS = $(unit_tests)
19 AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 19 AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
20 20
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0002-input-Fix-.device_probe-failing-if-SDP-record-is-not.patch b/meta/recipes-connectivity/bluez5/bluez5/0002-input-Fix-.device_probe-failing-if-SDP-record-is-not.patch
deleted file mode 100644
index d0884338db..0000000000
--- a/meta/recipes-connectivity/bluez5/bluez5/0002-input-Fix-.device_probe-failing-if-SDP-record-is-not.patch
+++ /dev/null
@@ -1,313 +0,0 @@
1From 3a9c637010f8dc1ba3e8382abe01065761d4f5bb Mon Sep 17 00:00:00 2001
2From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
3Date: Tue, 10 Oct 2023 12:38:29 -0700
4Subject: [PATCH 02/40] input: Fix .device_probe failing if SDP record is not
5 found
6
7Due to changes introduced by 67a26abe53bf
8("profile: Add probe_on_discover flag") profiles may get probed when
9their profile UUID are discovered, rather than resolved, which means
10the SDP record may not be available.
11
12Fixes: https://github.com/bluez/bluez/issues/614
13
14Upstream-Status: Backport [https://github.com/bluez/bluez/commit/3a9c637010f8dc1ba3e8382abe01065761d4f5bb]
15---
16 profiles/input/device.c | 182 +++++++++++++++++++---------------------
17 1 file changed, 84 insertions(+), 98 deletions(-)
18
19diff --git a/profiles/input/device.c b/profiles/input/device.c
20index e2ac6ea60..4a50ea992 100644
21--- a/profiles/input/device.c
22+++ b/profiles/input/device.c
23@@ -60,7 +60,7 @@ struct input_device {
24 char *path;
25 bdaddr_t src;
26 bdaddr_t dst;
27- uint32_t handle;
28+ const sdp_record_t *rec;
29 GIOChannel *ctrl_io;
30 GIOChannel *intr_io;
31 guint ctrl_watch;
32@@ -754,7 +754,8 @@ static void epox_endian_quirk(unsigned char *data, int size)
33 }
34 }
35
36-static int create_hid_dev_name(sdp_record_t *rec, struct hidp_connadd_req *req)
37+static int create_hid_dev_name(const sdp_record_t *rec,
38+ struct hidp_connadd_req *req)
39 {
40 char sdesc[sizeof(req->name) / 2];
41
42@@ -776,7 +777,7 @@ static int create_hid_dev_name(sdp_record_t *rec, struct hidp_connadd_req *req)
43
44 /* See HID profile specification v1.0, "7.11.6 HIDDescriptorList" for details
45 * on the attribute format. */
46-static int extract_hid_desc_data(sdp_record_t *rec,
47+static int extract_hid_desc_data(const sdp_record_t *rec,
48 struct hidp_connadd_req *req)
49 {
50 sdp_data_t *d;
51@@ -817,36 +818,40 @@ invalid_desc:
52 return -EINVAL;
53 }
54
55-static int extract_hid_record(sdp_record_t *rec, struct hidp_connadd_req *req)
56+static int extract_hid_record(struct input_device *idev,
57+ struct hidp_connadd_req *req)
58 {
59 sdp_data_t *pdlist;
60 uint8_t attr_val;
61 int err;
62
63- err = create_hid_dev_name(rec, req);
64+ if (!idev->rec)
65+ return -ENOENT;
66+
67+ err = create_hid_dev_name(idev->rec, req);
68 if (err < 0)
69 DBG("No valid Service Name or Service Description found");
70
71- pdlist = sdp_data_get(rec, SDP_ATTR_HID_PARSER_VERSION);
72+ pdlist = sdp_data_get(idev->rec, SDP_ATTR_HID_PARSER_VERSION);
73 req->parser = pdlist ? pdlist->val.uint16 : 0x0100;
74
75- pdlist = sdp_data_get(rec, SDP_ATTR_HID_DEVICE_SUBCLASS);
76+ pdlist = sdp_data_get(idev->rec, SDP_ATTR_HID_DEVICE_SUBCLASS);
77 req->subclass = pdlist ? pdlist->val.uint8 : 0;
78
79- pdlist = sdp_data_get(rec, SDP_ATTR_HID_COUNTRY_CODE);
80+ pdlist = sdp_data_get(idev->rec, SDP_ATTR_HID_COUNTRY_CODE);
81 req->country = pdlist ? pdlist->val.uint8 : 0;
82
83- pdlist = sdp_data_get(rec, SDP_ATTR_HID_VIRTUAL_CABLE);
84+ pdlist = sdp_data_get(idev->rec, SDP_ATTR_HID_VIRTUAL_CABLE);
85 attr_val = pdlist ? pdlist->val.uint8 : 0;
86 if (attr_val)
87 req->flags |= (1 << HIDP_VIRTUAL_CABLE_UNPLUG);
88
89- pdlist = sdp_data_get(rec, SDP_ATTR_HID_BOOT_DEVICE);
90+ pdlist = sdp_data_get(idev->rec, SDP_ATTR_HID_BOOT_DEVICE);
91 attr_val = pdlist ? pdlist->val.uint8 : 0;
92 if (attr_val)
93 req->flags |= (1 << HIDP_BOOT_PROTOCOL_MODE);
94
95- err = extract_hid_desc_data(rec, req);
96+ err = extract_hid_desc_data(idev->rec, req);
97 if (err < 0)
98 return err;
99
100@@ -1035,11 +1040,6 @@ static gboolean encrypt_notify(GIOChannel *io, GIOCondition condition,
101 static int hidp_add_connection(struct input_device *idev)
102 {
103 struct hidp_connadd_req *req;
104- sdp_record_t *rec;
105- char src_addr[18], dst_addr[18];
106- char filename[PATH_MAX];
107- GKeyFile *key_file;
108- char handle[11], *str;
109 GError *gerr = NULL;
110 int err;
111
112@@ -1049,33 +1049,7 @@ static int hidp_add_connection(struct input_device *idev)
113 req->flags = 0;
114 req->idle_to = idle_timeout;
115
116- ba2str(&idev->src, src_addr);
117- ba2str(&idev->dst, dst_addr);
118-
119- snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", src_addr,
120- dst_addr);
121- sprintf(handle, "0x%8.8X", idev->handle);
122-
123- key_file = g_key_file_new();
124- if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) {
125- error("Unable to load key file from %s: (%s)", filename,
126- gerr->message);
127- g_clear_error(&gerr);
128- }
129- str = g_key_file_get_string(key_file, "ServiceRecords", handle, NULL);
130- g_key_file_free(key_file);
131-
132- if (!str) {
133- error("Rejected connection from unknown device %s", dst_addr);
134- err = -EPERM;
135- goto cleanup;
136- }
137-
138- rec = record_from_string(str);
139- g_free(str);
140-
141- err = extract_hid_record(rec, req);
142- sdp_record_free(rec);
143+ err = extract_hid_record(idev, req);
144 if (err < 0) {
145 error("Could not parse HID SDP record: %s (%d)", strerror(-err),
146 -err);
147@@ -1091,7 +1065,7 @@ static int hidp_add_connection(struct input_device *idev)
148
149 /* Make sure the device is bonded if required */
150 if (classic_bonded_only && !input_device_bonded(idev)) {
151- error("Rejected connection from !bonded device %s", dst_addr);
152+ error("Rejected connection from !bonded device %s", idev->path);
153 goto cleanup;
154 }
155
156@@ -1161,6 +1135,68 @@ static int connection_disconnect(struct input_device *idev, uint32_t flags)
157 return ioctl_disconnect(idev, flags);
158 }
159
160+static bool is_device_sdp_disable(const sdp_record_t *rec)
161+{
162+ sdp_data_t *data;
163+
164+ data = sdp_data_get(rec, SDP_ATTR_HID_SDP_DISABLE);
165+
166+ return data && data->val.uint8;
167+}
168+
169+static enum reconnect_mode_t hid_reconnection_mode(bool reconnect_initiate,
170+ bool normally_connectable)
171+{
172+ if (!reconnect_initiate && !normally_connectable)
173+ return RECONNECT_NONE;
174+ else if (!reconnect_initiate && normally_connectable)
175+ return RECONNECT_HOST;
176+ else if (reconnect_initiate && !normally_connectable)
177+ return RECONNECT_DEVICE;
178+ else /* (reconnect_initiate && normally_connectable) */
179+ return RECONNECT_ANY;
180+}
181+
182+static void extract_hid_props(struct input_device *idev,
183+ const sdp_record_t *rec)
184+{
185+ /* Extract HID connectability */
186+ bool reconnect_initiate, normally_connectable;
187+ sdp_data_t *pdlist;
188+
189+ /* HIDNormallyConnectable is optional and assumed FALSE if not
190+ * present.
191+ */
192+ pdlist = sdp_data_get(rec, SDP_ATTR_HID_RECONNECT_INITIATE);
193+ reconnect_initiate = pdlist ? pdlist->val.uint8 : TRUE;
194+
195+ pdlist = sdp_data_get(rec, SDP_ATTR_HID_NORMALLY_CONNECTABLE);
196+ normally_connectable = pdlist ? pdlist->val.uint8 : FALSE;
197+
198+ /* Update local values */
199+ idev->reconnect_mode =
200+ hid_reconnection_mode(reconnect_initiate, normally_connectable);
201+}
202+
203+static void input_device_update_rec(struct input_device *idev)
204+{
205+ struct btd_profile *p = btd_service_get_profile(idev->service);
206+ const sdp_record_t *rec;
207+
208+ rec = btd_device_get_record(idev->device, p->remote_uuid);
209+ if (!rec || idev->rec == rec)
210+ return;
211+
212+ idev->rec = rec;
213+ idev->disable_sdp = is_device_sdp_disable(rec);
214+
215+ /* Initialize device properties */
216+ extract_hid_props(idev, rec);
217+
218+ if (idev->disable_sdp)
219+ device_set_refresh_discovery(idev->device, false);
220+}
221+
222 static int input_device_connected(struct input_device *idev)
223 {
224 int err;
225@@ -1168,6 +1204,9 @@ static int input_device_connected(struct input_device *idev)
226 if (idev->intr_io == NULL || idev->ctrl_io == NULL)
227 return -ENOTCONN;
228
229+ /* Attempt to update SDP record if it had changed */
230+ input_device_update_rec(idev);
231+
232 err = hidp_add_connection(idev);
233 if (err < 0)
234 return err;
235@@ -1411,74 +1450,21 @@ int input_device_disconnect(struct btd_service *service)
236 return 0;
237 }
238
239-static bool is_device_sdp_disable(const sdp_record_t *rec)
240-{
241- sdp_data_t *data;
242-
243- data = sdp_data_get(rec, SDP_ATTR_HID_SDP_DISABLE);
244-
245- return data && data->val.uint8;
246-}
247-
248-static enum reconnect_mode_t hid_reconnection_mode(bool reconnect_initiate,
249- bool normally_connectable)
250-{
251- if (!reconnect_initiate && !normally_connectable)
252- return RECONNECT_NONE;
253- else if (!reconnect_initiate && normally_connectable)
254- return RECONNECT_HOST;
255- else if (reconnect_initiate && !normally_connectable)
256- return RECONNECT_DEVICE;
257- else /* (reconnect_initiate && normally_connectable) */
258- return RECONNECT_ANY;
259-}
260-
261-static void extract_hid_props(struct input_device *idev,
262- const sdp_record_t *rec)
263-{
264- /* Extract HID connectability */
265- bool reconnect_initiate, normally_connectable;
266- sdp_data_t *pdlist;
267-
268- /* HIDNormallyConnectable is optional and assumed FALSE
269- * if not present. */
270- pdlist = sdp_data_get(rec, SDP_ATTR_HID_RECONNECT_INITIATE);
271- reconnect_initiate = pdlist ? pdlist->val.uint8 : TRUE;
272-
273- pdlist = sdp_data_get(rec, SDP_ATTR_HID_NORMALLY_CONNECTABLE);
274- normally_connectable = pdlist ? pdlist->val.uint8 : FALSE;
275-
276- /* Update local values */
277- idev->reconnect_mode =
278- hid_reconnection_mode(reconnect_initiate, normally_connectable);
279-}
280-
281 static struct input_device *input_device_new(struct btd_service *service)
282 {
283 struct btd_device *device = btd_service_get_device(service);
284- struct btd_profile *p = btd_service_get_profile(service);
285 const char *path = device_get_path(device);
286- const sdp_record_t *rec = btd_device_get_record(device, p->remote_uuid);
287 struct btd_adapter *adapter = device_get_adapter(device);
288 struct input_device *idev;
289
290- if (!rec)
291- return NULL;
292-
293 idev = g_new0(struct input_device, 1);
294 bacpy(&idev->src, btd_adapter_get_address(adapter));
295 bacpy(&idev->dst, device_get_address(device));
296 idev->service = btd_service_ref(service);
297 idev->device = btd_device_ref(device);
298 idev->path = g_strdup(path);
299- idev->handle = rec->handle;
300- idev->disable_sdp = is_device_sdp_disable(rec);
301-
302- /* Initialize device properties */
303- extract_hid_props(idev, rec);
304
305- if (idev->disable_sdp)
306- device_set_refresh_discovery(device, false);
307+ input_device_update_rec(idev);
308
309 return idev;
310 }
311--
3122.42.0
313
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0004-src-shared-util.c-include-linux-limits.h.patch b/meta/recipes-connectivity/bluez5/bluez5/0004-src-shared-util.c-include-linux-limits.h.patch
index f954f6dab2..6ef135327d 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/0004-src-shared-util.c-include-linux-limits.h.patch
+++ b/meta/recipes-connectivity/bluez5/bluez5/0004-src-shared-util.c-include-linux-limits.h.patch
@@ -1,4 +1,4 @@
1From 51584158b9a2e58f3790f8a7387b5cf167eca88b Mon Sep 17 00:00:00 2001 1From ad069fadfcce2cf70f45b1c4a42665448675297e Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de> 2From: Alexander Kanavin <alex@linutronix.de>
3Date: Mon, 12 Dec 2022 13:10:19 +0100 3Date: Mon, 12 Dec 2022 13:10:19 +0100
4Subject: [PATCH] src/shared/util.c: include linux/limits.h 4Subject: [PATCH] src/shared/util.c: include linux/limits.h
@@ -8,15 +8,16 @@ systems such as those using musl.
8 8
9Upstream-Status: Submitted [to linux-bluetooth@vger.kernel.org,luiz.von.dentz@intel.com,frederic.danis@collabora.com] 9Upstream-Status: Submitted [to linux-bluetooth@vger.kernel.org,luiz.von.dentz@intel.com,frederic.danis@collabora.com]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de> 10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11
11--- 12---
12 src/shared/util.c | 1 + 13 src/shared/util.c | 1 +
13 1 file changed, 1 insertion(+) 14 1 file changed, 1 insertion(+)
14 15
15diff --git a/src/shared/util.c b/src/shared/util.c 16diff --git a/src/shared/util.c b/src/shared/util.c
16index 0a0308c..1f61314 100644 17index 34491f4..412f3ad 100644
17--- a/src/shared/util.c 18--- a/src/shared/util.c
18+++ b/src/shared/util.c 19+++ b/src/shared/util.c
19@@ -22,6 +22,7 @@ 20@@ -23,6 +23,7 @@
20 #include <unistd.h> 21 #include <unistd.h>
21 #include <dirent.h> 22 #include <dirent.h>
22 #include <limits.h> 23 #include <limits.h>
diff --git a/meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch b/meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch
deleted file mode 100644
index 5bb31d866a..0000000000
--- a/meta/recipes-connectivity/bluez5/bluez5/CVE-2023-45866.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1From 25a471a83e02e1effb15d5a488b3f0085eaeb675 Mon Sep 17 00:00:00 2001
2From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
3Date: Tue, 10 Oct 2023 13:03:12 -0700
4Subject: [PATCH] input.conf: Change default of ClassicBondedOnly
5
6This changes the default of ClassicBondedOnly since defaulting to false
7is not inline with HID specification which mandates the of Security Mode
84:
9
10BLUETOOTH SPECIFICATION Page 84 of 123
11Human Interface Device (HID) Profile:
12
13 5.4.3.4.2 Security Modes
14 Bluetooth HID Hosts shall use Security Mode 4 when interoperating with
15 Bluetooth HID devices that are compliant to the Bluetooth Core
16 Specification v2.1+EDR[6].
17
18Upstream-Status: Backport
19[https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input?id=25a471a83e02e1effb15d5a488b3f0085eaeb675]
20
21CVE: CVE-2023-45866
22
23Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
24---
25 profiles/input/device.c | 2 +-
26 profiles/input/input.conf | 2 +-
27 2 files changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/profiles/input/device.c b/profiles/input/device.c
30index 4a50ea9..4310dd1 100644
31--- a/profiles/input/device.c
32+++ b/profiles/input/device.c
33@@ -81,7 +81,7 @@ struct input_device {
34
35 static int idle_timeout = 0;
36 static bool uhid_enabled = false;
37-static bool classic_bonded_only = false;
38+static bool classic_bonded_only = true;
39
40 void input_set_idle_timeout(int timeout)
41 {
42diff --git a/profiles/input/input.conf b/profiles/input/input.conf
43index 4c70bc5..d8645f3 100644
44--- a/profiles/input/input.conf
45+++ b/profiles/input/input.conf
46@@ -17,7 +17,7 @@
47 # platforms may want to make sure that input connections only come from bonded
48 # device connections. Several older mice have been known for not supporting
49 # pairing/encryption.
50-# Defaults to false to maximize device compatibility.
51+# Defaults to true for security.
52 #ClassicBondedOnly=true
53
54 # LE upgrade security
55--
562.40.0