From 47298232c8b6f35b227049b74660593b8b84807a Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 16 Jun 2026 11:16:54 +0200 Subject: [PATCH] Update to 5.87 pre-release snapshot Resolves: RHEL-169989 --- ...dp-connect-source-profile-after-sink.patch | 35 -------- ...ed-to-set-default-system-config-star.patch | 47 ----------- ...Work-around-possible-string-overflow.patch | 39 +++++++++ ...ell-Free-memory-allocated-by-wordexp.patch | 18 ++--- ...tools-btmgmt-Fix-btmgmt-help-hanging.patch | 32 -------- big-endian-5.86.patch | 41 ---------- bluetoothctl-no-output.patch | 79 ------------------- bluez.spec | 29 ++++--- sources | 2 +- 9 files changed, 65 insertions(+), 257 deletions(-) delete mode 100644 0001-a2dp-connect-source-profile-after-sink.patch delete mode 100644 0001-adapter-Fix-Failed-to-set-default-system-config-star.patch create mode 100644 0001-hci-tester-Work-around-possible-string-overflow.patch delete mode 100644 0001-tools-btmgmt-Fix-btmgmt-help-hanging.patch delete mode 100644 big-endian-5.86.patch delete mode 100644 bluetoothctl-no-output.patch diff --git a/0001-a2dp-connect-source-profile-after-sink.patch b/0001-a2dp-connect-source-profile-after-sink.patch deleted file mode 100644 index 26a8986..0000000 --- a/0001-a2dp-connect-source-profile-after-sink.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 066a164a524e4983b850f5659b921cb42f84a0e0 Mon Sep 17 00:00:00 2001 -From: Pauli Virtanen -Date: Mon, 16 Feb 2026 18:17:08 +0200 -Subject: [PATCH] a2dp: connect source profile after sink - -Since cdcd845f87ee the order in which profiles with the same priority -are connected is the same order as btd_profile_register() is called, -instead of being the opposite order. When initiating connections, we -want to prefer a2dp-sink profile over a2dp-source, as connecting both at -the same time does not work currently. - -Add .after_services to specify the order. - -Fixes: https://github.com/bluez/bluez/issues/1898 ---- - profiles/audio/a2dp.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c -index 7a37003a2b25..c7e0fc75c09e 100644 ---- a/profiles/audio/a2dp.c -+++ b/profiles/audio/a2dp.c -@@ -3769,6 +3769,9 @@ static struct btd_profile a2dp_source_profile = { - - .adapter_probe = a2dp_sink_server_probe, - .adapter_remove = a2dp_sink_server_remove, -+ -+ /* Connect source after sink, to prefer sink when conflicting */ -+ .after_services = BTD_PROFILE_UUID_CB(NULL, A2DP_SINK_UUID), - }; - - static struct btd_profile a2dp_sink_profile = { --- -2.53.0 - diff --git a/0001-adapter-Fix-Failed-to-set-default-system-config-star.patch b/0001-adapter-Fix-Failed-to-set-default-system-config-star.patch deleted file mode 100644 index 138b06a..0000000 --- a/0001-adapter-Fix-Failed-to-set-default-system-config-star.patch +++ /dev/null @@ -1,47 +0,0 @@ -From b9a72fef5cd51f849ce01c9f2775d129a687d855 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Thu, 19 Mar 2026 11:52:06 +0100 -Subject: [PATCH] adapter: Fix "Failed to set default system config" startup - warning - -When using a stock configuration, there will be nothing in the list of -configuration changes to apply to the Bluetooth adapter, which since -5e5b46c5c0cc ("adapter: Do not send empty default system parameter -list") would throw an error, as sending an empty list to the adapter -didn't generate one. - -bluetoothd[3291147]: Bluetooth daemon 5.86 -bluetoothd[3291147]: Starting SDP server -bluetoothd[3291147]: Using external plugins is not officially supported. -bluetoothd[3291147]: Consider upstreaming your plugins into the BlueZ project. -bluetoothd[3291147]: Bluetooth management interface 1.23 initialized -bluetoothd[3291147]: Battery Provider Manager created -bluetoothd[3291147]: Failed to set default system config for hci0 - -Fixes: 5e5b46c5c0cc ("adapter: Do not send empty default system parameter list") -Signed-off-by: Luiz Augusto von Dentz ---- - src/adapter.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/src/adapter.c b/src/adapter.c -index 4e5ff219fe8b..04568dae6e98 100644 ---- a/src/adapter.c -+++ b/src/adapter.c -@@ -4963,8 +4963,11 @@ static void load_defaults(struct btd_adapter *adapter) - if (!load_le_defaults(adapter, list, &btd_opts.defaults.le)) - goto done; - -- if (mgmt_tlv_list_size(list) == 0) -- goto done; -+ /* No changes from defaults */ -+ if (mgmt_tlv_list_size(list) == 0) { -+ mgmt_tlv_list_free(list); -+ return; -+ } - - err = mgmt_send_tlv(adapter->mgmt, MGMT_OP_SET_DEF_SYSTEM_CONFIG, - adapter->dev_id, list, NULL, NULL, NULL); --- -2.53.0 - diff --git a/0001-hci-tester-Work-around-possible-string-overflow.patch b/0001-hci-tester-Work-around-possible-string-overflow.patch new file mode 100644 index 0000000..2470b9a --- /dev/null +++ b/0001-hci-tester-Work-around-possible-string-overflow.patch @@ -0,0 +1,39 @@ +From 8440635a802cc4a8f529f9b1f6933a5fad2aa8d4 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 16 Jun 2026 10:52:58 +0200 +Subject: [PATCH] hci-tester: Work-around possible string overflow + +Quiet overflow warning by checking for a non-NULL destination. + +In function 'memcpy', + inlined from 'test_pre_setup_lt_address' at tools/hci-tester.c:67:2: +/usr/include/bits/string_fortified.h:29:10: warning: '__builtin_memcpy' writing 6 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] + 29 | return __builtin___memcpy_chk (__dest, __src, __len, + | ^ +--- + tools/hci-tester.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/hci-tester.c b/tools/hci-tester.c +index b8446ee83ccf..c9e7c58d2e95 100644 +--- a/tools/hci-tester.c ++++ b/tools/hci-tester.c +@@ -12,6 +12,7 @@ + #include + #endif + ++#include + #include + #include + +@@ -57,6 +58,7 @@ static void test_pre_setup_lt_address(const void *data, uint8_t size, + struct user_data *user = tester_get_data(); + const struct bt_hci_rsp_read_bd_addr *rsp = data; + ++ assert(user); + if (rsp->status) { + tester_warn("Read lower tester address failed (0x%02x)", + rsp->status); +-- +2.54.0 + diff --git a/0001-shared-shell-Free-memory-allocated-by-wordexp.patch b/0001-shared-shell-Free-memory-allocated-by-wordexp.patch index 0aa7e2f..6aa3ff1 100644 --- a/0001-shared-shell-Free-memory-allocated-by-wordexp.patch +++ b/0001-shared-shell-Free-memory-allocated-by-wordexp.patch @@ -1,4 +1,4 @@ -From 1b8a2d85a42a8e08e0c3c0c6ad8ed01c65a71524 Mon Sep 17 00:00:00 2001 +From c37533e10be6d692c99601fd28a289bf40bcf148 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 2 Jul 2024 15:27:12 +0200 Subject: [PATCH] shared/shell: Free memory allocated by wordexp() @@ -61,10 +61,10 @@ bluez-5.76/src/shared/shell.c:1423:4: leaked_storage: Variable "w" going out of 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/shared/shell.c b/src/shared/shell.c -index ea285c72631d..b4add90322b5 100644 +index 2b8d1a45c9b8..5f3b04788896 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c -@@ -504,13 +504,23 @@ static void shell_print_menu_zsh_complete(void) +@@ -496,13 +496,23 @@ static void shell_print_menu_zsh_complete(void) } } @@ -89,15 +89,15 @@ index ea285c72631d..b4add90322b5 100644 free(str); return -EINVAL; } -@@ -532,6 +542,7 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry, - char *man, *opt; +@@ -525,6 +535,7 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry, + const char *man2, *opt2; int flags = WRDE_NOCMD; bool optargs = false; + size_t saved_wordc = 0; if (argc == 2 && (!memcmp(argv[1], "help", 4) || !memcmp(argv[1], "--help", 6))) { -@@ -589,8 +600,10 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry, +@@ -582,8 +593,10 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry, goto fail; } @@ -109,7 +109,7 @@ index ea285c72631d..b4add90322b5 100644 optional: if (parse_args(opt, &w, "[]", flags) < 0) { -@@ -603,6 +616,7 @@ optional: +@@ -596,6 +609,7 @@ optional: free(opt); /* Check if there are too many arguments */ @@ -117,7 +117,7 @@ index ea285c72631d..b4add90322b5 100644 if (!optargs && ((unsigned int) argc - 1 > w.we_wordc && !w.we_offs)) { print_text(COLOR_HIGHLIGHT, "Too many arguments: %d > %zu", argc - 1, w.we_wordc); -@@ -1102,7 +1116,7 @@ static char **args_completion(const struct bt_shell_menu_entry *entry, int argc, +@@ -1096,7 +1110,7 @@ static char **args_completion(const struct bt_shell_menu_entry *entry, int argc, args.we_offs = 0; wordfree(&args); @@ -154,5 +154,5 @@ index ea285c72631d..b4add90322b5 100644 break; }; -- -2.52.0 +2.54.0 diff --git a/0001-tools-btmgmt-Fix-btmgmt-help-hanging.patch b/0001-tools-btmgmt-Fix-btmgmt-help-hanging.patch deleted file mode 100644 index 17071f0..0000000 --- a/0001-tools-btmgmt-Fix-btmgmt-help-hanging.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 37f62e78dc3925625c7aaa083dcc410d9bac4940 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Wed, 11 Mar 2026 11:48:45 +0100 -Subject: [PATCH] tools/btmgmt: Fix btmgmt --help hanging - -btmgmt when run interactively would wait for commands on its prompt, but -that prompt is never setup when the help output is requested. - -Handle --help through bt_shell_handle_non_interactive_help() so that the -application exits as soon as the help content has been printed, like -other interactive apps in bluez. ---- - tools/btmgmt.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/tools/btmgmt.c b/tools/btmgmt.c -index 0f3de2880014..762a3a141c4a 100644 ---- a/tools/btmgmt.c -+++ b/tools/btmgmt.c -@@ -47,6 +47,9 @@ int main(int argc, char *argv[]) - bt_shell_init(argc, argv, &opt); - - mgmt_add_submenu(); -+ -+ bt_shell_handle_non_interactive_help(); -+ - mgmt_set_index(index_option); - bt_shell_attach(fileno(stdin)); - status = bt_shell_run(); --- -2.53.0 - diff --git a/big-endian-5.86.patch b/big-endian-5.86.patch deleted file mode 100644 index a0f83e4..0000000 --- a/big-endian-5.86.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3a5c4d311755910f07e60fd30d4736ac98bea8eb Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 10 Feb 2026 10:06:28 +0100 -Subject: [PATCH] emulator: Fix compilation on big endian systems -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the build on big endian systems like s390x: - -Remove the "static" so the array doesn't need to be initialised -with constants. - -emulator/bthost.c: In function ‘bthost_setup_sco’: -./src/shared/util.h:43:26: error: initializer element is not constant - 43 | #define cpu_to_le32(val) bswap_32(val) - | ^~~~~~~~ -etc. - -Fixes: 85888a8357ea ("bthost: add bthost_setup_sco() and accept -incoming eSCO") ---- - emulator/bthost.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/emulator/bthost.c b/emulator/bthost.c -index d09ad1e76c50..53b12f828675 100644 ---- a/emulator/bthost.c -+++ b/emulator/bthost.c -@@ -3560,7 +3560,7 @@ void bthost_hci_disconnect(struct bthost *bthost, uint16_t handle, - int bthost_setup_sco(struct bthost *bthost, uint16_t acl_handle, - uint16_t setting) - { -- static const struct bt_hci_cmd_setup_sync_conn settings[] = { -+ const struct bt_hci_cmd_setup_sync_conn settings[] = { - { - .tx_bandwidth = cpu_to_le32(0x00001f40), - .rx_bandwidth = cpu_to_le32(0x00001f40), --- -2.52.0 - diff --git a/bluetoothctl-no-output.patch b/bluetoothctl-no-output.patch deleted file mode 100644 index 11a184b..0000000 --- a/bluetoothctl-no-output.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 33dd33a23ff250902eafa94fce5ea8178de50112 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Fri, 27 Feb 2026 12:07:14 +0100 -Subject: [PATCH 1/2] Revert "shared/shell: Don't init input for - non-interactive shells" - -This reverts commit e73bf582dae60356641a32fc27ae03d359ec4c47. - -The fix caused "bluetoothctl list" to not output any text, breaking -a lot of existing scripts. - -Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2440346 ---- - src/shared/shell.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/shared/shell.c b/src/shared/shell.c -index 78d58c513d3e..b061f8001414 100644 ---- a/src/shared/shell.c -+++ b/src/shared/shell.c -@@ -1642,13 +1642,13 @@ static bool shell_quit(void *data) - - bool bt_shell_attach(int fd) - { -- if (data.mode == MODE_INTERACTIVE) { -- struct input *input; -+ struct input *input; - -- input = input_new(fd); -- if (!input) -- return false; -+ input = input_new(fd); -+ if (!input) -+ return false; - -+ if (data.mode == MODE_INTERACTIVE) { - io_set_read_handler(input->io, input_read, input, NULL); - io_set_disconnect_handler(input->io, input_hup, input, NULL); - --- -2.53.0 - - -From 0178bc8bda31cf60837fcce91b33e009bc3f7d7d Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Fri, 27 Feb 2026 12:24:13 +0100 -Subject: [PATCH 2/2] tools: Work-around broken stdin handling in home-made - mainloop - -bluetoothd has 3 mainloop implementations, one relying on ell, one -relying on glib, and another home-made. - -The home-made mainloop handler use epoll() without any fallbacks, and -will hang if one tries to epoll() an stdin that redirects from -/dev/null. - -Closes: https://github.com/bluez/bluez/issues/700 ---- - Makefile.tools | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile.tools b/Makefile.tools -index 589f7c94f9df..7c52e053ffee 100644 ---- a/Makefile.tools -+++ b/Makefile.tools -@@ -531,8 +531,8 @@ tools_obexctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ - - tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c \ - client/mgmt.c --tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ -- -lreadline -+tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-glib.la \ -+ $(GLIB_LIBS) -lreadline - if DEPRECATED - noinst_PROGRAMS += attrib/gatttool - --- -2.53.0 - diff --git a/bluez.spec b/bluez.spec index 3d2723e..d3d1481 100644 --- a/bluez.spec +++ b/bluez.spec @@ -4,9 +4,15 @@ %bcond_with deprecated %endif +# Snapshot generated with: +# export SHA=`git rev-parse --short HEAD` ; export VERSION=5.86 ; git archive --format=tar.xz -o bluez-$VERSION+1.git$SHA.tar.xz --prefix=bluez-$VERSION+1.git$SHA/ HEAD +# as a post-release snapshot, see: +# https://fedoraproject.org/wiki/PackagingDrafts/TildeVersioning +%global gitsha 220f102c8db9 + Name: bluez -Version: 5.86 -Release: 2%{?dist} +Version: 5.86+1.git%{gitsha} +Release: 1%{?dist} Summary: Bluetooth utilities License: GPL-2.0-or-later URL: http://www.bluez.org/ @@ -21,16 +27,8 @@ Patch2: 0001-shared-shell-Free-memory-allocated-by-wordexp.patch Patch3: static-analysis-issues-6.patch # Coverity downstream patches Patch4: coverity-workarounds.patch -# https://patchwork.kernel.org/project/bluetooth/list/?series=1052631 -Patch5: big-endian-5.86.patch -# https://patchwork.kernel.org/project/bluetooth/patch/ba0e71b91a24557f088b015a349c6ccee6260ec2.1771258477.git.pav@iki.fi/ -Patch6: 0001-a2dp-connect-source-profile-after-sink.patch -# https://patchwork.kernel.org/project/bluetooth/list/?series=1058931 -Patch7: bluetoothctl-no-output.patch -# https://patchwork.kernel.org/project/bluetooth/patch/20260311111540.2170373-2-hadess@hadess.net/ -Patch8: 0001-tools-btmgmt-Fix-btmgmt-help-hanging.patch -# https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=b9a72fef5cd51f849ce01c9f2775d129a687d855 -Patch9: 0001-adapter-Fix-Failed-to-set-default-system-config-star.patch +# https://patchwork.kernel.org/project/bluetooth/patch/20260616085538.3568474-1-hadess@hadess.net/ +Patch5: 0001-hci-tester-Work-around-possible-string-overflow.patch BuildRequires: dbus-devel >= 1.6 BuildRequires: glib2-devel @@ -188,7 +186,7 @@ install -m0755 tools/avinfo $RPM_BUILD_ROOT%{_bindir} # some issues and to set the MAC address on HCIs which don't have their # MAC address configured install -m0755 tools/btmgmt $RPM_BUILD_ROOT%{_bindir} -install -m0644 doc/btmgmt.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +rst2man doc/btmgmt.rst --no-datestamp --no-generator $RPM_BUILD_ROOT%{_mandir}/man1/btmgmt.1 # Remove libtool archive find $RPM_BUILD_ROOT -name '*.la' -delete @@ -315,6 +313,7 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/ %{_mandir}/man1/l2ping.1.* %{_mandir}/man1/rctest.1.* %{_mandir}/man5/org.bluez.*.5.* +%{_mandir}/man7/btsnoop.7.* %{_mandir}/man7/hci.7.* %{_mandir}/man7/iso.7.* %{_mandir}/man7/l2cap.7.* @@ -354,6 +353,10 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/ %{_userunitdir}/obex.service %changelog +* Thu Jul 02 2026 Bastien Nocera - 5.86+1.git220f102c8db9-1 +- Update to 5.87 pre-release snapshot + Resolves: RHEL-169989 + * Fri Mar 27 2026 Bastien Nocera - 5.86-2 - Fix startup warning Resolves: RHEL-155826 diff --git a/sources b/sources index 1eafce8..34a41c4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bluez-5.86.tar.xz) = d3268be43ad869dabd9d9eabc7a0da699837bb5432ecf61e1756e03f9b867a1d989299db1493bd349d73b495d736f55d7518fbb9ee664de49e5d1cf7c2156df7 +SHA512 (bluez-5.86+1.git220f102c8db9.tar.xz) = 7385d7b41f19a3cdbc3b51bdf47dabad0dc78d63a67b247e78ab4717e7c34fddc46ef535a3df4062a212cecc95ae5d0cb82db999b0d60747cf54113cb3f1b81f