diff --git a/packages/network/bluez/package.mk b/packages/network/bluez/package.mk index a738d5e17a..0500388360 100644 --- a/packages/network/bluez/package.mk +++ b/packages/network/bluez/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) PKG_NAME="bluez" -PKG_VERSION="5.72" +PKG_VERSION="5.75" PKG_LICENSE="GPL" PKG_SITE="http://www.bluez.org/" PKG_URL="https://www.kernel.org/pub/linux/bluetooth/${PKG_NAME}-${PKG_VERSION}.tar.xz" @@ -91,6 +91,6 @@ EOF post_install() { enable_service bluetooth-defaults.service - #enable_service bluetooth.service - #enable_service obex.service + enable_service bluetooth.service + enable_service obex.service } diff --git a/packages/network/bluez/patches/bluez-06-AVRCP_TG_MDI_BV-04-C.patch b/packages/network/bluez/patches/bluez-06-AVRCP_TG_MDI_BV-04-C.patch deleted file mode 100644 index 38478f0539..0000000000 --- a/packages/network/bluez/patches/bluez-06-AVRCP_TG_MDI_BV-04-C.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ru bluez-5.66.orig/profiles/audio/avrcp.c bluez-5.66/profiles/audio/avrcp.c ---- bluez-5.66.orig/profiles/audio/avrcp.c 2022-03-16 08:06:20.000000000 -0700 -+++ bluez-5.66/profiles/audio/avrcp.c 2023-07-30 08:03:17.414213611 -0700 -@@ -1210,6 +1210,10 @@ - GUINT_TO_POINTER(str_to_metadata(key))); - } - -+ if (attrs == NULL) -+ return g_list_prepend(NULL, -+ GUINT_TO_POINTER(AVRCP_MEDIA_ATTRIBUTE_TITLE)); -+ - return attrs; - } - -Only in bluez-5.66/profiles/audio: avrcp.c.orig diff --git a/packages/network/bluez/patches/bluez-07-trust-sixaxis.patch b/packages/network/bluez/patches/bluez-07-trust-sixaxis.patch new file mode 100644 index 0000000000..b63fd12978 --- /dev/null +++ b/packages/network/bluez/patches/bluez-07-trust-sixaxis.patch @@ -0,0 +1,14 @@ +diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c.new +index 544ab399ad..b68b0f46fb 100644 +--- a/plugins/sixaxis.c ++++ b/plugins/sixaxis.c.new +@@ -350,7 +350,8 @@ static bool setup_device(int fd, const char *sysfs_path, + + btd_device_device_set_name(device, cp->name); + btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version); +- btd_device_set_temporary(device, true); ++ btd_device_set_temporary(device, false); ++ btd_device_set_trusted(device, true); + + closure = g_new0(struct authentication_closure, 1); + if (!closure) { diff --git a/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch b/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch index e1fe3ef66f..bb7e84e1dc 100644 --- a/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch +++ b/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch @@ -9,34 +9,31 @@ Date: 2015-06-15 18:28:26 GMT (36 weeks, 4 days, 21 hours and 32 minutes ago) Navigation Controller is using PID 0x042f over USB but PID 0x0268 (same as Dualshock 3) over BT. --- - plugins/sixaxis.c | 8 +++++++- + plugins/sixaxis.c | 5 +++++ profiles/input/sixaxis.h | 2 ++ - 2 files changed, 9 insertions(+), 1 deletion(-) + 2 files changed, 7 insertions(+) diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c -index 939fed7..f6baea7 100644 +index 1653491..6330001 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c -@@ -364,7 +364,13 @@ static bool setup_device(int fd, const char *sysfs_path, - info("sixaxis: setting up new device"); +@@ -350,6 +350,11 @@ static bool setup_device(int fd, const char *sysfs_path, btd_device_device_set_name(device, cp->name); -- btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version); -+ + btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version); + /* if device reports different pid/vid on BT prefer those over USB */ + if (cp->bt_pid) + btd_device_set_pnpid(device, cp->source, cp->vid, cp->bt_pid, cp->version); + else + btd_device_set_pnpid(device, cp->source, cp->vid, cp->pid, cp->version); -+ - btd_device_set_temporary(device, true); + btd_device_set_temporary(device, false); + btd_device_set_trusted(device, true); - closure = g_new0(struct authentication_closure, 1); diff --git a/profiles/input/sixaxis.h b/profiles/input/sixaxis.h -index 8e6f3cc..321a918 100644 +index ab88319..0fe3732 100644 --- a/profiles/input/sixaxis.h +++ b/profiles/input/sixaxis.h -@@ -38,6 +38,7 @@ struct cable_pairing { +@@ -25,6 +25,7 @@ struct cable_pairing { uint16_t vid; uint16_t pid; uint16_t version; @@ -44,7 +41,7 @@ index 8e6f3cc..321a918 100644 CablePairingType type; }; -@@ -59,6 +60,7 @@ get_pairing(uint16_t vid, uint16_t pid) +@@ -54,6 +55,7 @@ get_pairing(uint16_t vid, uint16_t pid, const char *name) .vid = 0x054c, .pid = 0x042f, .version = 0x0000, @@ -54,3 +51,4 @@ index 8e6f3cc..321a918 100644 { -- 2.7.4 + diff --git a/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_50.patch b/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_50.patch deleted file mode 100644 index 24311aac02..0000000000 --- a/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_50.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/Makefile.obexd b/Makefile.obexd -index cd3ace4..89f1609 100644 ---- a/Makefile.obexd -+++ b/Makefile.obexd -@@ -8,8 +8,6 @@ endif - - EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service - --if OBEX -- - obex_plugindir = $(libdir)/obex/plugins - - obexd_builtin_modules = -@@ -33,6 +31,8 @@ obexd_builtin_sources += obexd/plugins/opp.c - obexd_builtin_modules += ftp - obexd_builtin_sources += obexd/plugins/ftp.c obexd/plugins/ftp.h - -+if OBEX -+ - obexd_builtin_modules += irmc - obexd_builtin_sources += obexd/plugins/irmc.c - -@@ -47,6 +47,8 @@ obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ - obexd/plugins/messages.h \ - obexd/plugins/messages-dummy.c - -+endif -+ - obexd_builtin_modules += mns - obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \ - obexd/client/map-event.h -@@ -90,8 +92,6 @@ obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ \ - - obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src - --endif -- - obexd_src_obexd_SHORTNAME = obexd - - obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) diff --git a/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch b/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch new file mode 100644 index 0000000000..8b2e0e52fa --- /dev/null +++ b/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch @@ -0,0 +1,41 @@ +diff --git a/Makefile.obexd b/Makefile.obexd +index b7e9f2d33..9a9e9a0a0 100644 +--- a/Makefile.obexd ++++ b/Makefile.obexd +@@ -1,6 +1,4 @@ + # SPDX-License-Identifier: GPL-2.0 +-if OBEX +- + if SYSTEMD + systemduserunitdir = $(SYSTEMD_USERUNITDIR) + systemduserunit_DATA = obexd/src/obex.service +@@ -41,6 +39,8 @@ obexd_builtin_sources += obexd/plugins/opp.c + obexd_builtin_modules += ftp + obexd_builtin_sources += obexd/plugins/ftp.c obexd/plugins/ftp.h + ++if OBEX ++ + obexd_builtin_modules += irmc + obexd_builtin_sources += obexd/plugins/irmc.c + +@@ -57,6 +57,8 @@ obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ + obexd/plugins/messages.h \ + obexd/plugins/messages-dummy.c + ++endif ++ + obexd_builtin_modules += mns + obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \ + obexd/client/map-event.h +@@ -103,11 +105,6 @@ obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \ + -D_FILE_OFFSET_BITS=64 \ + -I$(builddir)/obexd/src + +-else +-obexd-add-service-symlink: +-obexd-remove-service-symlink: +-endif +- + obexd_src_obexd_SHORTNAME = obexd + + obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) diff --git a/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch b/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch new file mode 100644 index 0000000000..532a16701f --- /dev/null +++ b/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch @@ -0,0 +1,50 @@ +From e679b29bcf4890d61294e4110bace5f783632e5a Mon Sep 17 00:00:00 2001 +From: Rudi Heitbaum +Date: Sat, 9 Mar 2024 08:55:24 +0000 +Subject: [PATCH] Revert "build: Fix distcheck" + +This reverts commit d5a9195a6269e703c6e3a47c40982ec94d8cc838. +--- + Makefile.tools | 6 +----- + configure.ac | 8 +------- + 2 files changed, 2 insertions(+), 12 deletions(-) + +diff --git a/Makefile.tools b/Makefile.tools +index 27a753762..c17244677 100644 +--- a/Makefile.tools ++++ b/Makefile.tools +@@ -539,11 +539,7 @@ endif + + if CUPS + +-if CUPS_SERVERBIN +-cupsdir = $(CUPS_SERVERBIN)/backend +-else +-cupsdir = $(libdir)/cups/backend +-endif ++cupsdir = $(CUPSDIR) + + cups_PROGRAMS = profiles/cups/bluetooth + +diff --git a/configure.ac b/configure.ac +index 9ebc250cf..0190e8271 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -247,13 +247,7 @@ AC_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups], + [disable CUPS printer support]), [enable_cups=${enableval}]) + AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no") + if (test "${enable_cups}" != "no"); then +- AC_MSG_CHECKING([cups directory]) +- cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin` +- AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "") +- if (test "${cups_serverbin}" != ""); then +- AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin}) +- fi +- AC_MSG_RESULT([${cups_serverbin}]) ++ AC_SUBST(CUPSDIR, `$PKG_CONFIG cups --variable=cups_serverbin`/backend) + fi + + AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh], +-- +2.43.0 + diff --git a/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch b/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch new file mode 100644 index 0000000000..129c7b0456 --- /dev/null +++ b/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch @@ -0,0 +1,45 @@ +From b94f1be656f34ea1363f5566ef63b847234c6dea Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Mon, 15 Apr 2024 10:48:58 -0400 +Subject: [PATCH] shared/uhid: Fix crash if bt_uhid_destroy free replay + structure + +Id replay structured has been allocated it shall be set back to NULL +after calling uhid_replay_free otherwise it may cause the following +crash: + +Invalid read of size 1 + at 0x1D8FC4: bt_uhid_record (uhid.c:116) + by 0x1D912C: uhid_read_handler (uhid.c:158) + by 0x201A64: watch_callback (io-glib.c:157) + by 0x48D4198: g_main_dispatch.lto_priv.0 (gmain.c:3344) + by 0x49333BE: UnknownInlinedFun (gmain.c:4152) + by 0x49333BE: g_main_context_iterate_unlocked.isra.0 (gmain.c:4217) + by 0x48D4DC6: g_main_loop_run (gmain.c:4419) + by 0x2020F4: mainloop_run (mainloop-glib.c:66) + by 0x20254B: mainloop_run_with_signal (mainloop-notify.c:188) + by 0x12D6D4: main (main.c:1456) + Address 0x53ae9c0 is 0 bytes inside a block of size 40 free'd + at 0x48468CF: free (vg_replace_malloc.c:985) + by 0x1D8E19: uhid_replay_free (uhid.c:68) + by 0x1D8E19: uhid_replay_free (uhid.c:59) + by 0x1D8E19: bt_uhid_destroy (uhid.c:509) + by 0x1591F5: uhid_disconnect (device.c:183) + +Fixes: https://github.com/bluez/bluez/issues/815 +--- + src/shared/uhid.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/shared/uhid.c b/src/shared/uhid.c +index c1092b707..1f071b958 100644 +--- a/src/shared/uhid.c ++++ b/src/shared/uhid.c +@@ -507,6 +507,7 @@ int bt_uhid_destroy(struct bt_uhid *uhid) + + uhid->created = false; + uhid_replay_free(uhid->replay); ++ uhid->replay = NULL; + + return err; + } diff --git a/projects/Rockchip/devices/RK3566/linux/linux.aarch64.conf b/projects/Rockchip/devices/RK3566/linux/linux.aarch64.conf index 264de84aef..a64b78dd8b 100644 --- a/projects/Rockchip/devices/RK3566/linux/linux.aarch64.conf +++ b/projects/Rockchip/devices/RK3566/linux/linux.aarch64.conf @@ -1420,7 +1420,7 @@ CONFIG_BT_RFCOMM=y # CONFIG_BT_RFCOMM_TTY is not set # CONFIG_BT_BNEP is not set # CONFIG_BT_CMTP is not set -CONFIG_BT_HIDP=y +CONFIG_BT_HIDP=m CONFIG_BT_HS=y CONFIG_BT_LE=y CONFIG_BT_LE_L2CAP_ECRED=y @@ -5526,6 +5526,8 @@ CONFIG_HID_PENMOUNT=y CONFIG_HID_PETALYNX=y # CONFIG_HID_PICOLCD is not set CONFIG_HID_PLANTRONICS=y +CONFIG_HID_PLAYSTATION=y +CONFIG_PLAYSTATION_FF=y # CONFIG_HID_PXRC is not set # CONFIG_HID_RAZER is not set CONFIG_HID_PRIMAX=y @@ -5536,7 +5538,7 @@ CONFIG_HID_SAMSUNG=y # CONFIG_HID_SEMITEK is not set # CONFIG_HID_SIGMAMICRO is not set CONFIG_HID_SONY=y -# CONFIG_SONY_FF is not set +CONFIG_SONY_FF=y CONFIG_HID_SPEEDLINK=y # CONFIG_HID_STEAM is not set CONFIG_HID_STEELSERIES=y @@ -5969,8 +5971,8 @@ CONFIG_MMC_HSQ=y # CONFIG_MEMSTICK is not set CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y -# CONFIG_LEDS_CLASS_FLASH is not set -# CONFIG_LEDS_CLASS_MULTICOLOR is not set +CONFIG_LEDS_CLASS_FLASH=y +CONFIG_LEDS_CLASS_MULTICOLOR=y # CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set # diff --git a/projects/Rockchip/patches/linux/RK3566/032-bluetooth-fix-encryption-key-size.patch b/projects/Rockchip/patches/linux/RK3566/032-bluetooth-fix-encryption-key-size.patch new file mode 100644 index 0000000000..ce1a1129d4 --- /dev/null +++ b/projects/Rockchip/patches/linux/RK3566/032-bluetooth-fix-encryption-key-size.patch @@ -0,0 +1,78 @@ +From mboxrd@z Thu Jan 1 00:00:00 1970 +Return-Path: +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on + aws-us-west-2-korg-lkml-1.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, + INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, + URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id 9B9E6C072A4 + for ; Wed, 22 May 2019 07:05:47 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 7504F20863 + for ; Wed, 22 May 2019 07:05:47 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1728185AbfEVHFq (ORCPT + ); + Wed, 22 May 2019 03:05:46 -0400 +Received: from coyote.holtmann.net ([212.227.132.17]:49582 "EHLO + mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725796AbfEVHFq (ORCPT + ); + Wed, 22 May 2019 03:05:46 -0400 +Received: from localhost.localdomain (p5B3D2A37.dip0.t-ipconnect.de [91.61.42.55]) + by mail.holtmann.org (Postfix) with ESMTPSA id 1D6ECCF183; + Wed, 22 May 2019 09:14:04 +0200 (CEST) +From: Marcel Holtmann +To: anarsoul@gmail.com, linux-bluetooth@vger.kernel.org +Subject: [RFC] Bluetooth: Check key sizes only when Secure Simple Pairing is enabled +Date: Wed, 22 May 2019 09:05:40 +0200 +Message-Id: <20190522070540.48895-1-marcel@holtmann.org> +X-Mailer: git-send-email 2.20.1 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Sender: linux-bluetooth-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-bluetooth@vger.kernel.org + +The encryption is only mandatory to be enforced when both sides are using +Secure Simple Pairing and this means the key size check makes only sense +in that case. + +On legacy Bluetooth 2.0 and earlier devices like mice the encryption was +optional and thus causing an issue if the key size check is not bound to +using Secure Simple Pairing. + +Fixes: d5bb334a8e17 ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections") +Signed-off-by: Marcel Holtmann +Cc: stable@vger.kernel.org +--- + net/bluetooth/hci_conn.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c +index 3cf0764d5793..7516cdde3373 100644 +--- a/net/bluetooth/hci_conn.c ++++ b/net/bluetooth/hci_conn.c +@@ -1272,8 +1272,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn) + return 0; + } + +- if (hci_conn_ssp_enabled(conn) && +- !test_bit(HCI_CONN_ENCRYPT, &conn->flags)) ++ /* If Secure Simple Pairing is not enabled, then legacy connection ++ * setup is used and no encryption or key sizes can be enforced. ++ */ ++ if (!hci_conn_ssp_enabled(conn)) ++ return 1; ++ ++ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags)) + return 0; + + /* The minimum encryption key size needs to be enforced by the +-- +2.20.1 + + diff --git a/projects/Rockchip/patches/linux/RK3566/033-bluetooth-backport-l2cap-fix.patch b/projects/Rockchip/patches/linux/RK3566/033-bluetooth-backport-l2cap-fix.patch new file mode 100644 index 0000000000..cc748c6af5 --- /dev/null +++ b/projects/Rockchip/patches/linux/RK3566/033-bluetooth-backport-l2cap-fix.patch @@ -0,0 +1,31 @@ +From e6bb15dbae900b71b69fc52a9f640d699bb840b4 Mon Sep 17 00:00:00 2001 +From: Archie Pusaka +Date: Thu, 4 Apr 2024 18:50:23 +0800 +Subject: [PATCH] Bluetooth: l2cap: Don't double set the + HCI_CONN_MGMT_CONNECTED bit + +The bit is set and tested inside mgmt_device_connected(), therefore we +must not set it just outside the function. + +Fixes: eeda1bf97bb5 ("Bluetooth: hci_event: Fix not indicating new connection for BIG Sync") +Signed-off-by: Archie Pusaka +Reviewed-by: Manish Mandlik +Signed-off-by: Luiz Augusto von Dentz +--- + net/bluetooth/l2cap_core.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c +index cf3b8e9b7b3b..b0970462a689 100644 +--- a/net/bluetooth/l2cap_core.c ++++ b/net/bluetooth/l2cap_core.c +@@ -4063,8 +4063,7 @@ static int l2cap_connect_req(struct l2cap_conn *conn, + return -EPROTO; + + hci_dev_lock(hdev); +- if (hci_dev_test_flag(hdev, HCI_MGMT) && +- !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags)) ++ if (hci_dev_test_flag(hdev, HCI_MGMT)) + mgmt_device_connected(hdev, hcon, NULL, 0); + hci_dev_unlock(hdev); +