From fe489050806f2a0e7c2d14d9a5835fde9c71c7d5 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Mon, 29 Sep 2025 11:24:31 +0200 Subject: [PATCH 01/22] Makefile: add check-package-external target The new target provides a convenient way to run utils/check-package on any external trees, using .checkpackageignore files from the respective trees if present. While .checkpackageignore should be used as little as possible, in a few cases adding overrides for false-positives to the affected files is not feasible, a practical example of this is a Markdown file misidentified as Python by libmagic (likely due to code blocks). Signed-off-by: Fiona Klute [Arnout: set ${ignore} explicitly to empty, in case it exists in the environment.] Signed-off-by: Arnout Vandecappelle --- Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d2257ed3a3c5..004039d84781 100644 --- a/Makefile +++ b/Makefile @@ -125,7 +125,8 @@ endif noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \ defconfig %_defconfig allyesconfig allnoconfig alldefconfig syncconfig release \ randpackageconfig allyespackageconfig allnopackageconfig \ - print-version olddefconfig distclean manual manual-% check-package + print-version olddefconfig distclean manual manual-% check-package \ + check-package-external # Some global targets do not trigger a build, but are used to collect # metadata, or do various checks. When such targets are triggered, @@ -1255,10 +1256,29 @@ release: print-version: @echo $(BR2_VERSION_FULL) +# $(1): br2-external path +# $(2): br2-external description +define check-package-external + @$(call MESSAGE,"Checking packages in $(2)") + $(Q)if [ -r "$(1)/.checkpackageignore" ]; then \ + ignore="--ignore-list=$(1)/.checkpackageignore" ; \ + else \ + ignore=""; \ + fi ; \ + $(TOPDIR)/utils/check-package \ + --br2-external $${ignore} \ + `git -C $(1) ls-tree -r --format='$(1)/%(path)' HEAD` +endef + check-package: $(Q)./utils/check-package `git ls-tree -r --name-only HEAD` \ --ignore-list=$(TOPDIR)/.checkpackageignore +check-package-external: + $(foreach name,$(BR2_EXTERNAL_NAMES),\ + $(call check-package-external,$(BR2_EXTERNAL_$(name)_PATH),\ + $(BR2_EXTERNAL_$(name)_DESC))$(sep)) + .PHONY: .checkpackageignore .checkpackageignore: $(Q)./utils/check-package --failed-only `git ls-tree -r --name-only HEAD` \ From 38e0521a795ef5ec1a9264f44931f0fc37035d77 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Tue, 30 Dec 2025 19:57:49 +0100 Subject: [PATCH 02/22] package/wilc-driver: redirect URL to github benetti-engineering Drop all local patches that are committed to github benetti-engineering repositories. Signed-off-by: Giulio Benetti Acked-by: Kris Bahnsen Signed-off-by: Thomas Petazzoni --- .checkpackageignore | 5 - ...missing-prandom_u32-with-Linux-6.1.0.patch | 34 --- ...fix-build-failure-on-remove-callback.patch | 44 ---- ...uild-failure-with-Linux-5.19-and-6.1.patch | 98 -------- ...on_parameters-Linux-6.1-build-failur.patch | 216 ------------------ .../wilc-driver/0005-Fix-cast-warnings.patch | 43 ---- .../wilc-driver/0006-Support-Linux-6.3.patch | 43 ---- .../wilc-driver/0007-Support-Linux-6.4.patch | 36 --- .../0008-Fix-build-with-Linux-6.7.patch | 46 ---- .../0009-Fix-build-with-Linux-6.8.patch | 34 --- .../0010-Fix-build-with-Linux-6.10.patch | 55 ----- ...cfg80211.c-fix-build-with-Linux-6.13.patch | 28 --- .../0012-Fix-build-with-Linux-6.14.patch | 33 --- .../0013-Fix-build-with-Linux-6.15.patch | 177 -------------- .../0014-Fix-build-for-kernel-6.16.patch | 34 --- .../0015-Fix-build-for-kernel-6.17.patch | 109 --------- package/wilc-driver/wilc-driver.hash | 2 +- package/wilc-driver/wilc-driver.mk | 4 +- 18 files changed, 3 insertions(+), 1038 deletions(-) delete mode 100644 package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch delete mode 100644 package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch delete mode 100644 package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch delete mode 100644 package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch delete mode 100644 package/wilc-driver/0005-Fix-cast-warnings.patch delete mode 100644 package/wilc-driver/0006-Support-Linux-6.3.patch delete mode 100644 package/wilc-driver/0007-Support-Linux-6.4.patch delete mode 100644 package/wilc-driver/0008-Fix-build-with-Linux-6.7.patch delete mode 100644 package/wilc-driver/0009-Fix-build-with-Linux-6.8.patch delete mode 100644 package/wilc-driver/0010-Fix-build-with-Linux-6.10.patch delete mode 100644 package/wilc-driver/0011-cfg80211.c-fix-build-with-Linux-6.13.patch delete mode 100644 package/wilc-driver/0012-Fix-build-with-Linux-6.14.patch delete mode 100644 package/wilc-driver/0013-Fix-build-with-Linux-6.15.patch delete mode 100644 package/wilc-driver/0014-Fix-build-for-kernel-6.16.patch delete mode 100644 package/wilc-driver/0015-Fix-build-for-kernel-6.17.patch diff --git a/.checkpackageignore b/.checkpackageignore index 22b872b11fb2..1e4e081e830d 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -1016,11 +1016,6 @@ package/wampcc/0001-Add-RISC-V-endian-detection.patch lib_patch.Upstream package/wampcc/0002-include-wampcc-platform.h-fix-build-with-musl-1.2.0.patch lib_patch.Upstream package/wampcc/0003-Broken-build-on-Windows.patch lib_patch.Upstream package/wget/0001-lib-getrandom.c-fix-build-with-uclibc-1.0.35.patch lib_patch.Upstream -package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch lib_patch.Upstream -package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch lib_patch.Upstream -package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch lib_patch.Upstream -package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch lib_patch.Upstream -package/wilc-driver/0005-Fix-cast-warnings.patch lib_patch.Upstream package/wipe/0001-musl.patch lib_patch.Upstream package/wireless_tools/0001-remove-bzero.patch lib_patch.Upstream package/woff2/0001-CMake-Handle-multiple-libraries-being-returned-for-B.patch lib_patch.Upstream diff --git a/package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch b/package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch deleted file mode 100644 index 2f1062730175..000000000000 --- a/package/wilc-driver/0001-cfg80211.c-fix-missing-prandom_u32-with-Linux-6.1.0.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f80e4343fa0a4d8b22933d1704c85a771fe234a4 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 28 Dec 2022 19:56:46 +0100 -Subject: [PATCH] cfg80211.c: fix missing prandom_u32() with Linux >= 6.1.0 - -prandom_u32() previously was only calling get_random_u32() so it's been -dropped with Linux 6.1.0. So let's directly call get_random_u32() if Linux -version >= 6.1.0. - -[Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2] -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/cfg80211.c b/cfg80211.c -index 016aa06..41edd02 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -1422,7 +1422,11 @@ static int mgmt_tx(struct wiphy *wiphy, - const u8 *vendor_ie; - int ret = 0; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ *cookie = get_random_u32(); -+#else - *cookie = prandom_u32(); -+#endif - priv->tx_cookie = *cookie; - mgmt = (const struct ieee80211_mgmt *)buf; - --- -2.34.1 - diff --git a/package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch b/package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch deleted file mode 100644 index 87306dfa12c7..000000000000 --- a/package/wilc-driver/0002-spi.c-fix-build-failure-on-remove-callback.patch +++ /dev/null @@ -1,44 +0,0 @@ -From a88819bd63f977b5a33d72a2b9e264ce104726bd Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 28 Dec 2022 21:02:12 +0100 -Subject: [PATCH] spi.c: fix build failure on remove callback - -Starting from Linux 5.18 remove callback returns void, so let's deal with -it depending on Linux version >= 5.18. - -[Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2] -Signed-off-by: Giulio Benetti ---- - spi.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/spi.c b/spi.c -index 96c51fe..f7b43e2 100644 ---- a/spi.c -+++ b/spi.c -@@ -211,7 +211,11 @@ free: - return ret; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)) -+static void wilc_bus_remove(struct spi_device *spi) -+#else - static int wilc_bus_remove(struct spi_device *spi) -+#endif - { - struct wilc *wilc = spi_get_drvdata(spi); - -@@ -220,7 +224,10 @@ static int wilc_bus_remove(struct spi_device *spi) - - wilc_netdev_cleanup(wilc); - wilc_bt_deinit(); -+ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)) - return 0; -+#endif - } - - static int wilc_spi_suspend(struct device *dev) --- -2.34.1 - diff --git a/package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch b/package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch deleted file mode 100644 index 785b8904b2f4..000000000000 --- a/package/wilc-driver/0003-cfg80211.c-fix-build-failure-with-Linux-5.19-and-6.1.patch +++ /dev/null @@ -1,98 +0,0 @@ -From a608cdd7903505217529317c04b5b58cb7e25081 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 28 Dec 2022 21:06:43 +0100 -Subject: [PATCH] cfg80211.c: fix build failure with Linux 5.19 and 6.1 - -Starting from Linux 5.19 stop_ap() requires unsigned int link_id as -parameter. Then from Linux 6.1 on lot of other cfg80211 APIs require -int link_id to deal with MLO, so let's add that parameter too. - -[Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2] -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 35 +++++++++++++++++++++++++++++------ - 1 file changed, 29 insertions(+), 6 deletions(-) - -diff --git a/cfg80211.c b/cfg80211.c -index 41edd02..57c777d 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -674,8 +674,12 @@ static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info, - return 0; - } - --static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, -- bool pairwise, const u8 *mac_addr, struct key_params *params) -+static int add_key(struct wiphy *wiphy, struct net_device *netdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ int link_id, -+#endif -+ u8 key_index, bool pairwise, const u8 *mac_addr, -+ struct key_params *params) - - { - int ret = 0, keylen = params->key_len, seqlen = params->seq_len; -@@ -792,6 +796,9 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, - } - - static int del_key(struct wiphy *wiphy, struct net_device *netdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ int link_id, -+#endif - u8 key_index, - bool pairwise, - const u8 *mac_addr) -@@ -833,9 +840,13 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, - return ret; - } - --static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, -- bool pairwise, const u8 *mac_addr, void *cookie, -- void (*callback)(void *cookie, struct key_params *)) -+static int get_key(struct wiphy *wiphy, struct net_device *netdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ int link_id, -+#endif -+ u8 key_index, bool pairwise, const u8 *mac_addr, -+ void *cookie, void (*callback)(void *cookie, -+ struct key_params *)) - { - struct wilc_vif *vif = netdev_priv(netdev); - struct wilc_priv *priv = &vif->priv; -@@ -877,12 +888,18 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, - - /* wiphy_new() will WARN if not present*/ - static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ int link_id, -+#endif - u8 key_index, bool unicast, bool multicast) - { - return 0; - } - - static int set_default_mgmt_key (struct wiphy *wiphy,struct net_device *netdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ int link_id, -+#endif - u8 key_index) - { - return 0; -@@ -1814,7 +1831,13 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev, - return wilc_add_beacon(vif, 0, 0, beacon); - } - --static int stop_ap(struct wiphy *wiphy, struct net_device *dev) -+static int stop_ap(struct wiphy *wiphy, struct net_device *dev -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)) -+ , unsigned int link_id -+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)) -+ , int link_id -+#endif -+ ) - { - int ret; - struct wilc_vif *vif = netdev_priv(dev); --- -2.34.1 - diff --git a/package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch b/package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch deleted file mode 100644 index faee805b5a7a..000000000000 --- a/package/wilc-driver/0004-Fix-struct-station_parameters-Linux-6.1-build-failur.patch +++ /dev/null @@ -1,216 +0,0 @@ -From 5f022c4d3be32493d500be82f51032ef4fb3cdc0 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 28 Dec 2022 21:08:45 +0100 -Subject: [PATCH] Fix struct station_parameters Linux 6.1 build failure - -Starting from Linux 6.1 struct station_parameters has changed by moving -some member to its child struct link_station_parameters. Let's extract the -values of the needed members into local values at the beginning of -functions and substitute the member access with the local variables. - -[Upstream status: https://github.com/embeddedTS/wilc3000-external-module/pull/2] -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 48 ++++++++++++++++++++++++++++++++---------------- - hif.c | 44 ++++++++++++++++++++++++++++++++------------ - 2 files changed, 64 insertions(+), 28 deletions(-) - -diff --git a/cfg80211.c b/cfg80211.c -index 57c777d..bdd480c 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -1866,6 +1866,14 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev, - struct wilc_vif *vif = netdev_priv(dev); - struct wilc_priv *priv = &vif->priv; - u8 *assoc_bss = priv->assoc_stainfo.sta_associated_bss[params->aid]; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ struct link_station_parameters *link_sta_params = ¶ms->link_sta_params; -+ const struct ieee80211_ht_cap *ht_capa = link_sta_params->ht_capa; -+ u8 supported_rates_len = link_sta_params->supported_rates_len; -+#else -+ const struct ieee80211_ht_cap *ht_capa = params->ht_capa; -+ u8 supported_rates_len = params->supported_rates_len; -+#endif - - if (vif->iftype == WILC_AP_MODE || vif->iftype == WILC_GO_MODE) { - memcpy(assoc_bss, mac, ETH_ALEN); -@@ -1879,27 +1887,27 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev, - params->aid); - PRINT_INFO(vif->ndev, HOSTAPD_DBG, - "Number of supported rates = %d\n", -- params->supported_rates_len); -+ supported_rates_len); - - PRINT_INFO(vif->ndev, CFG80211_DBG, "IS HT supported = %d\n", -- (!params->ht_capa) ? false : true); -+ (!ht_capa) ? false : true); - -- if (params->ht_capa) { -+ if (ht_capa) { - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Capability Info = %d\n", -- params->ht_capa->cap_info); -+ ht_capa->cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "AMPDU Params = %d\n", -- params->ht_capa->ampdu_params_info); -+ ht_capa->ampdu_params_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "HT Extended params= %d\n", -- params->ht_capa->extended_ht_cap_info); -+ ht_capa->extended_ht_cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Tx Beamforming Cap= %d\n", -- params->ht_capa->tx_BF_cap_info); -+ ht_capa->tx_BF_cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Antenna selection info = %d\n", -- params->ht_capa->antenna_selection_info); -+ ht_capa->antenna_selection_info); - } - - PRINT_INFO(vif->ndev, CFG80211_DBG, "Flag Mask = %d\n", -@@ -1966,6 +1974,14 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev, - { - int ret = 0; - struct wilc_vif *vif = netdev_priv(dev); -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ struct link_station_parameters *link_sta_params = ¶ms->link_sta_params; -+ const struct ieee80211_ht_cap *ht_capa = link_sta_params->ht_capa; -+ u8 supported_rates_len = link_sta_params->supported_rates_len; -+#else -+ const struct ieee80211_ht_cap *ht_capa = params->ht_capa; -+ u8 supported_rates_len = params->supported_rates_len; -+#endif - - PRINT_D(vif->ndev, CFG80211_DBG, "Change station parameters\n"); - -@@ -1976,25 +1992,25 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev, - params->aid); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Number of supported rates = %d\n", -- params->supported_rates_len); -+ supported_rates_len); - PRINT_INFO(vif->ndev, CFG80211_DBG, "IS HT supported = %d\n", -- (!params->ht_capa) ? false : true); -- if (params->ht_capa) { -+ (!ht_capa) ? false : true); -+ if (ht_capa) { - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Capability Info = %d\n", -- params->ht_capa->cap_info); -+ ht_capa->cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "AMPDU Params = %d\n", -- params->ht_capa->ampdu_params_info); -+ ht_capa->ampdu_params_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "HT Extended params= %d\n", -- params->ht_capa->extended_ht_cap_info); -+ ht_capa->extended_ht_cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Tx Beamforming Cap= %d\n", -- params->ht_capa->tx_BF_cap_info); -+ ht_capa->tx_BF_cap_info); - PRINT_INFO(vif->ndev, CFG80211_DBG, - "Antenna selection info = %d\n", -- params->ht_capa->antenna_selection_info); -+ ht_capa->antenna_selection_info); - } - PRINT_INFO(vif->ndev, CFG80211_DBG, "Flag Mask = %d\n", - params->sta_flags_mask); -diff --git a/hif.c b/hif.c -index 3f672a0..1a7365b 100644 ---- a/hif.c -+++ b/hif.c -@@ -2249,6 +2249,16 @@ int wilc_add_station(struct wilc_vif *vif, const u8 *mac, - int result; - struct host_if_msg *msg; - struct add_sta_param *sta_params; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ struct link_station_parameters *link_sta_params = ¶ms->link_sta_params; -+ const struct ieee80211_ht_cap *ht_capa = link_sta_params->ht_capa; -+ u8 supported_rates_len = link_sta_params->supported_rates_len; -+ const u8 *supported_rates = link_sta_params->supported_rates; -+#else -+ const struct ieee80211_ht_cap *ht_capa = params->ht_capa; -+ u8 supported_rates_len = params->supported_rates_len; -+ const u8 *supported_rates = params->supported_rates; -+#endif - - PRINT_INFO(vif->ndev, HOSTINF_DBG, - "Setting adding station message queue params\n"); -@@ -2260,20 +2270,20 @@ int wilc_add_station(struct wilc_vif *vif, const u8 *mac, - sta_params = &msg->body.add_sta_info; - memcpy(sta_params->bssid, mac, ETH_ALEN); - sta_params->aid = params->aid; -- if (!params->ht_capa) { -+ if (!ht_capa) { - sta_params->ht_supported = false; - } else { - sta_params->ht_supported = true; -- memcpy(&sta_params->ht_capa, params->ht_capa, -+ memcpy(&sta_params->ht_capa, ht_capa, - sizeof(struct ieee80211_ht_cap)); - } - sta_params->flags_mask = params->sta_flags_mask; - sta_params->flags_set = params->sta_flags_set; - -- sta_params->supported_rates_len = params->supported_rates_len; -- if (params->supported_rates_len > 0) { -- sta_params->supported_rates = kmemdup(params->supported_rates, -- params->supported_rates_len, -+ sta_params->supported_rates_len = supported_rates_len; -+ if (supported_rates_len > 0) { -+ sta_params->supported_rates = kmemdup(supported_rates, -+ supported_rates_len, - GFP_KERNEL); - if (!sta_params->supported_rates) { - kfree(msg); -@@ -2397,6 +2407,16 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, - int result; - struct host_if_msg *msg; - struct add_sta_param *sta_params; -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) -+ struct link_station_parameters *link_sta_params = ¶ms->link_sta_params; -+ const struct ieee80211_ht_cap *ht_capa = link_sta_params->ht_capa; -+ u8 supported_rates_len = link_sta_params->supported_rates_len; -+ const u8 *supported_rates = link_sta_params->supported_rates; -+#else -+ const struct ieee80211_ht_cap *ht_capa = params->ht_capa; -+ u8 supported_rates_len = params->supported_rates_len; -+ const u8 *supported_rates = params->supported_rates; -+#endif - - PRINT_INFO(vif->ndev, HOSTINF_DBG, - "Setting editing station message queue params\n"); -@@ -2408,20 +2428,20 @@ int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, - sta_params = &msg->body.edit_sta_info; - memcpy(sta_params->bssid, mac, ETH_ALEN); - sta_params->aid = params->aid; -- if (!params->ht_capa) { -+ if (!ht_capa) { - sta_params->ht_supported = false; - } else { - sta_params->ht_supported = true; -- memcpy(&sta_params->ht_capa, params->ht_capa, -+ memcpy(&sta_params->ht_capa, ht_capa, - sizeof(struct ieee80211_ht_cap)); - } - sta_params->flags_mask = params->sta_flags_mask; - sta_params->flags_set = params->sta_flags_set; - -- sta_params->supported_rates_len = params->supported_rates_len; -- if (params->supported_rates_len > 0) { -- sta_params->supported_rates = kmemdup(params->supported_rates, -- params->supported_rates_len, -+ sta_params->supported_rates_len = supported_rates_len; -+ if (supported_rates_len > 0) { -+ sta_params->supported_rates = kmemdup(supported_rates, -+ supported_rates_len, - GFP_KERNEL); - if (!sta_params->supported_rates) { - kfree(msg); --- -2.34.1 - diff --git a/package/wilc-driver/0005-Fix-cast-warnings.patch b/package/wilc-driver/0005-Fix-cast-warnings.patch deleted file mode 100644 index 713a15e667ed..000000000000 --- a/package/wilc-driver/0005-Fix-cast-warnings.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ebd083223883d479b2dd6f8a0da272797f90d236 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Sat, 31 Dec 2022 18:38:33 +0100 -Subject: [PATCH] Fix cast warnings - -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 2 +- - netdev.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/cfg80211.c b/cfg80211.c -index 016aa06..2f40c9d 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -1794,7 +1794,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, - if (ret != 0) - netdev_err(dev, "Error in setting channel\n"); - -- wilc_wlan_set_bssid(dev, dev->dev_addr, WILC_AP_MODE); -+ wilc_wlan_set_bssid(dev, (u8 *)dev->dev_addr, WILC_AP_MODE); - - return wilc_add_beacon(vif, settings->beacon_interval, - settings->dtim_period, &settings->beacon); -diff --git a/netdev.c b/netdev.c -index 824afea..5a1a51d 100644 ---- a/netdev.c -+++ b/netdev.c -@@ -899,9 +899,9 @@ static int wilc_mac_open(struct net_device *ndev) - vif->idx); - - if (is_valid_ether_addr(ndev->dev_addr)) -- wilc_set_mac_address(vif, ndev->dev_addr); -+ wilc_set_mac_address(vif, (u8 *)ndev->dev_addr); - else -- wilc_get_mac_address(vif, ndev->dev_addr); -+ wilc_get_mac_address(vif, (u8 *)ndev->dev_addr); - netdev_dbg(ndev, "Mac address: %pM\n", ndev->dev_addr); - - if (!is_valid_ether_addr(ndev->dev_addr)) { --- -2.34.1 - diff --git a/package/wilc-driver/0006-Support-Linux-6.3.patch b/package/wilc-driver/0006-Support-Linux-6.3.patch deleted file mode 100644 index f5a92027da64..000000000000 --- a/package/wilc-driver/0006-Support-Linux-6.3.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 14b5eccf4145e7a5afc8bc65a15f26ac691f98d8 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 27 Sep 2023 10:54:18 +0200 -Subject: [PATCH] Support Linux 6.3 - -With Linux 6.3 commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=40fc56ee608cdb20022c225ac6f1e4b7ba63f8f1 -function of_get_named_gpio_flags() has been dropped but it was only a -wrapper to call of_get_named_gpio() if the flags passed was NULL and this -is the case. So let's use of_get_named_gpio() in place of -of_get_named_gpio_flags() since of_get_named_gpio() never changed -after its adding in Linux version 3.1. - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/4 - -Signed-off-by: Giulio Benetti ---- - power.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/power.c b/power.c -index 6c59e0b..6ab8d63 100644 ---- a/power.c -+++ b/power.c -@@ -25,13 +25,11 @@ int wilc_of_parse_power_pins(struct wilc *wilc) - const struct wilc_power_gpios *gpios = &default_gpios[0]; - int ret; - -- power->gpios.reset = of_get_named_gpio_flags(of, "reset-gpios", 0, -- NULL); -+ power->gpios.reset = of_get_named_gpio(of, "reset-gpios", 0); - if (!gpio_is_valid(power->gpios.reset)) - power->gpios.reset = gpios->reset; - -- power->gpios.chip_en = of_get_named_gpio_flags(of, "chip_en-gpios", 0, -- NULL); -+ power->gpios.chip_en = of_get_named_gpio(of, "chip_en-gpios", 0); - if (!gpio_is_valid(power->gpios.chip_en)) - power->gpios.chip_en = gpios->chip_en; - --- -2.34.1 - diff --git a/package/wilc-driver/0007-Support-Linux-6.4.patch b/package/wilc-driver/0007-Support-Linux-6.4.patch deleted file mode 100644 index 8339cc3cb663..000000000000 --- a/package/wilc-driver/0007-Support-Linux-6.4.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 94fc4594659494b8c5cbdf1a719aea4d66d3398d Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Wed, 27 Sep 2023 11:20:50 +0200 -Subject: [PATCH] Support Linux 6.4 - -With Linux 6.4 commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1aaba11da9aa7d7d6b52a74d45b31cac118295a1 -class_create() doesn't require first argument THIS_MODULE anymore so let's -drop first argument if Linux version >= 6.4 - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/5 - -Signed-off-by: Giulio Benetti ---- - bt.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/bt.c b/bt.c -index 48a5302..a752457 100644 ---- a/bt.c -+++ b/bt.c -@@ -135,7 +135,11 @@ static void wilc_bt_create_device(void) - ret = alloc_chrdev_region(&chc_dev_no, 0, 1, "atmel"); - if (ret < 0) - return; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) -+ chc_dev_class = class_create("atmel"); -+#else - chc_dev_class = class_create(THIS_MODULE, "atmel"); -+#endif - if (IS_ERR(chc_dev_class)) { - unregister_chrdev_region(chc_dev_no, 1); - return; --- -2.34.1 - diff --git a/package/wilc-driver/0008-Fix-build-with-Linux-6.7.patch b/package/wilc-driver/0008-Fix-build-with-Linux-6.7.patch deleted file mode 100644 index 9714a828eb3a..000000000000 --- a/package/wilc-driver/0008-Fix-build-with-Linux-6.7.patch +++ /dev/null @@ -1,46 +0,0 @@ -From c2024eb93f6d7ec605226d5d8a29ea17fbc71b5d Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Thu, 17 Apr 2025 19:06:48 +0200 -Subject: [PATCH] Fix build with Linux 6.7 - -During commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bb55441c57ccc5cc2eab44e1a97698b9d708871d -struct cfg80211_ap_settings has been split into multiple structs including -beacon. So is Linux version is 6.7+ let's use &info->beacon in place of -beacon. - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/8 -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/cfg80211.c b/cfg80211.c -index 5c92062..25da3a1 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -1822,13 +1822,21 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, - } - - static int change_beacon(struct wiphy *wiphy, struct net_device *dev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)) -+ struct cfg80211_ap_update *info) -+#else - struct cfg80211_beacon_data *beacon) -+#endif - { - struct wilc_vif *vif = netdev_priv(dev); - - PRINT_INFO(vif->ndev, HOSTAPD_DBG, "Setting beacon\n"); - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0)) -+ return wilc_add_beacon(vif, 0, 0, &info->beacon); -+#else - return wilc_add_beacon(vif, 0, 0, beacon); -+#endif - } - - static int stop_ap(struct wiphy *wiphy, struct net_device *dev --- -2.39.5 - diff --git a/package/wilc-driver/0009-Fix-build-with-Linux-6.8.patch b/package/wilc-driver/0009-Fix-build-with-Linux-6.8.patch deleted file mode 100644 index 2bafd53a9a72..000000000000 --- a/package/wilc-driver/0009-Fix-build-with-Linux-6.8.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 90e679f1b7caad02e68fa8672be6569eb1b2b76f Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Thu, 17 Apr 2025 18:56:55 +0200 -Subject: [PATCH] Fix build with Linux 6.8 - -With commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d26270061ae66b915138af7cd73ca6f8b85e6b44 -strlcpy() has been superseded in favor of strscpy() so let's #define -strlcpy as strscpy if Linux version 6.8+ - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/8 -Signed-off-by: Giulio Benetti ---- - mon.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/mon.c b/mon.c -index 2c9c2d9..20b7e20 100644 ---- a/mon.c -+++ b/mon.c -@@ -6,6 +6,10 @@ - - #include "cfg80211.h" - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0)) -+#define strlcpy strscpy -+#endif -+ - struct wilc_wfi_radiotap_hdr { - struct ieee80211_radiotap_header hdr; - u8 rate; --- -2.39.5 - diff --git a/package/wilc-driver/0010-Fix-build-with-Linux-6.10.patch b/package/wilc-driver/0010-Fix-build-with-Linux-6.10.patch deleted file mode 100644 index 08444b06e27f..000000000000 --- a/package/wilc-driver/0010-Fix-build-with-Linux-6.10.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 684eb3e40c88ee7a2cd4417a12b9b27a35e86655 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Thu, 17 Apr 2025 18:41:07 +0200 -Subject: [PATCH] Fix build with Linux 6.10 - -During commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9b163e0d330debbf7dcc14b2c3e2dc19a3b50a1d -is_dma_mapped member has been dropped since it was not used anymore. The -DMA mapping is done directly in single spi drivers in case it's supported -so having is_dma_mapped set to 1 lead to code breakage. So we can consider -it always as 0 and basically guard it if Linux version is 6.10+ - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/8 -Signed-off-by: Giulio Benetti ---- - spi.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/spi.c b/spi.c -index f7b43e2..be616f4 100644 ---- a/spi.c -+++ b/spi.c -@@ -338,7 +338,9 @@ static int wilc_spi_tx(struct wilc *wilc, u8 *b, u32 len) - memset(&msg, 0, sizeof(msg)); - spi_message_init(&msg); - msg.spi = spi; -+#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE - msg.is_dma_mapped = USE_SPI_DMA; -+#endif - spi_message_add_tail(&tr, &msg); - - ret = spi_sync(spi, &msg); -@@ -385,7 +387,9 @@ static int wilc_spi_rx(struct wilc *wilc, u8 *rb, u32 rlen) - memset(&msg, 0, sizeof(msg)); - spi_message_init(&msg); - msg.spi = spi; -+#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE - msg.is_dma_mapped = USE_SPI_DMA; -+#endif - spi_message_add_tail(&tr, &msg); - - ret = spi_sync(spi, &msg); -@@ -427,7 +431,9 @@ static int wilc_spi_tx_rx(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen) - memset(&msg, 0, sizeof(msg)); - spi_message_init(&msg); - msg.spi = spi; -+#if KERNEL_VERSION(6, 10, 0) > LINUX_VERSION_CODE - msg.is_dma_mapped = USE_SPI_DMA; -+#endif - - spi_message_add_tail(&tr, &msg); - ret = spi_sync(spi, &msg); --- -2.39.5 - diff --git a/package/wilc-driver/0011-cfg80211.c-fix-build-with-Linux-6.13.patch b/package/wilc-driver/0011-cfg80211.c-fix-build-with-Linux-6.13.patch deleted file mode 100644 index 6d26b20a5cfd..000000000000 --- a/package/wilc-driver/0011-cfg80211.c-fix-build-with-Linux-6.13.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 446911a48cd1a2c740b43a32d0ffa6e3f1887e84 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Sat, 26 Apr 2025 00:40:43 +0200 -Subject: [PATCH] cfg80211.c: fix build with Linux 6.13 - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/8 -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/cfg80211.c b/cfg80211.c -index 25da3a1..d0cd826 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -291,6 +291,9 @@ struct wilc_vif *wilc_get_wl_to_vif(struct wilc *wl) - } - - static int set_channel(struct wiphy *wiphy, -+#if KERNEL_VERSION(6, 13, 0) <= LINUX_VERSION_CODE -+ struct net_device *netdev, -+#endif - struct cfg80211_chan_def *chandef) - { - struct wilc *wl = wiphy_priv(wiphy); --- -2.39.5 - diff --git a/package/wilc-driver/0012-Fix-build-with-Linux-6.14.patch b/package/wilc-driver/0012-Fix-build-with-Linux-6.14.patch deleted file mode 100644 index adcbab4a59ad..000000000000 --- a/package/wilc-driver/0012-Fix-build-with-Linux-6.14.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ea7bdf9c6f37dbed0d7e7a94bd5d6ec20593eb02 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Tue, 1 Jul 2025 19:25:19 +0200 -Subject: [PATCH] Fix build with Linux 6.14 - -Commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a53af85d3bbdbe06cd47b81a6d99a04dc0a3963 -adds argument "unsigned int link_id" to get_tx_power(), so let's add it to -cfg80211_rtw_get_txpower() according to Linux version. - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/9 -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/cfg80211.c b/cfg80211.c -index 5c92062..0e1375c 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -2230,6 +2230,9 @@ static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, - } - - static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)) -+ unsigned int link_id, -+#endif - int *dbm) - { - int ret; --- -2.39.5 - diff --git a/package/wilc-driver/0013-Fix-build-with-Linux-6.15.patch b/package/wilc-driver/0013-Fix-build-with-Linux-6.15.patch deleted file mode 100644 index 2baac53dfc27..000000000000 --- a/package/wilc-driver/0013-Fix-build-with-Linux-6.15.patch +++ /dev/null @@ -1,177 +0,0 @@ -From acdbd9268841a5c0bac477418bb39707d9602957 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Tue, 1 Jul 2025 19:27:01 +0200 -Subject: [PATCH] Fix build with Linux 6.15 - -Commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8fa7292fee5c5240402371ea89ab285ec856c916 -drops del_timer_sync() in favor of timer_delete{_sync}() so let's backport -locally functions del_timer{_sync}() when Linux version is 6.15.0 or later. -Let's also backport crc7_be() and crc_itu_t() sinsce are not selectable -anymore in kernel since commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f5a40fcf82c1d3f26910ebe1c62fec8ae3b85f02 - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/9 -Signed-off-by: Giulio Benetti ---- - netdev.h | 13 +++++++ - spi.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 128 insertions(+) - -diff --git a/netdev.h b/netdev.h -index f06d45a..607a3b5 100644 ---- a/netdev.h -+++ b/netdev.h -@@ -13,6 +13,19 @@ - #include - #include - #include -+#include -+ -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) -+static inline int del_timer_sync(struct timer_list *timer) -+{ -+ return timer_delete_sync(timer); -+} -+ -+static inline int del_timer(struct timer_list *timer) -+{ -+ return timer_delete(timer); -+} -+#endif - - #include "hif.h" - #include "wlan.h" -diff --git a/spi.c b/spi.c -index f7b43e2..5443633 100644 ---- a/spi.c -+++ b/spi.c -@@ -9,10 +9,125 @@ - #include - #include - #include -+#include - - #include "netdev.h" - #include "cfg80211.h" - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) -+/* -+ * Table for CRC-7 (polynomial x^7 + x^3 + 1). -+ * This is a big-endian CRC (msbit is highest power of x), -+ * aligned so the msbit of the byte is the x^6 coefficient -+ * and the lsbit is not used. -+ */ -+static const u8 crc7_be_syndrome_table[256] = { -+ 0x00, 0x12, 0x24, 0x36, 0x48, 0x5a, 0x6c, 0x7e, -+ 0x90, 0x82, 0xb4, 0xa6, 0xd8, 0xca, 0xfc, 0xee, -+ 0x32, 0x20, 0x16, 0x04, 0x7a, 0x68, 0x5e, 0x4c, -+ 0xa2, 0xb0, 0x86, 0x94, 0xea, 0xf8, 0xce, 0xdc, -+ 0x64, 0x76, 0x40, 0x52, 0x2c, 0x3e, 0x08, 0x1a, -+ 0xf4, 0xe6, 0xd0, 0xc2, 0xbc, 0xae, 0x98, 0x8a, -+ 0x56, 0x44, 0x72, 0x60, 0x1e, 0x0c, 0x3a, 0x28, -+ 0xc6, 0xd4, 0xe2, 0xf0, 0x8e, 0x9c, 0xaa, 0xb8, -+ 0xc8, 0xda, 0xec, 0xfe, 0x80, 0x92, 0xa4, 0xb6, -+ 0x58, 0x4a, 0x7c, 0x6e, 0x10, 0x02, 0x34, 0x26, -+ 0xfa, 0xe8, 0xde, 0xcc, 0xb2, 0xa0, 0x96, 0x84, -+ 0x6a, 0x78, 0x4e, 0x5c, 0x22, 0x30, 0x06, 0x14, -+ 0xac, 0xbe, 0x88, 0x9a, 0xe4, 0xf6, 0xc0, 0xd2, -+ 0x3c, 0x2e, 0x18, 0x0a, 0x74, 0x66, 0x50, 0x42, -+ 0x9e, 0x8c, 0xba, 0xa8, 0xd6, 0xc4, 0xf2, 0xe0, -+ 0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54, 0x62, 0x70, -+ 0x82, 0x90, 0xa6, 0xb4, 0xca, 0xd8, 0xee, 0xfc, -+ 0x12, 0x00, 0x36, 0x24, 0x5a, 0x48, 0x7e, 0x6c, -+ 0xb0, 0xa2, 0x94, 0x86, 0xf8, 0xea, 0xdc, 0xce, -+ 0x20, 0x32, 0x04, 0x16, 0x68, 0x7a, 0x4c, 0x5e, -+ 0xe6, 0xf4, 0xc2, 0xd0, 0xae, 0xbc, 0x8a, 0x98, -+ 0x76, 0x64, 0x52, 0x40, 0x3e, 0x2c, 0x1a, 0x08, -+ 0xd4, 0xc6, 0xf0, 0xe2, 0x9c, 0x8e, 0xb8, 0xaa, -+ 0x44, 0x56, 0x60, 0x72, 0x0c, 0x1e, 0x28, 0x3a, -+ 0x4a, 0x58, 0x6e, 0x7c, 0x02, 0x10, 0x26, 0x34, -+ 0xda, 0xc8, 0xfe, 0xec, 0x92, 0x80, 0xb6, 0xa4, -+ 0x78, 0x6a, 0x5c, 0x4e, 0x30, 0x22, 0x14, 0x06, -+ 0xe8, 0xfa, 0xcc, 0xde, 0xa0, 0xb2, 0x84, 0x96, -+ 0x2e, 0x3c, 0x0a, 0x18, 0x66, 0x74, 0x42, 0x50, -+ 0xbe, 0xac, 0x9a, 0x88, 0xf6, 0xe4, 0xd2, 0xc0, -+ 0x1c, 0x0e, 0x38, 0x2a, 0x54, 0x46, 0x70, 0x62, -+ 0x8c, 0x9e, 0xa8, 0xba, 0xc4, 0xd6, 0xe0, 0xf2 -+}; -+ -+/** -+ * crc7_be - update the CRC7 for the data buffer -+ * @crc: previous CRC7 value -+ * @buffer: data pointer -+ * @len: number of bytes in the buffer -+ * Context: any -+ * -+ * Returns the updated CRC7 value. -+ * The CRC7 is left-aligned in the byte (the lsbit is always 0), as that -+ * makes the computation easier, and all callers want it in that form. -+ * -+ */ -+u8 crc7_be(u8 crc, const u8 *buffer, size_t len) -+{ -+ while (len--) -+ crc = crc7_be_syndrome_table[crc ^ *buffer++]; -+ return crc; -+} -+ -+/* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */ -+const u16 crc_itu_t_table[256] = { -+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, -+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, -+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, -+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, -+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, -+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, -+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, -+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, -+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, -+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, -+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, -+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, -+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, -+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, -+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, -+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, -+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, -+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, -+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, -+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, -+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, -+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, -+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, -+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, -+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, -+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, -+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, -+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, -+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, -+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, -+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, -+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 -+}; -+ -+/** -+ * crc_itu_t - Compute the CRC-ITU-T for the data buffer -+ * -+ * @crc: previous CRC value -+ * @buffer: data pointer -+ * @len: number of bytes in the buffer -+ * -+ * Returns the updated CRC value -+ */ -+u16 crc_itu_t(u16 crc, const u8 *buffer, size_t len) -+{ -+ while (len--) -+ crc = crc_itu_t_byte(crc, *buffer++); -+ return crc; -+} -+#endif -+ - static bool enable_crc7; /* protect SPI commands with CRC7 */ - module_param(enable_crc7, bool, 0644); - MODULE_PARM_DESC(enable_crc7, --- -2.39.5 - diff --git a/package/wilc-driver/0014-Fix-build-for-kernel-6.16.patch b/package/wilc-driver/0014-Fix-build-for-kernel-6.16.patch deleted file mode 100644 index bf4a8106af64..000000000000 --- a/package/wilc-driver/0014-Fix-build-for-kernel-6.16.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 8ee37436cfa1bdac354ff63e17b647e7b5fb20f9 Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Mon, 8 Sep 2025 21:14:22 +0200 -Subject: [PATCH] Fix build for kernel 6.16 - -With commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=41cb08555c4164996d67c78b3bf1c658075b75f1 -from_timer() has been renamed to timer_container_of() so let's rename -according to linux version >= 6.16. - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/10 -Signed-off-by: Giulio Benetti ---- - netdev.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/netdev.h b/netdev.h -index 607a3b5..33708ad 100644 ---- a/netdev.h -+++ b/netdev.h -@@ -15,6 +15,10 @@ - #include - #include - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)) -+#define from_timer timer_container_of -+#endif -+ - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) - static inline int del_timer_sync(struct timer_list *timer) - { --- -2.43.0 - diff --git a/package/wilc-driver/0015-Fix-build-for-kernel-6.17.patch b/package/wilc-driver/0015-Fix-build-for-kernel-6.17.patch deleted file mode 100644 index 4d5934bdd4db..000000000000 --- a/package/wilc-driver/0015-Fix-build-for-kernel-6.17.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 00895566e07808a0c61d45464797d7cba2eb256c Mon Sep 17 00:00:00 2001 -From: Giulio Benetti -Date: Fri, 10 Oct 2025 21:58:14 +0200 -Subject: [PATCH] Fix build for kernel 6.17 - -* With commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b74947b4f6ff7c122a1bb6eb38bb7ecfbb1d3820 -set_wiphy_params(), set/get_tx_power() and set_antenna() gain argument -radio_idx to get radio index. So let's add that argument according to -linux version >= 6.17. -* With commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a5589313383074c48a1b3751d592a6e084ae0573 -devm_gpio_request() is dropped in favor of devm_gpio_request_one(). -devm_gpio_request_one() requires flags to setup gpio status, but it's -not specified in wilc_of_parse_power_pins() so keep them as GPIOF_IN -since they get defined in wilc_wlan_power() called very soon after -wilc_of_parse_power_pins(). - -Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/11 -Signed-off-by: Giulio Benetti ---- - cfg80211.c | 15 +++++++++++++++ - power.c | 12 +++++++++++- - 2 files changed, 26 insertions(+), 1 deletion(-) - -diff --git a/cfg80211.c b/cfg80211.c -index 0e1375c..a7db9e6 100644 ---- a/cfg80211.c -+++ b/cfg80211.c -@@ -997,7 +997,11 @@ static int change_bss(struct wiphy *wiphy, struct net_device *dev, - return 0; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+static int set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed) -+#else - static int set_wiphy_params(struct wiphy *wiphy, u32 changed) -+#endif - { - int ret = -EINVAL; - struct cfg_param_attr cfg_param_val; -@@ -2198,6 +2202,9 @@ static void wilc_set_wakeup(struct wiphy *wiphy, bool enabled) - } - - static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+ int radio_idx, -+#endif - enum nl80211_tx_power_setting type, int mbm) - { - int ret; -@@ -2230,6 +2237,9 @@ static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, - } - - static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+ int radio_idx, -+#endif - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0)) - unsigned int link_id, - #endif -@@ -2252,7 +2262,12 @@ static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, - return ret; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+static int set_antenna(struct wiphy *wiphy, int radio_idx, u32 tx_ant, -+ u32 rx_ant) -+#else - static int set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant) -+#endif - { - int ret; - struct wilc *wl = wiphy_priv(wiphy); -diff --git a/power.c b/power.c -index 6ab8d63..1cc391d 100644 ---- a/power.c -+++ b/power.c -@@ -1,4 +1,4 @@ --#include -+#include OA - #include - #include - #include -@@ -37,11 +37,21 @@ int wilc_of_parse_power_pins(struct wilc *wilc) - !gpio_is_valid(power->gpios.reset)) - return -EINVAL; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+ ret = devm_gpio_request_one(wilc->dev, power->gpios.chip_en, GPIOF_IN, -+ "CHIP_EN"); -+#else - ret = devm_gpio_request(wilc->dev, power->gpios.chip_en, "CHIP_EN"); -+#endif - if (ret) - return ret; - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)) -+ ret = devm_gpio_request_one(wilc->dev, power->gpios.reset, GPIOF_IN, -+ "RESET"); -+#else - ret = devm_gpio_request(wilc->dev, power->gpios.reset, "RESET"); -+#endif - return ret; - } - --- -2.47.3 - diff --git a/package/wilc-driver/wilc-driver.hash b/package/wilc-driver/wilc-driver.hash index 4ada813ed8df..ff2f282eec65 100644 --- a/package/wilc-driver/wilc-driver.hash +++ b/package/wilc-driver/wilc-driver.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 4796b1a53781f8702a335b0146d488a9422b71dab39f6f154f955b0ad1711199 wilc-driver-linux4microchip-2021.10-1.tar.gz +sha256 3baad326c84b212e7ee960e6afc3e0f4c2f4a770a35c0990f040bd9d845ace8a wilc-driver-2fe5db970acc0c0df1cfd6a49087ee87dfdd01f8.tar.gz sha256 f6b78c087c3ebdf0f3c13415070dd480a3f35d8fc76f3d02180a407c1c812f79 LICENSE diff --git a/package/wilc-driver/wilc-driver.mk b/package/wilc-driver/wilc-driver.mk index a7a902b6db42..f33cd49f027e 100644 --- a/package/wilc-driver/wilc-driver.mk +++ b/package/wilc-driver/wilc-driver.mk @@ -4,8 +4,8 @@ # ################################################################################ -WILC_DRIVER_VERSION = linux4microchip-2021.10-1 -WILC_DRIVER_SITE = $(call github,embeddedTS,wilc3000-external-module,$(WILC_DRIVER_VERSION)) +WILC_DRIVER_VERSION = 2fe5db970acc0c0df1cfd6a49087ee87dfdd01f8 +WILC_DRIVER_SITE = $(call github,benetti-engineering,wilc3000-external-module,$(WILC_DRIVER_VERSION)) WILC_DRIVER_LICENSE = GPL-2.0 WILC_DRIVER_LICENSE_FILES = LICENSE From 8e4c663529d135088c78a9c7f4b59354f19d6580 Mon Sep 17 00:00:00 2001 From: Jakob Kastelic Date: Tue, 16 Sep 2025 19:45:40 -0700 Subject: [PATCH 03/22] boot/arm-trusted-firmware: optional Linux as BL33 Arm Trusted Firmware (TF-A) can be used to load U-Boot or another bootloader, which in turn loads the Linux kernel. However, TF-A is capable of loading the kernel directly. To this end, we need to define the BL33 and BL33_CFG compile options containing, respectively, the zImage and the DTB. This config introduces a new config option, BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33, which sets the BL33 and BL33_CFG parameters, and ensures that the kernel is built before the TF-A by having linux as a _DEPENDENCY of the TF-A. Signed-off-by: Jakob Kastelic Signed-off-by: Thomas Petazzoni --- boot/arm-trusted-firmware/Config.in | 13 +++++++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index 5eee2362ea85..70fdec5c2aef 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -196,6 +196,19 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33 for the 'qemu_sbsa' platform. In this case, due to the EDK2 build system, the dependency between ATF and EDK is reversed. +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33 + bool "Linux kernel" + depends on BR2_LINUX_KERNEL + depends on (BR2_arm || BR2_armeb) + depends on (BR2_LINUX_KERNEL_ZIMAGE || BR2_LINUX_KERNEL_APPENDED_ZIMAGE) + help + This option allows to embed the Linux kernel as the BL33 + part of the ARM Trusted Firmware. + + Do not choose this option if you intend to use U-Boot or + another second-stage bootloader. With this option, TF-A + starts Linux directly. + endchoice if BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_AS_BL33 diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index bb113741d6c2..b81ce0d8275f 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -129,6 +129,14 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UB ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/zImage +ifeq ($(ARM_TRUSTED_FIRMWARE_PLATFORM),stm32mp1) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33_CFG=$(BINARIES_DIR)/$(LINUX_DTBS) +endif +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += linux +endif + ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware From bc2d04f30ddcabaa624479319f6dd54421f8767d Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Tue, 3 Feb 2026 09:04:16 +0100 Subject: [PATCH 04/22] package/depot-tools: fix python 3.14 support Backport a fix to support python 3.14 [1]. depot-tools is used to build flutter package but it doesn't run due to deprecated ast.Str et al. (since Py3.8) that was removed from python 3.14. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/12944797062 [1] https://chromium.googlesource.com/chromium/tools/depot_tools/+/80d6ca1b1ac55fbd9dd8f506417824591251b8eb Cc: Adam Duskett Signed-off-by: Romain Naour Signed-off-by: Thomas Petazzoni --- ...precated-ast-types-with-ast.Constant.patch | 244 ++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 package/depot-tools/0002-Replace-deprecated-ast-types-with-ast.Constant.patch diff --git a/package/depot-tools/0002-Replace-deprecated-ast-types-with-ast.Constant.patch b/package/depot-tools/0002-Replace-deprecated-ast-types-with-ast.Constant.patch new file mode 100644 index 000000000000..09e88d04a217 --- /dev/null +++ b/package/depot-tools/0002-Replace-deprecated-ast-types-with-ast.Constant.patch @@ -0,0 +1,244 @@ +From 7d467257a7cd57e746885ea73ccbda903450b461 Mon Sep 17 00:00:00 2001 +From: jj +Date: Fri, 5 Dec 2025 11:47:42 -0800 +Subject: [PATCH] Replace deprecated ast types with ast.Constant + +ast.Str et al. have been deprecated since Py3.8 and have been +completely removed in 3.14. Replace their usage with ast.Constant. + +This change should not have any functional impact, since +according to [1]: +> Changed in version 3.8: Class ast.Constant is now used for +> all constants. +> Deprecated since version 3.8: Old classes ast.Num, ast.Str, +> [...] instantiating them will return an instance of a +> different class. + +[1] https://docs.python.org/3/library/ast.html + +Bug: 40283283 +Change-Id: I0ed8ef3910f921483bff118976f516c5a935e0fc +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7228507 +Reviewed-by: Gavin Mak +Reviewed-by: Yiwei Zhang +Commit-Queue: jj + +Upstream: https://chromium.googlesource.com/chromium/tools/depot_tools/+/80d6ca1b1ac55fbd9dd8f506417824591251b8eb +[Romain: backport to 097e2072377] +Signed-off-by: Romain Naour +--- + gclient_eval.py | 72 ++++++++++++++++++++-------------- + tests/gclient_eval_unittest.py | 6 +++ + 2 files changed, 49 insertions(+), 29 deletions(-) + +diff --git a/gclient_eval.py b/gclient_eval.py +index f8a05d78a..94874e3ce 100644 +--- a/gclient_eval.py ++++ b/gclient_eval.py +@@ -101,6 +101,24 @@ def _NodeDictSchema(dict_schema): + return validate + + ++def _IsConstant(node): ++ return isinstance(node, ast.Constant) ++ ++ ++def _IsStringConstant(node): ++ return _IsConstant(node) and isinstance(node.value, str) ++ ++ ++def _IsNameConstant(node): ++ return _IsConstant(node) \ ++ and isinstance(node.value, (bool, type(None))) ++ ++ ++def _IsNumericConstant(node): ++ return _IsConstant(node) \ ++ and isinstance(node.value, (int, float, complex)) \ ++ and not isinstance(node.value, bool) ++ + # See https://github.com/keleshev/schema for docs how to configure schema. + _GCLIENT_DEPS_SCHEMA = _NodeDictSchema({ + schema.Optional(str): +@@ -316,18 +334,18 @@ def _gclient_eval(node_or_string, filename='', vars_dict=None): + node_or_string = node_or_string.body + + def _convert(node): +- if isinstance(node, ast.Str): ++ if _IsStringConstant(node): + if vars_dict is None: +- return node.s ++ return node.value + try: +- return node.s.format(**vars_dict) ++ return node.value.format(**vars_dict) + except KeyError as e: + raise KeyError( + '%s was used as a variable, but was not declared in the vars dict ' + '(file %r, line %s)' % + (e.args[0], filename, getattr(node, 'lineno', ''))) +- elif isinstance(node, ast.Num): +- return node.n ++ elif _IsNameConstant(node) or _IsNumericConstant(node): ++ return node.value + elif isinstance(node, ast.Tuple): + return tuple(map(_convert, node.elts)) + elif isinstance(node, ast.List): +@@ -349,9 +367,6 @@ def _gclient_eval(node_or_string, filename='', vars_dict=None): + 'invalid name %r (file %r, line %s)' % + (node.id, filename, getattr(node, 'lineno', ''))) + return _allowed_names[node.id] +- elif not sys.version_info[:2] < (3, 4) and isinstance( +- node, ast.NameConstant): # Since Python 3.4 +- return node.value + elif isinstance(node, ast.Call): + if (not isinstance(node.func, ast.Name) + or (node.func.id not in ('Str', 'Var'))): +@@ -366,8 +381,8 @@ def _gclient_eval(node_or_string, filename='', vars_dict=None): + ''))) + + if node.func.id == 'Str': +- if isinstance(node.args[0], ast.Str): +- return ConstantString(node.args[0].s) ++ if _IsStringConstant(node.args[0]): ++ return ConstantString(node.args[0].value) + raise ValueError( + 'Passed a non-string to Str() (file %r, line%s)' % + (filename, getattr(node, 'lineno', ''))) +@@ -594,8 +609,8 @@ def EvaluateCondition(condition, variables, referenced_variables=None): + main_node = main_node.body + + def _convert(node, allow_tuple=False): +- if isinstance(node, ast.Str): +- return node.s ++ if _IsStringConstant(node): ++ return node.value + + if isinstance(node, ast.Tuple) and allow_tuple: + return tuple(map(_convert, node.elts)) +@@ -627,8 +642,7 @@ def EvaluateCondition(condition, variables, referenced_variables=None): + # be evaluated. + return node.id + +- if not sys.version_info[:2] < (3, 4) and isinstance( +- node, ast.NameConstant): # Since Python 3.4 ++ if _IsNameConstant(node): + return node.value + + if isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): +@@ -696,11 +710,11 @@ def _UpdateAstString(tokens, node, value): + node = node.args[0] + position = node.lineno, node.col_offset + quote_char = '' +- if isinstance(node, ast.Str): ++ if _IsStringConstant(node): + quote_char = tokens[position][1][0] + value = value.encode('unicode_escape').decode('utf-8') + tokens[position][1] = quote_char + value + quote_char +- node.s = value ++ node.value = value + + + def _ShiftLinesInTokens(tokens, delta, start): +@@ -793,11 +807,11 @@ def SetVar(gclient_dict, var_name, value): + + def _GetVarName(node): + if isinstance(node, ast.Call): +- return node.args[0].s ++ return node.args[0].value + +- if node.s.endswith('}'): +- last_brace = node.s.rfind('{') +- return node.s[last_brace + 1:-1] ++ if node.value.endswith('}'): ++ last_brace = node.value.rfind('{') ++ return node.value[last_brace + 1:-1] + return None + + +@@ -821,9 +835,9 @@ def SetGCS(gclient_dict, dep_name, new_objects): + keys_to_update = ('object_name', 'sha256sum', 'size_bytes', 'generation') + for index, object_node in enumerate(objects_node.elts): + for key, value in zip(object_node.keys, object_node.values): +- if key.s not in keys_to_update: ++ if key.value not in keys_to_update: + continue +- _UpdateAstString(tokens, value, new_objects[index][key.s]) ++ _UpdateAstString(tokens, value, new_objects[index][key.value]) + + node.SetNode('objects', new_objects, objects_node) + +@@ -855,7 +869,7 @@ def SetCIPD(gclient_dict, dep_name, package_name, new_version): + "The deps entry for %s:%s has no formatting information." % + (dep_name, package_name)) + +- if not isinstance(node, ast.Call) and not isinstance(node, ast.Str): ++ if not isinstance(node, ast.Call) and not _IsStringConstant(node): + raise ValueError( + "Unsupported dependency revision format. Please file a bug to the " + "Infra>SDK component in crbug.com") +@@ -880,15 +894,15 @@ def SetRevision(gclient_dict, dep_name, new_revision): + if isinstance(node, ast.BinOp): + node = node.right + +- if isinstance(node, ast.Str): ++ if _IsStringConstant(node): + token = _gclient_eval(tokens[node.lineno, node.col_offset][1]) +- if token != node.s: ++ if token != node.value: + raise ValueError( + 'Can\'t update value for %s. Multiline strings and implicitly ' + 'concatenated strings are not supported.\n' + 'Consider reformatting the DEPS file.' % dep_key) + +- if not isinstance(node, ast.Call) and not isinstance(node, ast.Str): ++ if not isinstance(node, ast.Call) and not _IsStringConstant(node): + raise ValueError( + "Unsupported dependency revision format. Please file a bug to the " + "Infra>SDK component in crbug.com") +@@ -897,15 +911,15 @@ def SetRevision(gclient_dict, dep_name, new_revision): + if var_name is not None: + SetVar(gclient_dict, var_name, new_revision) + else: +- if '@' in node.s: ++ if '@' in node.value: + # '@' is part of the last string, which we want to modify. + # Discard whatever was after the '@' and put the new revision in + # its place. +- new_revision = node.s.split('@')[0] + '@' + new_revision ++ new_revision = node.value.split('@')[0] + '@' + new_revision + elif '@' not in dep_dict[dep_key]: + # '@' is not part of the URL at all. This mean the dependency is + # unpinned and we should pin it. +- new_revision = node.s + '@' + new_revision ++ new_revision = node.value + '@' + new_revision + _UpdateAstString(tokens, node, new_revision) + dep_dict.SetNode(dep_key, new_revision, node) + +diff --git a/tests/gclient_eval_unittest.py b/tests/gclient_eval_unittest.py +index 03decdf30..3aed06156 100755 +--- a/tests/gclient_eval_unittest.py ++++ b/tests/gclient_eval_unittest.py +@@ -30,6 +30,11 @@ class GClientEvalTest(unittest.TestCase): + def test_str(self): + self.assertEqual('foo', gclient_eval._gclient_eval('"foo"')) + ++ def test_num(self): ++ self.assertEqual(42, gclient_eval._gclient_eval('42')) ++ self.assertEqual(1024.0, gclient_eval._gclient_eval('1024.0')) ++ self.assertEqual(42j, gclient_eval._gclient_eval('42j')) ++ + def test_tuple(self): + self.assertEqual(('a', 'b'), gclient_eval._gclient_eval('("a", "b")')) + +@@ -40,6 +45,7 @@ class GClientEvalTest(unittest.TestCase): + self.assertEqual({'a': 'b'}, gclient_eval._gclient_eval('{"a": "b"}')) + + def test_name_safe(self): ++ self.assertEqual(None, gclient_eval._gclient_eval('None')) + self.assertEqual(True, gclient_eval._gclient_eval('True')) + + def test_name_unsafe(self): +-- +2.52.0 + From 53c2c0903dcddc364cd231648af36122c09c0b3f Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Tue, 3 Feb 2026 08:58:18 +0100 Subject: [PATCH 05/22] package/mpg123: add sdl2 support mpg123 supports (and prefers) SDL2 as well for the sdl backends since 1.26.9 with: https://github.com/madebr/mpg123/commit/792615f6512a0908081b5a2e98ca61f8677ed452 So support that here as well. Signed-off-by: Peter Korsgaard Signed-off-by: Thomas Petazzoni --- package/mpg123/mpg123.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/mpg123/mpg123.mk b/package/mpg123/mpg123.mk index 2f04e0f979be..23e061614d90 100644 --- a/package/mpg123/mpg123.mk +++ b/package/mpg123/mpg123.mk @@ -64,10 +64,10 @@ MPG123_DEPENDENCIES += portaudio MPG123_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs portaudio-2.0`" endif -ifeq ($(BR2_PACKAGE_SDL),y) +ifneq ($(BR2_PACKAGE_SDL)$(BR2_PACKAGE_SDL2),) MPG123_AUDIO += sdl MPG123_CONF_OPTS += --with-default-audio=sdl -MPG123_DEPENDENCIES += sdl +MPG123_DEPENDENCIES += $(if $(BR2_PACKAGE_SDL2),sdl2,sdl) endif ifeq ($(BR2_PACKAGE_ALSA_LIB),y) From 2f218b1c291e07e30f9a43991cc57c4137606660 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Sun, 4 Jan 2026 18:22:26 +0100 Subject: [PATCH 06/22] DEVELOPERS: add Giulio Benetti to package bind Signed-off-by: Giulio Benetti Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 1 + 1 file changed, 1 insertion(+) diff --git a/DEVELOPERS b/DEVELOPERS index 9fedc81332ed..280d00d13e2a 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1289,6 +1289,7 @@ F: configs/mangopi_mq1rdw2_defconfig F: configs/olimex_a* F: configs/rockpro64_defconfig F: package/at/ +F: package/bind/ F: package/binutils/ F: package/cryptsetup/ F: package/dash/ From 34ed3bbf0a5f2576043ff627c76df584ea936a71 Mon Sep 17 00:00:00 2001 From: El Mehdi YOUNES Date: Fri, 8 Aug 2025 15:31:08 +0200 Subject: [PATCH 07/22] package/rust-bindgen: add runtime host-clang dependency According to the official requirements, bindgen needs libclang to parse C/C++ headers. libclang is loaded at runtime by bindgen, which is why we didn't notice any build issue. However, using bindgen on a simple header file blows up: thread 'main' panicked at bindgen/lib.rs:616:27: Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], s et the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace So far, bindgen was only used by mesa3d, and it turns out that mesa3d also depends on clang, which pulls in host-clang, so the problem was not visible. However, as we're about to use bindgen for other things (namely Rust support in Linux), this issue needs to be fixed. See: https://rust-lang.github.io/rust-bindgen/requirements.html Signed-off-by: El Mehdi YOUNES Signed-off-by: Thomas Petazzoni --- package/rust-bindgen/rust-bindgen.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/rust-bindgen/rust-bindgen.mk b/package/rust-bindgen/rust-bindgen.mk index 349d4c367019..8c02db557fa3 100644 --- a/package/rust-bindgen/rust-bindgen.mk +++ b/package/rust-bindgen/rust-bindgen.mk @@ -9,6 +9,11 @@ RUST_BINDGEN_SITE = $(call github,rust-lang,rust-bindgen,v$(RUST_BINDGEN_VERSION RUST_BINDGEN_LICENSE = BSD-3-clause RUST_BINDGEN_LICENSE_FILES = LICENSE +# This is actually a runtime dependency (bindgen loads libclang at +# runtime), but as it's a host package, we have no other option but to +# handle it as a build dependency. +HOST_RUST_BINDGEN_DEPENDENCIES = host-clang + # The Cargo.toml at the root directory is a "virtual manifest". # Since we only want to build and install bindgen use the Cargo.toml # from the bindgen-cli subdirectory. From c15b507838f7d7315610340fcfd1656a62e02cf2 Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Tue, 3 Feb 2026 12:39:47 +0100 Subject: [PATCH 08/22] package/safeclib: properly format upstream information in patch Patch 0001 has the upstream information, just not properly formatted, so we fix this. Signed-off-by: Bernd Kuhls [Thomas: extracted from a bigger patch from Bernd] Signed-off-by: Thomas Petazzoni --- .checkpackageignore | 1 - package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.checkpackageignore b/.checkpackageignore index 1e4e081e830d..0bf57b8ac2f6 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -866,7 +866,6 @@ package/rubix/0001-dont-use-legacy-functions.patch lib_patch.Upstream package/rubix/0002-misc-fixes.patch lib_patch.Sob lib_patch.Upstream package/rygel/S99rygel Shellcheck lib_sysv.Indent lib_sysv.Variables package/s6-linux-init/0001-configure-add-D_GNU_SOURCE.patch lib_patch.Upstream -package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch lib_patch.Upstream package/samba4/0001-build-find-pre-built-heimdal-build-tools-in-case-of-.patch lib_patch.Upstream package/samba4/0002-ldap_message_test.c-include-stdint.h-before-cmoka.h.patch lib_patch.Upstream package/samba4/S91smb Shellcheck lib_sysv.Indent lib_sysv.Variables diff --git a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch b/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch index 3cb37b96f50d..75f4c2bf900b 100644 --- a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch +++ b/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch @@ -7,8 +7,7 @@ some armv7 buildroot variants fail on asm. we already probe for that, so use it. Fixes GH #115 -[Retrieved from: -https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c] +Upstream: https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c Signed-off-by: Fabrice Fontaine --- tests/perf_private.h | 49 +++++++++++++++++++++++++------------------- From 34749a2d3e8f95ed3eb262dc9a4319acb44f8c0b Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Tue, 3 Feb 2026 12:47:25 +0100 Subject: [PATCH 09/22] package/safeclib: fix build with gcc >= 14.x Backport two upstream patches to fix build errors introduced by the bump of gcc to 14.x. Fixes: https://autobuild.buildroot.net/results/af6/af65e6386439098ddf706ca43e99320cf5e9fd80/ Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- ...snprintf_s-Increase-Buffer-Size-by-1.patch | 51 +++++++++++++++++++ ...snprintf_s-Increase-Buffer-Size-by-1.patch | 49 ++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch create mode 100644 package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch diff --git a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch new file mode 100644 index 000000000000..eae11dcc0d46 --- /dev/null +++ b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch @@ -0,0 +1,51 @@ +From 62051f9761f92dc99c8ce0552239ad10e2062168 Mon Sep 17 00:00:00 2001 +From: Bernd Kuhls +Date: Sat, 10 Jan 2026 12:16:22 +0100 +Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1 + +Another fix similar to https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0 + +In function 'safec_ntoa_format', + inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12: +str/vsnprintf_s.c:256:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=] + 256 | buf[len++] = '0'; + | ~~~~~~~~~~~^~~~~ +str/vsnprintf_s.c: In function 'safec_ntoa_long': +str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32 + 312 | char buf[PRINTF_NTOA_BUFFER_SIZE]; + | ^~~ +In function 'safec_ntoa_format', + inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12: +str/vsnprintf_s.c:260:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=] + 260 | buf[len++] = '0'; + | ~~~~~~~~~~~^~~~~ +str/vsnprintf_s.c: In function 'safec_ntoa_long': +str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32 + 312 | char buf[PRINTF_NTOA_BUFFER_SIZE]; + | ^~~ +cc1: all warnings being treated as errors + +Upstream: https://github.com/rurban/safeclib/pull/150 + +[backported to version 3.7.1] +Signed-off-by: Bernd Kuhls +--- + src/str/vsnprintf_s.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c +index 59dbda94..ca838df1 100644 +--- a/src/str/vsnprintf_s.c ++++ b/src/str/vsnprintf_s.c +@@ -296,7 +296,7 @@ static size_t safec_ntoa_long(out_fct_type out, const char *funcname, + unsigned long base, unsigned int prec, + unsigned int width, unsigned int flags) + { +- char buf[PRINTF_NTOA_BUFFER_SIZE]; ++ char buf[PRINTF_NTOA_BUFFER_SIZE + 1]; + size_t len = 0U; + + // no hash for 0 values +-- +2.47.3 + diff --git a/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch new file mode 100644 index 000000000000..2dabebf3b289 --- /dev/null +++ b/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch @@ -0,0 +1,49 @@ +From dea3c2e1aa1b775baa690b9ef40239f881c5f068 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 13 Aug 2025 20:23:48 -0700 +Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1 + +It is a buffer overflow warning that GCC 15.2 is catching. +The issue is that it's trying to write to `buf[len++]` when len could +potentially be 31, which would write to buf[31] in a buffer of size 32 +(valid indices 0-31), but the len++ post-increment means it could +theoretically write beyond the buffer bounds. + +Fixes + +../../sources/safec-3.9.1/src/str/vsnprintf_s.c: In function 'safec_ftoa.isra': +../../sources/safec-3.9.1/src/str/vsnprintf_s.c:523:24: error: writing 32 bytes into a region of size 31 [-Werror=stringop-overflow=] + 523 | buf[len++] = '0'; + | ~~~~~~~~~~~^~~~~ +../../sources/safec-3.9.1/src/str/vsnprintf_s.c:394:10: note: at offset [1, 32] into destination object 'buf' of size 32 + 394 | char buf[PRINTF_FTOA_BUFFER_SIZE]; + | ^~~ +cc1: all warnings being treated as errors + +Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/148] +Signed-off-by: Khem Raj + +Upstream: https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0 + +[backported to version 3.7.1] +Signed-off-by: Bernd Kuhls +--- + src/str/vsnprintf_s.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c +index ca838df1..8ef6989a 100644 +--- a/src/str/vsnprintf_s.c ++++ b/src/str/vsnprintf_s.c +@@ -369,7 +369,7 @@ static size_t safec_ftoa(out_fct_type out, const char *funcname, + double value, unsigned int prec, unsigned int width, + unsigned int flags) + { +- char buf[PRINTF_FTOA_BUFFER_SIZE]; ++ char buf[PRINTF_FTOA_BUFFER_SIZE + 1]; + size_t len = 0U; + double tmp; + double diff = 0.0; +-- +2.47.3 + From 5bfd193bed7fcb8a3968935067bbe67aa2e5913e Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sat, 10 Jan 2026 14:39:05 +0100 Subject: [PATCH 10/22] package/safeclib: bump version to 3.9.1 https://github.com/rurban/safeclib/blob/v3.9.1/ChangeLog Removed backports from patches 0001 & 0002. Removed patch 0003 which is included in this release. Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- ...01-fix-armv7-asm-inline-error-GH-115.patch | 155 ------------------ ...snprintf_s-Increase-Buffer-Size-by-1.patch | 51 ------ ...snprintf_s-Increase-Buffer-Size-by-1.patch | 49 ------ package/safeclib/safeclib.hash | 4 +- package/safeclib/safeclib.mk | 2 +- 5 files changed, 3 insertions(+), 258 deletions(-) delete mode 100644 package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch delete mode 100644 package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch delete mode 100644 package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch diff --git a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch b/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch deleted file mode 100644 index 75f4c2bf900b..000000000000 --- a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 9c739800a8915d5f2a73c840190920e95ffa1c5c Mon Sep 17 00:00:00 2001 -From: Reini Urban -Date: Fri, 18 Feb 2022 09:46:45 +0100 -Subject: [PATCH] fix armv7 asm inline error GH #115 - -some armv7 buildroot variants fail on asm. -we already probe for that, so use it. -Fixes GH #115 - -Upstream: https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c -Signed-off-by: Fabrice Fontaine ---- - tests/perf_private.h | 49 +++++++++++++++++++++++++------------------- - 1 file changed, 28 insertions(+), 21 deletions(-) - -diff --git a/tests/perf_private.h b/tests/perf_private.h -index 3296cb3d..843674d3 100644 ---- a/tests/perf_private.h -+++ b/tests/perf_private.h -@@ -1,9 +1,9 @@ - /*------------------------------------------------------------------ - * perf_private.h - Internal benchmarking tools - * -- * 2020 Reini Urban -+ * 2020,2022 Reini Urban - * -- * Copyright (c) 2017, 2020 Reini Urban -+ * Copyright (c) 2017, 2020, 2022 Reini Urban - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person -@@ -55,13 +55,16 @@ static inline uint64_t timer_start(); - static inline uint64_t timer_end(); - - static inline clock_t rdtsc() { --#ifdef __x86_64__ -+#ifndef ASM_INLINE -+#define NO_CYCLE_COUNTER -+ return clock(); -+#elif defined __x86_64__ - uint64_t a, d; -- __asm__ volatile("rdtsc" : "=a"(a), "=d"(d)); -+ ASM_INLINE volatile("rdtsc" : "=a"(a), "=d"(d)); - return (clock_t)(a | (d << 32)); - #elif defined(__i386__) - clock_t x; -- __asm__ volatile("rdtsc" : "=A"(x)); -+ ASM_INLINE volatile("rdtsc" : "=A"(x)); - return x; - #elif defined(__ARM_ARCH) && (__ARM_ARCH >= 7) && (SIZEOF_SIZE_T == 4) - // V7 is the earliest arch that has a standard cyclecount (some say 6) -@@ -69,11 +72,11 @@ static inline clock_t rdtsc() { - uint32_t pmuseren; - uint32_t pmcntenset; - // Read the user mode perf monitor counter access permissions. -- asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren)); -+ ASM_INLINE volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren)); - if (pmuseren & 1) { // Allows reading perfmon counters for user mode code. -- asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset)); -+ ASM_INLINE volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset)); - if (pmcntenset & 0x80000000ul) { // Is it counting? -- asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr)); -+ ASM_INLINE volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr)); - // The counter is set up to count every 64th cycle - return (int64_t)(pmccntr) * 64; // Should optimize to << 6 - } -@@ -83,22 +86,22 @@ static inline clock_t rdtsc() { - uint64_t pmccntr; - uint64_t pmuseren = 1UL; - // Read the user mode perf monitor counter access permissions. -- //asm volatile("mrs cntv_ctl_el0, %0" : "=r" (pmuseren)); -+ //ASM_INLINE volatile("mrs cntv_ctl_el0, %0" : "=r" (pmuseren)); - if (pmuseren & 1) { // Allows reading perfmon counters for user mode code. -- asm volatile("mrs %0, cntvct_el0" : "=r" (pmccntr)); -+ ASM_INLINE volatile("mrs %0, cntvct_el0" : "=r" (pmccntr)); - return (uint64_t)(pmccntr) * 64; // Should optimize to << 6 - } - return (uint64_t)rdtsc(); - #elif defined(__powerpc64__) || defined(__ppc64__) - uint64_t tb; -- __asm__ volatile (\ -+ ASM_INLINE volatile (\ - "mfspr %0, 268" - : "=r" (tb)); - return tb; - #elif defined(__powerpc__) || defined(__ppc__) - // This returns a time-base, which is not always precisely a cycle-count. - uint32_t tbu, tbl, tmp; -- __asm__ volatile (\ -+ ASM_INLINE volatile (\ - "0:\n" - "mftbu %0\n" - "mftbl %1\n" -@@ -109,12 +112,12 @@ static inline clock_t rdtsc() { - return (((uint64_t) tbu << 32) | tbl); - #elif defined(__sparc__) - uint64_t tick; -- asm(".byte 0x83, 0x41, 0x00, 0x00"); -- asm("mov %%g1, %0" : "=r" (tick)); -+ ASM_INLINE(".byte 0x83, 0x41, 0x00, 0x00"); -+ ASM_INLINE("mov %%g1, %0" : "=r" (tick)); - return tick; - #elif defined(__ia64__) - uint64_t itc; -- asm("mov %0 = ar.itc" : "=r" (itc)); -+ ASM_INLINE("mov %0 = ar.itc" : "=r" (itc)); - return itc; - #else - #define NO_CYCLE_COUNTER -@@ -126,9 +129,11 @@ static inline clock_t rdtsc() { - // 3.2.1 The Improved Benchmarking Method - static inline uint64_t timer_start() - { --#if defined (__i386__) || (defined(__x86_64__) && SIZEOF_SIZE_T == 4) -+#ifndef ASM_INLINE -+ return (uint64_t)rdtsc(); -+#elif defined (__i386__) || (defined(__x86_64__) && SIZEOF_SIZE_T == 4) - uint32_t cycles_high, cycles_low; -- __asm__ volatile -+ ASM_INLINE volatile - ("cpuid\n\t" - "rdtsc\n\t" - "mov %%edx, %0\n\t" -@@ -137,7 +142,7 @@ static inline uint64_t timer_start() - return ((uint64_t)cycles_high << 32) | cycles_low; - #elif defined __x86_64__ - uint32_t cycles_high, cycles_low; -- __asm__ volatile -+ ASM_INLINE volatile - ("cpuid\n\t" - "rdtsc\n\t" - "mov %%edx, %0\n\t" -@@ -151,9 +156,11 @@ static inline uint64_t timer_start() - - static inline uint64_t timer_end() - { --#if defined (__i386__) || (defined(__x86_64__) && defined (HAVE_BIT32)) -+#ifndef ASM_INLINE -+ return (uint64_t)rdtsc(); -+#elif defined (__i386__) || (defined(__x86_64__) && defined (HAVE_BIT32)) - uint32_t cycles_high, cycles_low; -- __asm__ volatile -+ ASM_INLINE volatile - ("rdtscp\n\t" - "mov %%edx, %0\n\t" - "mov %%eax, %1\n\t" -@@ -162,7 +169,7 @@ static inline uint64_t timer_end() - return ((uint64_t)cycles_high << 32) | cycles_low; - #elif defined __x86_64__ - uint32_t cycles_high, cycles_low; -- __asm__ volatile -+ ASM_INLINE volatile - ("rdtscp\n\t" - "mov %%edx, %0\n\t" - "mov %%eax, %1\n\t" diff --git a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch deleted file mode 100644 index eae11dcc0d46..000000000000 --- a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 62051f9761f92dc99c8ce0552239ad10e2062168 Mon Sep 17 00:00:00 2001 -From: Bernd Kuhls -Date: Sat, 10 Jan 2026 12:16:22 +0100 -Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1 - -Another fix similar to https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0 - -In function 'safec_ntoa_format', - inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12: -str/vsnprintf_s.c:256:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=] - 256 | buf[len++] = '0'; - | ~~~~~~~~~~~^~~~~ -str/vsnprintf_s.c: In function 'safec_ntoa_long': -str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32 - 312 | char buf[PRINTF_NTOA_BUFFER_SIZE]; - | ^~~ -In function 'safec_ntoa_format', - inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12: -str/vsnprintf_s.c:260:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=] - 260 | buf[len++] = '0'; - | ~~~~~~~~~~~^~~~~ -str/vsnprintf_s.c: In function 'safec_ntoa_long': -str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32 - 312 | char buf[PRINTF_NTOA_BUFFER_SIZE]; - | ^~~ -cc1: all warnings being treated as errors - -Upstream: https://github.com/rurban/safeclib/pull/150 - -[backported to version 3.7.1] -Signed-off-by: Bernd Kuhls ---- - src/str/vsnprintf_s.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c -index 59dbda94..ca838df1 100644 ---- a/src/str/vsnprintf_s.c -+++ b/src/str/vsnprintf_s.c -@@ -296,7 +296,7 @@ static size_t safec_ntoa_long(out_fct_type out, const char *funcname, - unsigned long base, unsigned int prec, - unsigned int width, unsigned int flags) - { -- char buf[PRINTF_NTOA_BUFFER_SIZE]; -+ char buf[PRINTF_NTOA_BUFFER_SIZE + 1]; - size_t len = 0U; - - // no hash for 0 values --- -2.47.3 - diff --git a/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch deleted file mode 100644 index 2dabebf3b289..000000000000 --- a/package/safeclib/0003-vsnprintf_s-Increase-Buffer-Size-by-1.patch +++ /dev/null @@ -1,49 +0,0 @@ -From dea3c2e1aa1b775baa690b9ef40239f881c5f068 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 13 Aug 2025 20:23:48 -0700 -Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1 - -It is a buffer overflow warning that GCC 15.2 is catching. -The issue is that it's trying to write to `buf[len++]` when len could -potentially be 31, which would write to buf[31] in a buffer of size 32 -(valid indices 0-31), but the len++ post-increment means it could -theoretically write beyond the buffer bounds. - -Fixes - -../../sources/safec-3.9.1/src/str/vsnprintf_s.c: In function 'safec_ftoa.isra': -../../sources/safec-3.9.1/src/str/vsnprintf_s.c:523:24: error: writing 32 bytes into a region of size 31 [-Werror=stringop-overflow=] - 523 | buf[len++] = '0'; - | ~~~~~~~~~~~^~~~~ -../../sources/safec-3.9.1/src/str/vsnprintf_s.c:394:10: note: at offset [1, 32] into destination object 'buf' of size 32 - 394 | char buf[PRINTF_FTOA_BUFFER_SIZE]; - | ^~~ -cc1: all warnings being treated as errors - -Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/148] -Signed-off-by: Khem Raj - -Upstream: https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0 - -[backported to version 3.7.1] -Signed-off-by: Bernd Kuhls ---- - src/str/vsnprintf_s.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c -index ca838df1..8ef6989a 100644 ---- a/src/str/vsnprintf_s.c -+++ b/src/str/vsnprintf_s.c -@@ -369,7 +369,7 @@ static size_t safec_ftoa(out_fct_type out, const char *funcname, - double value, unsigned int prec, unsigned int width, - unsigned int flags) - { -- char buf[PRINTF_FTOA_BUFFER_SIZE]; -+ char buf[PRINTF_FTOA_BUFFER_SIZE + 1]; - size_t len = 0U; - double tmp; - double diff = 0.0; --- -2.47.3 - diff --git a/package/safeclib/safeclib.hash b/package/safeclib/safeclib.hash index bca5d86261da..0227ff2837d5 100644 --- a/package/safeclib/safeclib.hash +++ b/package/safeclib/safeclib.hash @@ -1,5 +1,5 @@ -# From https://github.com/rurban/safeclib/releases/tag/v3.7.1 -sha256 71d3ec970f930bd980f2a41127228eeedfc53749e4c6b203329adc4ff7df32a7 safeclib-3.7.1.tar.xz +# From https://github.com/rurban/safeclib/releases/tag/v3.9.1 +sha256 771b8de483c4f48c90c12bc2c0326571d3d094440ca29008e4cf70562c631c67 safeclib-3.9.1.tar.xz # Hash for license file sha256 c33e77efd5781e3d59a2bb648c82d2a615035ef0d24cf58880380e3af906510b COPYING diff --git a/package/safeclib/safeclib.mk b/package/safeclib/safeclib.mk index bc58c1a38c0c..6478796a7e37 100644 --- a/package/safeclib/safeclib.mk +++ b/package/safeclib/safeclib.mk @@ -4,7 +4,7 @@ # ################################################################################ -SAFECLIB_VERSION = 3.7.1 +SAFECLIB_VERSION = 3.9.1 SAFECLIB_SITE = \ https://github.com/rurban/safeclib/releases/download/v$(SAFECLIB_VERSION) SAFECLIB_SOURCE = safeclib-$(SAFECLIB_VERSION).tar.xz From 9abaa88df92f6ac1b18f177b21377280a6ea1af4 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:00 +0100 Subject: [PATCH 11/22] package/docker-engine: update CPE While `docker:docker` is not marked as deprecated by NVD after a scan through the CVEs the last entry for `docker:docker` is CVE-2022-34883 [1]. Replacing this tuple with `mobyproject:moby` that is referenced in the upstream project GHSA [2]. The last entry for this CPE is CVE-2025-54410 [3]. Note: Quoting [4], "Moby is an open framework created by Docker to assemble specialized container systems without reinventing the wheel". The old github URL [5] redirects to [6]. [1] https://nvd.nist.gov//vuln/detail/CVE-2023-5166 [2] https://github.com/moby/moby/security/advisories [3] https://nvd.nist.gov//vuln/detail/CVE-2025-54410 [4] https://mobyproject.org/ [5] https://github.com/docker/docker [6] https://github.com/moby/moby Signed-off-by: Thomas Perale [Julien: add the note about the Moby project] Signed-off-by: Julien Olivain --- package/docker-engine/docker-engine.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk index 37d42edaeaea..5fe225fbbcfe 100644 --- a/package/docker-engine/docker-engine.mk +++ b/package/docker-engine/docker-engine.mk @@ -13,8 +13,8 @@ DOCKER_ENGINE_LICENSE_FILES = LICENSE DOCKER_ENGINE_DEPENDENCIES = host-pkgconf libseccomp DOCKER_ENGINE_GOMOD = github.com/docker/docker -DOCKER_ENGINE_CPE_ID_VENDOR = docker -DOCKER_ENGINE_CPE_ID_PRODUCT = docker +DOCKER_ENGINE_CPE_ID_VENDOR = mobyproject +DOCKER_ENGINE_CPE_ID_PRODUCT = moby DOCKER_ENGINE_LDFLAGS = \ -X $(DOCKER_ENGINE_GOMOD)/dockerversion.BuildTime="" \ From 3848bea3c3cedddf173b621503d351025266ee4b Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:01 +0100 Subject: [PATCH 12/22] package/podman: add CPE Add the `podman_project:podman` CPE referenced in the GHSA page [1]. The last entry with this CPE is CVE-2024-3056 [2]. Dropping the `v` prefix from the version to track the CPE version correctly. [1] https://github.com/containers/podman/security [2] https://nvd.nist.gov//vuln/detail/CVE-2024-3056 Signed-off-by: Thomas Perale Signed-off-by: Julien Olivain --- package/podman/podman.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/podman/podman.mk b/package/podman/podman.mk index 31cc9ba3490c..80107f3d9e71 100644 --- a/package/podman/podman.mk +++ b/package/podman/podman.mk @@ -31,6 +31,8 @@ PODMAN_TAGS += seccomp PODMAN_DEPENDENCIES += shadow PODMAN_TAGS += libsubid +PODMAN_CPE_ID_VERSION = $(subst v,,$(PODMAN_VERSION)) + ifeq ($(BR2_PACKAGE_BTRFS_PROGS),y) PODMAN_DEPENDENCIES += btrfs-progs define PODMAN_LINUX_CONFIG_FIXUPS_BTRFS From 5a03ffed801f5558e334d0e0000668d6e3355af0 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:02 +0100 Subject: [PATCH 13/22] package/mp4v2: add CPE The CPE `mp4v2:mp4v2` is valid for the package mp4v2. See the latest CVE: CVE-2023-33719 that reference the upstream repository. [1] https://nvd.nist.gov//vuln/detail/CVE-2023-33719 Signed-off-by: Thomas Perale Signed-off-by: Julien Olivain --- package/mp4v2/mp4v2.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/mp4v2/mp4v2.mk b/package/mp4v2/mp4v2.mk index ae777cdc75a7..8d8e184b9952 100644 --- a/package/mp4v2/mp4v2.mk +++ b/package/mp4v2/mp4v2.mk @@ -12,6 +12,8 @@ MP4V2_INSTALL_STAGING = YES MP4V2_LICENSE = MPL-1.1 MP4V2_LICENSE_FILES = COPYING +MP4V2_CPE_ID_VENDOR = mp4v2 + # help2man expects to be able to run utilities on the build machine to # grab --help output which doesn't work when cross compiling, so # disable it From 7bcad09c029bd66cf7ae819e7a2a332025cb7837 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:03 +0100 Subject: [PATCH 14/22] package/easy-rsa: add CPE The CPE `openvpn:easy-rsa` is valid for the EasyRsa package. The last CVE is CVE-2024-13454 [1] that is reference in the upstream bug tracker [2]. [1] https://nvd.nist.gov/vuln/detail/CVE-2024-13454 [2] https://github.com/OpenVPN/easy-rsa/issues/1122 Signed-off-by: Thomas Perale Signed-off-by: Julien Olivain --- package/easy-rsa/easy-rsa.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/easy-rsa/easy-rsa.mk b/package/easy-rsa/easy-rsa.mk index 7266943f5baa..2d70dfd05f5b 100644 --- a/package/easy-rsa/easy-rsa.mk +++ b/package/easy-rsa/easy-rsa.mk @@ -10,6 +10,8 @@ EASY_RSA_SITE = https://github.com/OpenVPN/easy-rsa/releases/download/v$(EASY_RS EASY_RSA_LICENSE = GPL-2.0 EASY_RSA_LICENSE_FILES = COPYING.md gpl-2.0.txt +EASY_RSA_CPE_ID_VENDOR = openvpn + # shell script, so no build step define EASY_RSA_INSTALL_TARGET_CMDS From 7ed80ecec1cf2653803e5bbbec48daaeb6e6c056 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:04 +0100 Subject: [PATCH 15/22] package/igmpproxy: add CPE The CPE `pali:igmpproxy` is a valid CPE for the package igmpproxy. See the latest CVE: CVE-2025-50681 [1] that reference the upstream repository. [1] https://nvd.nist.gov/vuln/detail/CVE-2025-50681 Signed-off-by: Thomas Perale Signed-off-by: Julien Olivain --- package/igmpproxy/igmpproxy.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/igmpproxy/igmpproxy.mk b/package/igmpproxy/igmpproxy.mk index 357c9087e0c5..f2c32939ff18 100644 --- a/package/igmpproxy/igmpproxy.mk +++ b/package/igmpproxy/igmpproxy.mk @@ -11,4 +11,6 @@ IGMPPROXY_AUTORECONF = YES IGMPPROXY_LICENSE = GPL-2.0+, BSD-3-Clause (mrouted) IGMPPROXY_LICENSE_FILES = COPYING GPL.txt Stanford.txt +IGMPPROXY_CPE_ID_VENDOR = pali + $(eval $(autotools-package)) From ef5293307478bd9487c890facbb8de85240d4156 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Tue, 20 Jan 2026 09:24:05 +0100 Subject: [PATCH 16/22] package/libucl: add CPE The CPE `vstakhov:libucl` is a valid CPE for the package libucl. See the latest CVE: CVE-2025-6499 [1] that reference the upstream repository. [1] https://nvd.nist.gov/vuln/detail/CVE-2025-6499 Signed-off-by: Thomas Perale Signed-off-by: Julien Olivain --- package/libucl/libucl.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libucl/libucl.mk b/package/libucl/libucl.mk index bf5e368f2bd8..7b0e5b8e8c6b 100644 --- a/package/libucl/libucl.mk +++ b/package/libucl/libucl.mk @@ -12,6 +12,8 @@ LIBUCL_LICENSE = BSD-2-Clause LIBUCL_LICENSE_FILES = COPYING LIBUCL_DEPENDENCIES = host-pkgconf +LIBUCL_CPE_ID_VENDOR = vstakhov + ifeq ($(BR2_PACKAGE_LIBCURL),y) LIBUCL_DEPENDENCIES += libcurl LIBUCL_CONF_OPTS += --enable-urls From 425abcd025374e6004d328b190ceb443fde568a8 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Mon, 2 Feb 2026 16:01:41 +0100 Subject: [PATCH 17/22] support/testing: python-requests: new runtime test Signed-off-by: Marcus Hoffmann [Peter: Fix flake8 warning, use http.server instead of relying on connectivity] Signed-off-by: Peter Korsgaard --- DEVELOPERS | 2 ++ .../tests/package/sample_python_requests.py | 4 ++++ .../tests/package/test_python_requests.py | 21 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 support/testing/tests/package/sample_python_requests.py create mode 100644 support/testing/tests/package/test_python_requests.py diff --git a/DEVELOPERS b/DEVELOPERS index 280d00d13e2a..13bf5244fe3a 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2290,6 +2290,7 @@ F: support/testing/tests/package/test_python_django.py F: support/testing/tests/package/test_python_fastapi.py F: support/testing/tests/package/test_python_pydantic.py F: support/testing/tests/package/test_python_pydantic_settings.py +F: support/testing/tests/package/test_python_requests.py F: support/testing/tests/package/test_python_ruamel_yaml.py F: support/testing/tests/package/test_python_sdbus_modemmanager.py F: support/testing/tests/package/test_python_sdbus_systemd.py @@ -2305,6 +2306,7 @@ F: support/testing/tests/package/sample_python_django.py F: support/testing/tests/package/sample_python_fastapi.py F: support/testing/tests/package/sample_python_pydantic.py F: support/testing/tests/package/sample_python_pydantic_settings.py +F: support/testing/tests/package/sample_python_requests.py F: support/testing/tests/package/sample_python_ruamel_yaml.py F: support/testing/tests/package/sample_python_sdbus_modemmanager.py F: support/testing/tests/package/sample_python_sdbus_systemd.py diff --git a/support/testing/tests/package/sample_python_requests.py b/support/testing/tests/package/sample_python_requests.py new file mode 100644 index 000000000000..55a05d391047 --- /dev/null +++ b/support/testing/tests/package/sample_python_requests.py @@ -0,0 +1,4 @@ +import requests + +r = requests.get("http://localhost") +assert r.status_code == 200 diff --git a/support/testing/tests/package/test_python_requests.py b/support/testing/tests/package/test_python_requests.py new file mode 100644 index 000000000000..fd55aa547694 --- /dev/null +++ b/support/testing/tests/package/test_python_requests.py @@ -0,0 +1,21 @@ +import os +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Requests(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_REQUESTS=y + """ + sample_scripts = ["tests/package/sample_python_requests.py"] + timeout = 15 + + def login(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv7", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + self.assertRunOk("python3 -m http.server 80 &") From d30457efd045f011458766095eb7bd0c329a202b Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Tue, 3 Feb 2026 15:13:57 +0100 Subject: [PATCH 18/22] package/efl: fix check-package error Commit [1] added the "Upstream:" package patch tag, but forgot to remove the corresponding .checkpackageignore entry. This commit fixes that. Fixes: package/efl/0001-ecore_fb-fix-build-with-tslib.patch:0: lib_patch.Upstream was expected to fail, did you fix the file and forget to update .checkpackageignore? [1] https://gitlab.com/buildroot.org/buildroot/-/commit/bac34296bfed5282df07496c845d74924beb5da6 Signed-off-by: Julien Olivain Signed-off-by: Thomas Petazzoni --- .checkpackageignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.checkpackageignore b/.checkpackageignore index 0bf57b8ac2f6..16a0d5b511cc 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -326,7 +326,6 @@ package/ebtables/0001-replace-ebtables-save-perl-script-with-bash.patch lib_patc package/ecryptfs-utils/0001-musl.patch lib_patch.Upstream package/ecryptfs-utils/0002-openssl110.patch lib_patch.Upstream package/ecryptfs-utils/0003-fix-parallel-build-issue.patch lib_patch.Upstream -package/efl/0001-ecore_fb-fix-build-with-tslib.patch lib_patch.Upstream package/eigen/0001-Adds-new-CMake-Options-for-controlling-build-compone.patch lib_patch.Upstream package/elftosb/0001-fixes-includes.patch lib_patch.Upstream package/elftosb/0002-force-cxx-compiler.patch lib_patch.Upstream From 9171d2982b72f93b973bce6887bd87a91f5c3e1a Mon Sep 17 00:00:00 2001 From: Michael Nosthoff Date: Tue, 3 Feb 2026 14:06:08 +0100 Subject: [PATCH 19/22] package/bitcoin: drop dependencies on Boost Libraries The dependencies on Boost.System, Boost.Filesystem were removed in v23.0 [0][1] and Boost.Thread in v21.99 [2]. This was never reflected in the Buildroot package so do it now. [0] https://github.com/bitcoin/bitcoin/commit/07269321f38e46e9e02f16d7cd135ea90692638d [1] https://github.com/bitcoin/bitcoin/commit/b87f9c5edf3895df9650131fcf8551c3ad1d7301 [2] https://github.com/bitcoin/bitcoin/commit/06e1d7d81d5a56d136c6fc88f09a2b0654a164f9 Signed-off-by: Michael Nosthoff Signed-off-by: Thomas Petazzoni --- package/bitcoin/Config.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/package/bitcoin/Config.in b/package/bitcoin/Config.in index eedb0897a54d..66c8ebbfda12 100644 --- a/package/bitcoin/Config.in +++ b/package/bitcoin/Config.in @@ -21,9 +21,6 @@ config BR2_PACKAGE_BITCOIN depends on BR2_USE_WCHAR select BR2_HOST_CMAKE_AT_LEAST_3_22 select BR2_PACKAGE_BOOST - select BR2_PACKAGE_BOOST_SYSTEM - select BR2_PACKAGE_BOOST_FILESYSTEM - select BR2_PACKAGE_BOOST_THREAD select BR2_PACKAGE_LIBEVENT help Bitcoin Core is an open source project which maintains and From 37152aa6c3a755a89c6ab85338ebb7119fee2f22 Mon Sep 17 00:00:00 2001 From: Thomas Perale Date: Sun, 27 Jul 2025 21:25:37 +0200 Subject: [PATCH 20/22] package/aardvark-dns: add CPE identifier The cpe:2.3:a:containers:aardvark-dns:*:*:*:*:*:*:*:* is valid for this package. See https://nvd.nist.gov/products/cpe/detail/5F79D5CD-D716-4190-BE08-31EB5EEB233F The CPE version strip the 'v' prefix from the version. Signed-off-by: Thomas Perale Reviewed-by: Thomas Petazzoni Signed-off-by: Julien Olivain --- package/aardvark-dns/aardvark-dns.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/aardvark-dns/aardvark-dns.mk b/package/aardvark-dns/aardvark-dns.mk index 09a3a421f2c1..c0dc7eb2a70f 100644 --- a/package/aardvark-dns/aardvark-dns.mk +++ b/package/aardvark-dns/aardvark-dns.mk @@ -11,5 +11,7 @@ AARDVARK_DNS_SITE_METHOD = git AARDVARK_DNS_LICENSE = Apache-2.0 AARDVARK_DNS_LICENSE_FILES = LICENSE +AARDVARK_DNS_CPE_ID_VENDOR = containers +AARDVARK_DNS_CPE_ID_VERSION = $(subst v,,$(AARDVARK_DNS_VERSION)) $(eval $(cargo-package)) From d41ed2ea5420c65fef009f87c17b2095e0be35c3 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 3 Feb 2026 16:04:17 +0100 Subject: [PATCH 21/22] package/gpsd: fix CVE-2025-67268 and CVE-2025-67269 Backport two security fixes from upstream. They are in newer releases, but to facilitate backporting to our LTS releases, this backports the fixes. Signed-off-by: Thomas Petazzoni --- ...mea2000.c-Fix-issue-356-skyview-buff.patch | 379 ++++++++++++++++++ ...x-integer-underflow-is-malicious-Nav.patch | 161 ++++++++ package/gpsd/gpsd.mk | 6 + 3 files changed, 546 insertions(+) create mode 100644 package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch create mode 100644 package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch diff --git a/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch b/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch new file mode 100644 index 000000000000..6966749627e8 --- /dev/null +++ b/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch @@ -0,0 +1,379 @@ +From 07383119d8c6605165ee3d5dc2b5941aa7f101bf Mon Sep 17 00:00:00 2001 +From: "Gary E. Miller" +Date: Tue, 2 Dec 2025 19:36:04 -0800 +Subject: [PATCH] drivers/driver_nmea2000.c: Fix issue 356, skyview buffer + overrun. + +CVE: CVE-2025-67268 +Upstream: https://github.com/ntpsec/gpsd/commit/dc966aa74c075d0a6535811d98628625cbfbe3f4 +Signed-off-by: Thomas Petazzoni +--- + drivers/driver_nmea2000.c | 123 ++++++++++++++++++++++---------------- + 1 file changed, 71 insertions(+), 52 deletions(-) + +diff --git a/drivers/driver_nmea2000.c b/drivers/driver_nmea2000.c +index 71e04e134..3e40dc768 100644 +--- a/drivers/driver_nmea2000.c ++++ b/drivers/driver_nmea2000.c +@@ -12,11 +12,11 @@ + * Message contents can be had from canboat/analyzer: + * analyzer -explain + * +- * This file is Copyright 2012 by the GPSD project ++ * This file is Copyright by the GPSD project + * SPDX-License-Identifier: BSD-2-clause + */ + +-#include "../include/gpsd_config.h" /* must be before all includes */ ++#include "../include/gpsd_config.h" // must be before all includes + + #if defined(NMEA2000_ENABLE) + +@@ -68,7 +68,7 @@ typedef struct PGN + + #if LOG_FILE + FILE *logFile = NULL; +-#endif /* of if LOG_FILE */ ++#endif // of if LOG_FILE + + extern bool __attribute__ ((weak)) gpsd_add_device(const char *device_name, + bool flag_nowait); +@@ -89,14 +89,14 @@ static int scale_int(int32_t var, const int64_t factor) + static void print_data(struct gps_context_t *context, + unsigned char *buffer, int len, PGN *pgn) + { +- if ((libgps_debuglevel >= LOG_IO) != 0) { +- int l1, l2, ptr; ++ if (LOG_IO <= libgps_debuglevel) { ++ int l1; + char bu[128]; + +- ptr = 0; +- l2 = sprintf(&bu[ptr], "got data:%6u:%3d: ", pgn->pgn, len); ++ int ptr = 0; ++ int l2 = sprintf(&bu[ptr], "got data:%6u:%3d: ", pgn->pgn, len); + ptr += l2; +- for (l1=0;l1errout, "%s\n", bu); + ptr = 0; +@@ -276,7 +276,7 @@ static gps_mask_t hnd_127258(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { + print_data(session->context, bu, len, pgn); +- /* FIXME? Get magnetic variation */ ++ // FIXME? Get magnetic variation + GPSD_LOG(LOG_DATA, &session->context->errout, + "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit); + return(0); +@@ -358,7 +358,7 @@ static gps_mask_t hnd_126992(unsigned char *bu, int len, PGN *pgn, + { + // uint8_t sid; + // uint8_t source; +- uint64_t usecs; /* time in us */ ++ uint64_t usecs; // time in us + + print_data(session->context, bu, len, pgn); + GPSD_LOG(LOG_DATA, &session->context->errout, +@@ -434,6 +434,7 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { + int l1; ++ int expected_len; + + print_data(session->context, bu, len, pgn); + GPSD_LOG(LOG_DATA, &session->context->errout, +@@ -441,24 +442,39 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, + + session->driver.nmea2000.sid[2] = bu[0]; + session->gpsdata.satellites_visible = (int)bu[2]; ++ if (MAXCHANNELS <= session->gpsdata.satellites_visible) { ++ // Handle a CVE for overrunning skyview[] ++ GPSD_LOG(LOG_WARN, &session->context->errout, ++ "pgn %6d(%3d): Too many sats %d\n", ++ pgn->pgn, session->driver.nmea2000.unit, ++ session->gpsdata.satellites_visible); ++ session->gpsdata.satellites_visible = MAXCHANNELS; ++ } ++ expected_len = 3 + (12 * session->gpsdata.satellites_visible); ++ if (len != expected_len) { ++ GPSD_LOG(LOG_WARN, &session->context->errout, ++ "pgn %6d(%3d): wrong length %d s/b %d\n", ++ pgn->pgn, session->driver.nmea2000.unit, ++ len, expected_len); ++ return 0; ++ } + + memset(session->gpsdata.skyview, '\0', sizeof(session->gpsdata.skyview)); +- for (l1=0;l1gpsdata.satellites_visible;l1++) { +- int svt; +- double azi, elev, snr; +- +- elev = getles16(bu, 3+12*l1+1) * 1e-4 * RAD_2_DEG; +- azi = getleu16(bu, 3+12*l1+3) * 1e-4 * RAD_2_DEG; +- snr = getles16(bu, 3+12*l1+5) * 1e-2; ++ for (l1 = 0; l1 < session->gpsdata.satellites_visible; l1++) { ++ int offset = 3 + (12 * l1); ++ double elev = getles16(bu, offset + 1) * 1e-4 * RAD_2_DEG; ++ double azi = getleu16(bu, offset + 3) * 1e-4 * RAD_2_DEG; ++ double snr = getles16(bu, offset + 5) * 1e-2; + +- svt = (int)(bu[3+12*l1+11] & 0x0f); ++ int svt = (int)(bu[offset + 11] & 0x0f); + +- session->gpsdata.skyview[l1].elevation = (short) (round(elev)); +- session->gpsdata.skyview[l1].azimuth = (short) (round(azi)); ++ session->gpsdata.skyview[l1].elevation = elev; ++ session->gpsdata.skyview[l1].azimuth = azi; + session->gpsdata.skyview[l1].ss = snr; +- session->gpsdata.skyview[l1].PRN = (short)bu[3+12*l1+0]; ++ session->gpsdata.skyview[l1].PRN = (int16_t)bu[offset]; + session->gpsdata.skyview[l1].used = false; +- if ((svt == 2) || (svt == 5)) { ++ if ((2 == svt) || ++ (5 == svt)) { + session->gpsdata.skyview[l1].used = true; + } + } +@@ -588,7 +604,7 @@ static gps_mask_t hnd_129029(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { + gps_mask_t mask; +- uint64_t usecs; /* time in us */ ++ uint64_t usecs; // time in us + + print_data(session->context, bu, len, pgn); + GPSD_LOG(LOG_DATA, &session->context->errout, +@@ -675,7 +691,7 @@ static gps_mask_t hnd_129038(unsigned char *bu, int len, PGN *pgn, + (unsigned int)ais_direction((unsigned int)getleu16(bu, 21), 1.0); + ais->type1.turn = ais_turn_rate((int)getles16(bu, 23)); + ais->type1.status = (unsigned int) ((bu[25] >> 0) & 0x0f); +- ais->type1.maneuver = 0; /* Not transmitted ???? */ ++ ais->type1.maneuver = 0; // Not transmitted ???? + decode_ais_channel_info(bu, len, 163, session); + + return(ONLINE_SET | AIS_SET); +@@ -730,8 +746,9 @@ static gps_mask_t hnd_129039(unsigned char *bu, int len, PGN *pgn, + + /* + * PGN 129040: AIS Class B Extended Position Report ++ * ++ * No test case for this message at the moment + */ +-/* No test case for this message at the moment */ + static gps_mask_t hnd_129040(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { +@@ -781,8 +798,8 @@ static gps_mask_t hnd_129040(unsigned char *bu, int len, PGN *pgn, + ais->type19.epfd = (unsigned int) ((bu[23] >> 4) & 0x0f); + ais->type19.dte = (unsigned int) ((bu[52] >> 0) & 0x01); + ais->type19.assigned = (bool) ((bu[52] >> 1) & 0x01); +- for (l=0;ltype19.shipname[l] = (char) bu[32+l]; ++ for (l = 0; l < AIS_SHIPNAME_MAXLEN; l++) { ++ ais->type19.shipname[l] = (char)bu[32+l]; + } + ais->type19.shipname[AIS_SHIPNAME_MAXLEN] = (char) 0; + decode_ais_channel_info(bu, len, 422, session); +@@ -914,7 +931,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, + ais->type5.draught = (unsigned int) (getleu16(bu, 51)/10); + ais->type5.dte = (unsigned int) ((bu[73] >> 6) & 0x01); + +- for (l=0,cpy_stop=0;l<7;l++) { ++ for (l = 0, cpy_stop = 0; l < 7; l++) { + char next; + + next = (char) bu[9+l]; +@@ -929,7 +946,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, + } + ais->type5.callsign[7] = (char) 0; + +- for (l=0,cpy_stop=0;ltype5.shipname[AIS_SHIPNAME_MAXLEN] = (char) 0; + +- for (l=0,cpy_stop=0;l<20;l++) { ++ for (l = 0, cpy_stop = 0; l < 20; l++) { + char next; + + next = (char) bu[53+l]; +@@ -978,7 +995,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, + date2.tm_year+1900, + ais->type5.hour, + ais->type5.minute); +-#endif /* of #if NMEA2000_DEBUG_AIS */ ++#endif // end of #if NMEA2000_DEBUG_AIS + decode_ais_channel_info(bu, len, 592, session); + return(ONLINE_SET | AIS_SET); + } +@@ -988,8 +1005,9 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, + + /* + * PGN 129798: AIS SAR Aircraft Position Report ++ * ++ * No test case for this message at the moment + */ +-/* No test case for this message at the moment */ + static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { +@@ -1016,8 +1034,8 @@ static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, + ais->type9.alt = (unsigned int) (getleu64(bu, 21)/1000000); + ais->type9.regional = (unsigned int) ((bu[29] >> 0) & 0xff); + ais->type9.dte = (unsigned int) ((bu[30] >> 0) & 0x01); +-/* ais->type9.spare = (bu[30] >> 1) & 0x7f; */ +- ais->type9.assigned = 0; /* Not transmitted ???? */ ++// ais->type9.spare = (bu[30] >> 1) & 0x7f; ++ ais->type9.assigned = 0; // Not transmitted ???? + decode_ais_channel_info(bu, len, 163, session); + + return(ONLINE_SET | AIS_SET); +@@ -1028,8 +1046,9 @@ static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, + + /* + * PGN 129802: AIS Safety Related Broadcast Message ++ * ++ * No test case for this message at the moment + */ +-/* No test case for this message at the moment */ + static gps_mask_t hnd_129802(unsigned char *bu, int len, PGN *pgn, + struct gps_device_t *session) + { +@@ -1043,8 +1062,8 @@ static gps_mask_t hnd_129802(unsigned char *bu, int len, PGN *pgn, + if (decode_ais_header(session->context, bu, len, ais, 0x3fffffff) != 0) { + int l; + +-/* ais->type14.channel = (bu[ 5] >> 0) & 0x1f; */ +- for (l=0;l<36;l++) { ++// ais->type14.channel = (bu[ 5] >> 0) & 0x1f; ++ for (l = 0; l < 36; l++) { + ais->type14.text[l] = (char) bu[6+l]; + } + ais->type14.text[36] = (char) 0; +@@ -1079,7 +1098,7 @@ static gps_mask_t hnd_129809(unsigned char *bu, int len, PGN *pgn, + "NMEA2000: AIS message 24A from %09u stashed.\n", + ais->mmsi); + +- for (l=0;ltype24.shipname[l] = (char) bu[ 5+l]; + saveptr->shipname[l] = (char) bu[ 5+l]; + } +@@ -1119,12 +1138,12 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, + + ais->type24.shiptype = (unsigned int) ((bu[ 5] >> 0) & 0xff); + +- for (l=0;l<7;l++) { ++ for (l = 0; l < 7; l++) { + ais->type24.vendorid[l] = (char) bu[ 6+l]; + } + ais->type24.vendorid[7] = (char) 0; + +- for (l=0;l<7;l++) { ++ for (l = 0; l < 7; l++) { + ais->type24.callsign[l] = (char) bu[13+l]; + } + ais->type24.callsign[7] = (char )0; +@@ -1158,7 +1177,7 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, + for (i = 0; i < MAX_TYPE24_INTERLEAVE; i++) { + if (session->driver.aivdm.context[0].type24_queue.ships[i].mmsi == + ais->mmsi) { +- for (l=0;ltype24.shipname[l] = + (char)(session->driver.aivdm.context[0].type24_queue.ships[i].shipname[l]); + } +@@ -1566,7 +1585,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + frame->can_id & 0x1ffffff); + if ((frame->can_dlc & 0x0f) > 0) { + int l1; +- for(l1=0;l1<(frame->can_dlc & 0x0f);l1++) { ++ for(l1 = 0; l1 < (frame->can_dlc & 0x0f); l1++) { + (void)fprintf(logFile, "%02x", frame->data[l1]); + } + } +@@ -1591,8 +1610,8 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + if (!session->driver.nmea2000.unit_valid) { + unsigned int l1, l2; + +- for (l1=0;l1driver.nmea2000.unit = l2; + session->driver.nmea2000.unit_valid = true; +@@ -1641,7 +1660,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + "pgn %6d:%s \n", work->pgn, work->name); + session->driver.nmea2000.workpgn = (void *) work; + session->lexer.outbuflen = frame->can_dlc & 0x0f; +- for (l2=0;l2lexer.outbuflen;l2++) { ++ for (l2 = 0; l2 < session->lexer.outbuflen; l2++) { + session->lexer.outbuffer[l2]= frame->data[l2]; + } + } else if ((frame->data[0] & 0x1f) == 0) { +@@ -1659,7 +1678,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + #endif /* of #if NMEA2000_FAST_DEBUG */ + session->lexer.inbuflen = 0; + session->driver.nmea2000.idx += 1; +- for (l2=2;l2<8;l2++) { ++ for (l2 = 2; l2 < 8; l2++) { + session->lexer.inbuffer[session->lexer.inbuflen++] = + frame->data[l2]; + } +@@ -1668,7 +1687,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + } else if (frame->data[0] == session->driver.nmea2000.idx) { + unsigned int l2; + +- for (l2=1;l2<8;l2++) { ++ for (l2 = 1; l2 < 8; l2++) { + if (session->driver.nmea2000.fast_packet_len > + session->lexer.inbuflen) { + session->lexer.inbuffer[session->lexer.inbuflen++] = +@@ -1689,7 +1708,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) + session->driver.nmea2000.workpgn = (void *) work; + session->lexer.outbuflen = + session->driver.nmea2000.fast_packet_len; +- for(l2 = 0;l2 < (unsigned int)session->lexer.outbuflen; ++ for(l2 = 0; l2 < (unsigned int)session->lexer.outbuflen; + l2++) { + session->lexer.outbuffer[l2] = + session->lexer.inbuffer[l2]; +@@ -1792,7 +1811,7 @@ int nmea2000_open(struct gps_device_t *session) + (void)strlcpy(interface_name, session->gpsdata.dev.path + 11, + sizeof(interface_name)); + unit_ptr = NULL; +- for (l=0;ldriver.nmea2000.unit_valid = false; +- for (l=0;ldriver.nmea2000.unit_valid) { + unsigned int l1, l2; + +- for (l1=0;l1driver.nmea2000.unit_valid = false; + session->driver.nmea2000.unit = 0; +-- +2.52.0 + diff --git a/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch b/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch new file mode 100644 index 000000000000..80507847c46b --- /dev/null +++ b/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch @@ -0,0 +1,161 @@ +From b28910e0d5a48de4cb4d8675689297dc407af0c6 Mon Sep 17 00:00:00 2001 +From: "Gary E. Miller" +Date: Wed, 3 Dec 2025 19:04:03 -0800 +Subject: [PATCH] gpsd/packet.c: Fix integer underflow is malicious Navcom + packet + +Causes DoS. Fix issue 358 + +CVE: CVE-2025-67269 +Upstream: https://gitlab.com/gpsd/gpsd/-/commit/ffa1d6f40bca0b035fc7f5e563160ebb67199da7 +Signed-off-by: Thomas Petazzoni +--- + gpsd/packet.c | 64 ++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 48 insertions(+), 16 deletions(-) + +diff --git a/gpsd/packet.c b/gpsd/packet.c +index f9a7db8d0..0c2350072 100644 +--- a/gpsd/packet.c ++++ b/gpsd/packet.c +@@ -1141,18 +1141,22 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + #endif // SIRF_ENABLE || SKYTRAQ_ENABLE + #ifdef SIRF_ENABLE + case SIRF_LEADER_2: +- // first part of length +- lexer->length = (size_t) (c << 8); ++ // first part of length, MSB ++ lexer->length = (c & 0x7f) << 8; ++ if (lexer->length > MAX_PACKET_LENGTH) { ++ lexer->length = 0; ++ return character_pushback(lexer, GROUND_STATE); ++ } // else + lexer->state = SIRF_LENGTH_1; + break; + case SIRF_LENGTH_1: + // second part of length + lexer->length += c + 2; +- if (lexer->length <= MAX_PACKET_LENGTH) { +- lexer->state = SIRF_PAYLOAD; +- } else { ++ if (lexer->length > MAX_PACKET_LENGTH) { ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); +- } ++ } // else ++ lexer->state = SIRF_PAYLOAD; + break; + case SIRF_PAYLOAD: + if (0 == --lexer->length) { +@@ -1194,6 +1198,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + return character_pushback(lexer, GROUND_STATE); + } + if (MAX_PACKET_LENGTH < lexer->length) { ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); + } + lexer->state = SKY_PAYLOAD; +@@ -1376,14 +1381,29 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + } + break; + case NAVCOM_LEADER_3: ++ // command ID + lexer->state = NAVCOM_ID; + break; + case NAVCOM_ID: +- lexer->length = (size_t)c - 4; ++ /* Length LSB ++ * Navcom length includes command ID, length bytes. and checksum. ++ * So for more than just the payload length. ++ * Minimum 4 bytes */ ++ if (4 > c) { ++ return character_pushback(lexer, GROUND_STATE); ++ } ++ lexer->length = c; + lexer->state = NAVCOM_LENGTH_1; + break; + case NAVCOM_LENGTH_1: ++ // Length USB. Navcom allows payload length up to 65,531 + lexer->length += (c << 8); ++ // don't count ID, length and checksum in payload length ++ lexer->length -= 4; ++ if (MAX_PACKET_LENGTH < lexer->length) { ++ lexer->length = 0; ++ return character_pushback(lexer, GROUND_STATE); ++ } // else + lexer->state = NAVCOM_LENGTH_2; + break; + case NAVCOM_LENGTH_2: +@@ -1510,11 +1530,11 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + lexer->length += 2; // checksum + // 10 bytes is the length of the Zodiac header + // no idea what Zodiac max length really is +- if ((MAX_PACKET_LENGTH - 10) >= lexer->length) { +- lexer->state = ZODIAC_PAYLOAD; +- } else { ++ if ((MAX_PACKET_LENGTH - 10) < lexer->length) { ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); +- } ++ } // else ++ lexer->state = ZODIAC_PAYLOAD; + break; + case ZODIAC_PAYLOAD: + if (0 == --lexer->length) { +@@ -1549,6 +1569,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + lexer->state = UBX_LENGTH_2; + } else { + // bad length ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); + } + break; +@@ -1604,6 +1625,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + lexer->length += (c << 8); + if (MAX_PACKET_LENGTH <= lexer->length) { + // bad length ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); + } // else + +@@ -1841,16 +1863,16 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + lexer->state = GEOSTAR_MESSAGE_ID_2; + break; + case GEOSTAR_MESSAGE_ID_2: +- lexer->length = (size_t)c * 4; ++ lexer->length = c * 4; + lexer->state = GEOSTAR_LENGTH_1; + break; + case GEOSTAR_LENGTH_1: + lexer->length += (c << 8) * 4; +- if (MAX_PACKET_LENGTH >= lexer->length) { +- lexer->state = GEOSTAR_LENGTH_2; +- } else { ++ if (MAX_PACKET_LENGTH < lexer->length) { ++ lexer->length = 0; + return character_pushback(lexer, GROUND_STATE); +- } ++ } // else ++ lexer->state = GEOSTAR_LENGTH_2; + break; + case GEOSTAR_LENGTH_2: + lexer->state = GEOSTAR_PAYLOAD; +@@ -2160,6 +2182,16 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) + #endif // STASH_ENABLE + } + ++ /* Catch length overflow. Should not happen. ++ * length is size_t, so underflow looks like overflow too. */ ++ if (MAX_PACKET_LENGTH <= lexer->length) { ++ GPSD_LOG(LOG_WARN, &lexer->errout, ++ "Too long: %zu state %u %s c x%x\n", ++ lexer->length, lexer->state, state_table[lexer->state], c); ++ // exit(255); ++ lexer->length = 0; ++ return character_pushback(lexer, GROUND_STATE); ++ } + return true; // no pushback + } + +-- +2.52.0 + diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk index c5c4dad296e3..99cc0b8161e5 100644 --- a/package/gpsd/gpsd.mk +++ b/package/gpsd/gpsd.mk @@ -14,6 +14,12 @@ GPSD_INSTALL_STAGING = YES GPSD_DEPENDENCIES = host-scons host-pkgconf +# 0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch +GPSD_IGNORE_CVES += CVE-2025-67268 + +# 0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch +GPSD_IGNORE_CVES += CVE-2025-67269 + GPSD_LDFLAGS = $(TARGET_LDFLAGS) GPSD_CFLAGS = $(TARGET_CFLAGS) GPSD_CXXFLAGS = $(TARGET_CXXFLAGS) From 37ef4f862f037bb4bdc0d700931f0b37a26d276e Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Mon, 29 Dec 2025 09:37:48 +0100 Subject: [PATCH 22/22] package/gpsd: bump version to 3.27.2 https://gitlab.com/gpsd/gpsd/-/blob/release-3.27.2/NEWS All patches can be dropped as they are in this upstream release. Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- ...ile-and-dumpfile-options-for-gpsprof.patch | 40 -- ...02-gpsd-gpsd.c-Fix-empty-gst-in-POLL.patch | 78 ---- ...t-force-_TIME_BITS-on-a-32-bit-syste.patch | 49 --- ...e.c-Make-client-UDP-socket-non-block.patch | 32 -- ...mea2000.c-Fix-issue-356-skyview-buff.patch | 379 ------------------ ...x-integer-underflow-is-malicious-Nav.patch | 161 -------- package/gpsd/gpsd.hash | 2 +- package/gpsd/gpsd.mk | 2 +- 8 files changed, 2 insertions(+), 741 deletions(-) delete mode 100644 package/gpsd/0001-Fix-the-logfile-and-dumpfile-options-for-gpsprof.patch delete mode 100644 package/gpsd/0002-gpsd-gpsd.c-Fix-empty-gst-in-POLL.patch delete mode 100644 package/gpsd/0003-SConscript-Do-not-force-_TIME_BITS-on-a-32-bit-syste.patch delete mode 100644 package/gpsd/0004-gpsd-libgpsd_core.c-Make-client-UDP-socket-non-block.patch delete mode 100644 package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch delete mode 100644 package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch diff --git a/package/gpsd/0001-Fix-the-logfile-and-dumpfile-options-for-gpsprof.patch b/package/gpsd/0001-Fix-the-logfile-and-dumpfile-options-for-gpsprof.patch deleted file mode 100644 index d466c9fc5843..000000000000 --- a/package/gpsd/0001-Fix-the-logfile-and-dumpfile-options-for-gpsprof.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f18e52dad4eeba2434a988bc899f6c7fe973f4ba Mon Sep 17 00:00:00 2001 -Message-Id: -From: Richard Lindsley -Date: Fri, 23 May 2025 18:48:57 -0700 -Subject: [PATCH] Fix the --logfile and --dumpfile options for gpsprof - -The open() function requires that the "encoding" argument is a str or -None. - -Upstream: https://gitlab.com/gpsd/gpsd/-/commit/bad9973b8e73e9e2cc0af2555edc9c8a0855d203 -Signed-off-by: Yann E. MORIN ---- - clients/gpsprof.py.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/clients/gpsprof.py.in b/clients/gpsprof.py.in -index 8b1a5234b..e5e448a53 100644 ---- a/clients/gpsprof.py.in -+++ b/clients/gpsprof.py.in -@@ -1208,7 +1208,7 @@ if __name__ == '__main__': - options = parser.parse_args() - - if options.logfile: -- options.logfp = open(options.logfile, "w", encoding=ascii) -+ options.logfp = open(options.logfile, "w", encoding="ascii") - else: - options.logfp = None - -@@ -1255,7 +1255,7 @@ if __name__ == '__main__': - plot.postprocess() - # Save the timing data (only) for post-analysis if required. - if options.dumpfile: -- with open(options.dumpfile, "w", encoding=ascii) as fp: -+ with open(options.dumpfile, "w", encoding="ascii") as fp: - fp.write(plot.dump()) - if options.logfp: - options.logfp.close() --- -2.34.1 - diff --git a/package/gpsd/0002-gpsd-gpsd.c-Fix-empty-gst-in-POLL.patch b/package/gpsd/0002-gpsd-gpsd.c-Fix-empty-gst-in-POLL.patch deleted file mode 100644 index d07a8970f486..000000000000 --- a/package/gpsd/0002-gpsd-gpsd.c-Fix-empty-gst-in-POLL.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 98e61729d84b3e3698cde4ec7fe446b932d333fc Mon Sep 17 00:00:00 2001 -Message-Id: <98e61729d84b3e3698cde4ec7fe446b932d333fc.1749533625.git.yann.morin@orange.com> -In-Reply-To: -References: -From: "Gary E. Miller" -Date: Thu, 5 Jun 2025 17:40:56 -0700 -Subject: [PATCH] gpsd/gpsd.c: Fix empty gst[,] in POLL. - -Fix issue 336. - -Upstream: https://gitlab.com/gpsd/gpsd/-/commit/3185c5790c3e7e31c6cc80174940f0385cba2617 -Signed-off-by: Yann E. MORIN ---- - gpsd/gpsd.c | 30 ++++++++++++++++++++++-------- - 1 file changed, 22 insertions(+), 8 deletions(-) - -diff --git a/gpsd/gpsd.c b/gpsd/gpsd.c -index 5a98a4470..3797ace13 100644 ---- a/gpsd/gpsd.c -+++ b/gpsd/gpsd.c -@@ -1555,10 +1555,15 @@ static void handle_request(struct subscriber_t *sub, const char *buf, - for (devp = devices; devp < devices + MAX_DEVICES; devp++) { - if (allocated_device(devp) && subscribed(sub, devp)) { - if (0 != (devp->observed & GPS_TYPEMASK)) { -+ size_t rlen = strnlen(reply, replylen); -+ - json_tpv_dump(NAVDATA_SET, devp, &sub->policy, -- reply + strnlen(reply, replylen), -- replylen - strnlen(reply, replylen)); -+ reply + rlen, replylen - rlen); - rstrip(reply, replylen); -+ if (strnlen(reply, replylen) == rlen) { -+ // no data -+ continue; -+ } - (void)strlcat(reply, ",", replylen); - } - } -@@ -1568,10 +1573,15 @@ static void handle_request(struct subscriber_t *sub, const char *buf, - for (devp = devices; devp < devices + MAX_DEVICES; devp++) { - if (allocated_device(devp) && subscribed(sub, devp)) { - if (0 != (devp->observed & GPS_TYPEMASK)) { -- json_noise_dump(&devp->gpsdata, -- reply + strnlen(reply, replylen), -- replylen - strnlen(reply, replylen)); -+ size_t rlen = strnlen(reply, replylen); -+ -+ json_noise_dump(&devp->gpsdata, reply + rlen, -+ replylen - rlen); - rstrip(reply, replylen); -+ if (strnlen(reply, replylen) == rlen) { -+ // no data -+ continue; -+ } - (void)strlcat(reply, ",", replylen); - } - } -@@ -1581,10 +1591,14 @@ static void handle_request(struct subscriber_t *sub, const char *buf, - for (devp = devices; devp < devices + MAX_DEVICES; devp++) { - if (allocated_device(devp) && subscribed(sub, devp)) { - if (0 != (devp->observed & GPS_TYPEMASK)) { -- json_sky_dump(devp, -- reply + strnlen(reply, replylen), -- replylen - strnlen(reply, replylen)); -+ size_t rlen = strnlen(reply, replylen); -+ -+ json_sky_dump(devp, reply + rlen, replylen - rlen); - rstrip(reply, replylen); -+ if (strnlen(reply, replylen) == rlen) { -+ // no data -+ continue; -+ } - (void)strlcat(reply, ",", replylen); - } - } --- -2.34.1 - diff --git a/package/gpsd/0003-SConscript-Do-not-force-_TIME_BITS-on-a-32-bit-syste.patch b/package/gpsd/0003-SConscript-Do-not-force-_TIME_BITS-on-a-32-bit-syste.patch deleted file mode 100644 index 16a0ca6f88f0..000000000000 --- a/package/gpsd/0003-SConscript-Do-not-force-_TIME_BITS-on-a-32-bit-syste.patch +++ /dev/null @@ -1,49 +0,0 @@ -From a1f36cf216861ac6499654b4e6e4d54107142cfc Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: -References: -From: "Gary E. Miller" -Date: Thu, 5 Jun 2025 18:14:55 -0700 -Subject: [PATCH] SConscript: Do not force _TIME_BITS on a 32 bit system. - -The build assumed that if _TIME_BITS existed on a system then it was OK -to set it. Turns out that is a bad assumption. - -Leave it to the builds to decide when _TIME_BITS should be used. - -Upstream: https://gitlab.com/gpsd/gpsd/-/commit/95814d22276c34abe72a35b89065b1190d34f9bf -Signed-off-by: Yann E. MORIN ---- - SConscript | 16 +++------------- - 1 file changed, 3 insertions(+), 13 deletions(-) - -diff --git a/SConscript b/SConscript -index 28105fa7b..357c53f2b 100644 ---- a/SConscript -+++ b/SConscript -@@ -1335,19 +1335,9 @@ if not cleaning and not helping: - # check for 64 bit time_t. Needed for 2038. - sizeof_time_t = config.CheckTypeSize("time_t", "#include ", - expect=8) -- if 0 == sizeof_time_t: -- # see if we can force time64_t -- # this needs glibc 2.34 or later, and a compatible kernel -- sizeof_time_t = config.CheckTypeSize("time_t", -- "#define _TIME_BITS 64\n" -- "#define _FILE_OFFSET_BITS 64\n" -- "#include ", -- expect=8) -- if 0 != sizeof_time_t: -- # force time64_t -- confdefs.append("// Forcing 64-bit time_t\n" -- "#define _TIME_BITS 64\n" -- "#define _FILE_OFFSET_BITS 64\n") -+ # do not try to force time64_t, that is a distro decision. -+ # it needs glibc 2.34 or later, and a compatible kernel -+ # CFLAGS += "-D_TIME_BITS 64 -D_FILE_OFFSET_BITS 64" - - if 0 == sizeof_time_t: - announce("WARNING: time_t is too small. It will fail in 2038") --- -2.34.1 - diff --git a/package/gpsd/0004-gpsd-libgpsd_core.c-Make-client-UDP-socket-non-block.patch b/package/gpsd/0004-gpsd-libgpsd_core.c-Make-client-UDP-socket-non-block.patch deleted file mode 100644 index 73ecce5b8bcb..000000000000 --- a/package/gpsd/0004-gpsd-libgpsd_core.c-Make-client-UDP-socket-non-block.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0b1769a3abe386c139a8b4d4967b57a00f0f286a Mon Sep 17 00:00:00 2001 -Message-Id: <0b1769a3abe386c139a8b4d4967b57a00f0f286a.1749533625.git.yann.morin@orange.com> -In-Reply-To: -References: -From: Miroslav Lichvar -Date: Tue, 10 Jun 2025 00:21:52 +0200 -Subject: [PATCH] gpsd/libgpsd_core.c: Make client UDP socket non-blocking. - -Resolving issue #337 - -Upstream: https://gitlab.com/gpsd/gpsd/-/commit/992a90e6a50b4d3dcb091fff4658e7892c985c7f -Signed-off-by: Yann E. MORIN ---- - gpsd/libgpsd_core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gpsd/libgpsd_core.c b/gpsd/libgpsd_core.c -index f328648f7..6b77e2b97 100644 ---- a/gpsd/libgpsd_core.c -+++ b/gpsd/libgpsd_core.c -@@ -614,7 +614,7 @@ int gpsd_open(struct gps_device_t *session) - "CORE: opening UDP feed at %s, port %s.\n", host, - port); - if (0 > (dsock = netlib_connectsock1(AF_UNSPEC, host, port, "udp", -- 0, true, NULL, 0))) { -+ 1, true, NULL, 0))) { - // cast for 32-bit ints. - GPSD_LOG(LOG_ERROR, &session->context->errout, - "CORE: UDP device open error %s(%ld).\n", --- -2.34.1 - diff --git a/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch b/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch deleted file mode 100644 index 6966749627e8..000000000000 --- a/package/gpsd/0005-drivers-driver_nmea2000.c-Fix-issue-356-skyview-buff.patch +++ /dev/null @@ -1,379 +0,0 @@ -From 07383119d8c6605165ee3d5dc2b5941aa7f101bf Mon Sep 17 00:00:00 2001 -From: "Gary E. Miller" -Date: Tue, 2 Dec 2025 19:36:04 -0800 -Subject: [PATCH] drivers/driver_nmea2000.c: Fix issue 356, skyview buffer - overrun. - -CVE: CVE-2025-67268 -Upstream: https://github.com/ntpsec/gpsd/commit/dc966aa74c075d0a6535811d98628625cbfbe3f4 -Signed-off-by: Thomas Petazzoni ---- - drivers/driver_nmea2000.c | 123 ++++++++++++++++++++++---------------- - 1 file changed, 71 insertions(+), 52 deletions(-) - -diff --git a/drivers/driver_nmea2000.c b/drivers/driver_nmea2000.c -index 71e04e134..3e40dc768 100644 ---- a/drivers/driver_nmea2000.c -+++ b/drivers/driver_nmea2000.c -@@ -12,11 +12,11 @@ - * Message contents can be had from canboat/analyzer: - * analyzer -explain - * -- * This file is Copyright 2012 by the GPSD project -+ * This file is Copyright by the GPSD project - * SPDX-License-Identifier: BSD-2-clause - */ - --#include "../include/gpsd_config.h" /* must be before all includes */ -+#include "../include/gpsd_config.h" // must be before all includes - - #if defined(NMEA2000_ENABLE) - -@@ -68,7 +68,7 @@ typedef struct PGN - - #if LOG_FILE - FILE *logFile = NULL; --#endif /* of if LOG_FILE */ -+#endif // of if LOG_FILE - - extern bool __attribute__ ((weak)) gpsd_add_device(const char *device_name, - bool flag_nowait); -@@ -89,14 +89,14 @@ static int scale_int(int32_t var, const int64_t factor) - static void print_data(struct gps_context_t *context, - unsigned char *buffer, int len, PGN *pgn) - { -- if ((libgps_debuglevel >= LOG_IO) != 0) { -- int l1, l2, ptr; -+ if (LOG_IO <= libgps_debuglevel) { -+ int l1; - char bu[128]; - -- ptr = 0; -- l2 = sprintf(&bu[ptr], "got data:%6u:%3d: ", pgn->pgn, len); -+ int ptr = 0; -+ int l2 = sprintf(&bu[ptr], "got data:%6u:%3d: ", pgn->pgn, len); - ptr += l2; -- for (l1=0;l1errout, "%s\n", bu); - ptr = 0; -@@ -276,7 +276,7 @@ static gps_mask_t hnd_127258(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { - print_data(session->context, bu, len, pgn); -- /* FIXME? Get magnetic variation */ -+ // FIXME? Get magnetic variation - GPSD_LOG(LOG_DATA, &session->context->errout, - "pgn %6d(%3d):\n", pgn->pgn, session->driver.nmea2000.unit); - return(0); -@@ -358,7 +358,7 @@ static gps_mask_t hnd_126992(unsigned char *bu, int len, PGN *pgn, - { - // uint8_t sid; - // uint8_t source; -- uint64_t usecs; /* time in us */ -+ uint64_t usecs; // time in us - - print_data(session->context, bu, len, pgn); - GPSD_LOG(LOG_DATA, &session->context->errout, -@@ -434,6 +434,7 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { - int l1; -+ int expected_len; - - print_data(session->context, bu, len, pgn); - GPSD_LOG(LOG_DATA, &session->context->errout, -@@ -441,24 +442,39 @@ static gps_mask_t hnd_129540(unsigned char *bu, int len, PGN *pgn, - - session->driver.nmea2000.sid[2] = bu[0]; - session->gpsdata.satellites_visible = (int)bu[2]; -+ if (MAXCHANNELS <= session->gpsdata.satellites_visible) { -+ // Handle a CVE for overrunning skyview[] -+ GPSD_LOG(LOG_WARN, &session->context->errout, -+ "pgn %6d(%3d): Too many sats %d\n", -+ pgn->pgn, session->driver.nmea2000.unit, -+ session->gpsdata.satellites_visible); -+ session->gpsdata.satellites_visible = MAXCHANNELS; -+ } -+ expected_len = 3 + (12 * session->gpsdata.satellites_visible); -+ if (len != expected_len) { -+ GPSD_LOG(LOG_WARN, &session->context->errout, -+ "pgn %6d(%3d): wrong length %d s/b %d\n", -+ pgn->pgn, session->driver.nmea2000.unit, -+ len, expected_len); -+ return 0; -+ } - - memset(session->gpsdata.skyview, '\0', sizeof(session->gpsdata.skyview)); -- for (l1=0;l1gpsdata.satellites_visible;l1++) { -- int svt; -- double azi, elev, snr; -- -- elev = getles16(bu, 3+12*l1+1) * 1e-4 * RAD_2_DEG; -- azi = getleu16(bu, 3+12*l1+3) * 1e-4 * RAD_2_DEG; -- snr = getles16(bu, 3+12*l1+5) * 1e-2; -+ for (l1 = 0; l1 < session->gpsdata.satellites_visible; l1++) { -+ int offset = 3 + (12 * l1); -+ double elev = getles16(bu, offset + 1) * 1e-4 * RAD_2_DEG; -+ double azi = getleu16(bu, offset + 3) * 1e-4 * RAD_2_DEG; -+ double snr = getles16(bu, offset + 5) * 1e-2; - -- svt = (int)(bu[3+12*l1+11] & 0x0f); -+ int svt = (int)(bu[offset + 11] & 0x0f); - -- session->gpsdata.skyview[l1].elevation = (short) (round(elev)); -- session->gpsdata.skyview[l1].azimuth = (short) (round(azi)); -+ session->gpsdata.skyview[l1].elevation = elev; -+ session->gpsdata.skyview[l1].azimuth = azi; - session->gpsdata.skyview[l1].ss = snr; -- session->gpsdata.skyview[l1].PRN = (short)bu[3+12*l1+0]; -+ session->gpsdata.skyview[l1].PRN = (int16_t)bu[offset]; - session->gpsdata.skyview[l1].used = false; -- if ((svt == 2) || (svt == 5)) { -+ if ((2 == svt) || -+ (5 == svt)) { - session->gpsdata.skyview[l1].used = true; - } - } -@@ -588,7 +604,7 @@ static gps_mask_t hnd_129029(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { - gps_mask_t mask; -- uint64_t usecs; /* time in us */ -+ uint64_t usecs; // time in us - - print_data(session->context, bu, len, pgn); - GPSD_LOG(LOG_DATA, &session->context->errout, -@@ -675,7 +691,7 @@ static gps_mask_t hnd_129038(unsigned char *bu, int len, PGN *pgn, - (unsigned int)ais_direction((unsigned int)getleu16(bu, 21), 1.0); - ais->type1.turn = ais_turn_rate((int)getles16(bu, 23)); - ais->type1.status = (unsigned int) ((bu[25] >> 0) & 0x0f); -- ais->type1.maneuver = 0; /* Not transmitted ???? */ -+ ais->type1.maneuver = 0; // Not transmitted ???? - decode_ais_channel_info(bu, len, 163, session); - - return(ONLINE_SET | AIS_SET); -@@ -730,8 +746,9 @@ static gps_mask_t hnd_129039(unsigned char *bu, int len, PGN *pgn, - - /* - * PGN 129040: AIS Class B Extended Position Report -+ * -+ * No test case for this message at the moment - */ --/* No test case for this message at the moment */ - static gps_mask_t hnd_129040(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { -@@ -781,8 +798,8 @@ static gps_mask_t hnd_129040(unsigned char *bu, int len, PGN *pgn, - ais->type19.epfd = (unsigned int) ((bu[23] >> 4) & 0x0f); - ais->type19.dte = (unsigned int) ((bu[52] >> 0) & 0x01); - ais->type19.assigned = (bool) ((bu[52] >> 1) & 0x01); -- for (l=0;ltype19.shipname[l] = (char) bu[32+l]; -+ for (l = 0; l < AIS_SHIPNAME_MAXLEN; l++) { -+ ais->type19.shipname[l] = (char)bu[32+l]; - } - ais->type19.shipname[AIS_SHIPNAME_MAXLEN] = (char) 0; - decode_ais_channel_info(bu, len, 422, session); -@@ -914,7 +931,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, - ais->type5.draught = (unsigned int) (getleu16(bu, 51)/10); - ais->type5.dte = (unsigned int) ((bu[73] >> 6) & 0x01); - -- for (l=0,cpy_stop=0;l<7;l++) { -+ for (l = 0, cpy_stop = 0; l < 7; l++) { - char next; - - next = (char) bu[9+l]; -@@ -929,7 +946,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, - } - ais->type5.callsign[7] = (char) 0; - -- for (l=0,cpy_stop=0;ltype5.shipname[AIS_SHIPNAME_MAXLEN] = (char) 0; - -- for (l=0,cpy_stop=0;l<20;l++) { -+ for (l = 0, cpy_stop = 0; l < 20; l++) { - char next; - - next = (char) bu[53+l]; -@@ -978,7 +995,7 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, - date2.tm_year+1900, - ais->type5.hour, - ais->type5.minute); --#endif /* of #if NMEA2000_DEBUG_AIS */ -+#endif // end of #if NMEA2000_DEBUG_AIS - decode_ais_channel_info(bu, len, 592, session); - return(ONLINE_SET | AIS_SET); - } -@@ -988,8 +1005,9 @@ static gps_mask_t hnd_129794(unsigned char *bu, int len, PGN *pgn, - - /* - * PGN 129798: AIS SAR Aircraft Position Report -+ * -+ * No test case for this message at the moment - */ --/* No test case for this message at the moment */ - static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { -@@ -1016,8 +1034,8 @@ static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, - ais->type9.alt = (unsigned int) (getleu64(bu, 21)/1000000); - ais->type9.regional = (unsigned int) ((bu[29] >> 0) & 0xff); - ais->type9.dte = (unsigned int) ((bu[30] >> 0) & 0x01); --/* ais->type9.spare = (bu[30] >> 1) & 0x7f; */ -- ais->type9.assigned = 0; /* Not transmitted ???? */ -+// ais->type9.spare = (bu[30] >> 1) & 0x7f; -+ ais->type9.assigned = 0; // Not transmitted ???? - decode_ais_channel_info(bu, len, 163, session); - - return(ONLINE_SET | AIS_SET); -@@ -1028,8 +1046,9 @@ static gps_mask_t hnd_129798(unsigned char *bu, int len, PGN *pgn, - - /* - * PGN 129802: AIS Safety Related Broadcast Message -+ * -+ * No test case for this message at the moment - */ --/* No test case for this message at the moment */ - static gps_mask_t hnd_129802(unsigned char *bu, int len, PGN *pgn, - struct gps_device_t *session) - { -@@ -1043,8 +1062,8 @@ static gps_mask_t hnd_129802(unsigned char *bu, int len, PGN *pgn, - if (decode_ais_header(session->context, bu, len, ais, 0x3fffffff) != 0) { - int l; - --/* ais->type14.channel = (bu[ 5] >> 0) & 0x1f; */ -- for (l=0;l<36;l++) { -+// ais->type14.channel = (bu[ 5] >> 0) & 0x1f; -+ for (l = 0; l < 36; l++) { - ais->type14.text[l] = (char) bu[6+l]; - } - ais->type14.text[36] = (char) 0; -@@ -1079,7 +1098,7 @@ static gps_mask_t hnd_129809(unsigned char *bu, int len, PGN *pgn, - "NMEA2000: AIS message 24A from %09u stashed.\n", - ais->mmsi); - -- for (l=0;ltype24.shipname[l] = (char) bu[ 5+l]; - saveptr->shipname[l] = (char) bu[ 5+l]; - } -@@ -1119,12 +1138,12 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, - - ais->type24.shiptype = (unsigned int) ((bu[ 5] >> 0) & 0xff); - -- for (l=0;l<7;l++) { -+ for (l = 0; l < 7; l++) { - ais->type24.vendorid[l] = (char) bu[ 6+l]; - } - ais->type24.vendorid[7] = (char) 0; - -- for (l=0;l<7;l++) { -+ for (l = 0; l < 7; l++) { - ais->type24.callsign[l] = (char) bu[13+l]; - } - ais->type24.callsign[7] = (char )0; -@@ -1158,7 +1177,7 @@ static gps_mask_t hnd_129810(unsigned char *bu, int len, PGN *pgn, - for (i = 0; i < MAX_TYPE24_INTERLEAVE; i++) { - if (session->driver.aivdm.context[0].type24_queue.ships[i].mmsi == - ais->mmsi) { -- for (l=0;ltype24.shipname[l] = - (char)(session->driver.aivdm.context[0].type24_queue.ships[i].shipname[l]); - } -@@ -1566,7 +1585,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - frame->can_id & 0x1ffffff); - if ((frame->can_dlc & 0x0f) > 0) { - int l1; -- for(l1=0;l1<(frame->can_dlc & 0x0f);l1++) { -+ for(l1 = 0; l1 < (frame->can_dlc & 0x0f); l1++) { - (void)fprintf(logFile, "%02x", frame->data[l1]); - } - } -@@ -1591,8 +1610,8 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - if (!session->driver.nmea2000.unit_valid) { - unsigned int l1, l2; - -- for (l1=0;l1driver.nmea2000.unit = l2; - session->driver.nmea2000.unit_valid = true; -@@ -1641,7 +1660,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - "pgn %6d:%s \n", work->pgn, work->name); - session->driver.nmea2000.workpgn = (void *) work; - session->lexer.outbuflen = frame->can_dlc & 0x0f; -- for (l2=0;l2lexer.outbuflen;l2++) { -+ for (l2 = 0; l2 < session->lexer.outbuflen; l2++) { - session->lexer.outbuffer[l2]= frame->data[l2]; - } - } else if ((frame->data[0] & 0x1f) == 0) { -@@ -1659,7 +1678,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - #endif /* of #if NMEA2000_FAST_DEBUG */ - session->lexer.inbuflen = 0; - session->driver.nmea2000.idx += 1; -- for (l2=2;l2<8;l2++) { -+ for (l2 = 2; l2 < 8; l2++) { - session->lexer.inbuffer[session->lexer.inbuflen++] = - frame->data[l2]; - } -@@ -1668,7 +1687,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - } else if (frame->data[0] == session->driver.nmea2000.idx) { - unsigned int l2; - -- for (l2=1;l2<8;l2++) { -+ for (l2 = 1; l2 < 8; l2++) { - if (session->driver.nmea2000.fast_packet_len > - session->lexer.inbuflen) { - session->lexer.inbuffer[session->lexer.inbuflen++] = -@@ -1689,7 +1708,7 @@ static void find_pgn(struct can_frame *frame, struct gps_device_t *session) - session->driver.nmea2000.workpgn = (void *) work; - session->lexer.outbuflen = - session->driver.nmea2000.fast_packet_len; -- for(l2 = 0;l2 < (unsigned int)session->lexer.outbuflen; -+ for(l2 = 0; l2 < (unsigned int)session->lexer.outbuflen; - l2++) { - session->lexer.outbuffer[l2] = - session->lexer.inbuffer[l2]; -@@ -1792,7 +1811,7 @@ int nmea2000_open(struct gps_device_t *session) - (void)strlcpy(interface_name, session->gpsdata.dev.path + 11, - sizeof(interface_name)); - unit_ptr = NULL; -- for (l=0;ldriver.nmea2000.unit_valid = false; -- for (l=0;ldriver.nmea2000.unit_valid) { - unsigned int l1, l2; - -- for (l1=0;l1driver.nmea2000.unit_valid = false; - session->driver.nmea2000.unit = 0; --- -2.52.0 - diff --git a/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch b/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch deleted file mode 100644 index 80507847c46b..000000000000 --- a/package/gpsd/0006-gpsd-packet.c-Fix-integer-underflow-is-malicious-Nav.patch +++ /dev/null @@ -1,161 +0,0 @@ -From b28910e0d5a48de4cb4d8675689297dc407af0c6 Mon Sep 17 00:00:00 2001 -From: "Gary E. Miller" -Date: Wed, 3 Dec 2025 19:04:03 -0800 -Subject: [PATCH] gpsd/packet.c: Fix integer underflow is malicious Navcom - packet - -Causes DoS. Fix issue 358 - -CVE: CVE-2025-67269 -Upstream: https://gitlab.com/gpsd/gpsd/-/commit/ffa1d6f40bca0b035fc7f5e563160ebb67199da7 -Signed-off-by: Thomas Petazzoni ---- - gpsd/packet.c | 64 ++++++++++++++++++++++++++++++++++++++------------- - 1 file changed, 48 insertions(+), 16 deletions(-) - -diff --git a/gpsd/packet.c b/gpsd/packet.c -index f9a7db8d0..0c2350072 100644 ---- a/gpsd/packet.c -+++ b/gpsd/packet.c -@@ -1141,18 +1141,22 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - #endif // SIRF_ENABLE || SKYTRAQ_ENABLE - #ifdef SIRF_ENABLE - case SIRF_LEADER_2: -- // first part of length -- lexer->length = (size_t) (c << 8); -+ // first part of length, MSB -+ lexer->length = (c & 0x7f) << 8; -+ if (lexer->length > MAX_PACKET_LENGTH) { -+ lexer->length = 0; -+ return character_pushback(lexer, GROUND_STATE); -+ } // else - lexer->state = SIRF_LENGTH_1; - break; - case SIRF_LENGTH_1: - // second part of length - lexer->length += c + 2; -- if (lexer->length <= MAX_PACKET_LENGTH) { -- lexer->state = SIRF_PAYLOAD; -- } else { -+ if (lexer->length > MAX_PACKET_LENGTH) { -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); -- } -+ } // else -+ lexer->state = SIRF_PAYLOAD; - break; - case SIRF_PAYLOAD: - if (0 == --lexer->length) { -@@ -1194,6 +1198,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - return character_pushback(lexer, GROUND_STATE); - } - if (MAX_PACKET_LENGTH < lexer->length) { -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); - } - lexer->state = SKY_PAYLOAD; -@@ -1376,14 +1381,29 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - } - break; - case NAVCOM_LEADER_3: -+ // command ID - lexer->state = NAVCOM_ID; - break; - case NAVCOM_ID: -- lexer->length = (size_t)c - 4; -+ /* Length LSB -+ * Navcom length includes command ID, length bytes. and checksum. -+ * So for more than just the payload length. -+ * Minimum 4 bytes */ -+ if (4 > c) { -+ return character_pushback(lexer, GROUND_STATE); -+ } -+ lexer->length = c; - lexer->state = NAVCOM_LENGTH_1; - break; - case NAVCOM_LENGTH_1: -+ // Length USB. Navcom allows payload length up to 65,531 - lexer->length += (c << 8); -+ // don't count ID, length and checksum in payload length -+ lexer->length -= 4; -+ if (MAX_PACKET_LENGTH < lexer->length) { -+ lexer->length = 0; -+ return character_pushback(lexer, GROUND_STATE); -+ } // else - lexer->state = NAVCOM_LENGTH_2; - break; - case NAVCOM_LENGTH_2: -@@ -1510,11 +1530,11 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - lexer->length += 2; // checksum - // 10 bytes is the length of the Zodiac header - // no idea what Zodiac max length really is -- if ((MAX_PACKET_LENGTH - 10) >= lexer->length) { -- lexer->state = ZODIAC_PAYLOAD; -- } else { -+ if ((MAX_PACKET_LENGTH - 10) < lexer->length) { -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); -- } -+ } // else -+ lexer->state = ZODIAC_PAYLOAD; - break; - case ZODIAC_PAYLOAD: - if (0 == --lexer->length) { -@@ -1549,6 +1569,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - lexer->state = UBX_LENGTH_2; - } else { - // bad length -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); - } - break; -@@ -1604,6 +1625,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - lexer->length += (c << 8); - if (MAX_PACKET_LENGTH <= lexer->length) { - // bad length -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); - } // else - -@@ -1841,16 +1863,16 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - lexer->state = GEOSTAR_MESSAGE_ID_2; - break; - case GEOSTAR_MESSAGE_ID_2: -- lexer->length = (size_t)c * 4; -+ lexer->length = c * 4; - lexer->state = GEOSTAR_LENGTH_1; - break; - case GEOSTAR_LENGTH_1: - lexer->length += (c << 8) * 4; -- if (MAX_PACKET_LENGTH >= lexer->length) { -- lexer->state = GEOSTAR_LENGTH_2; -- } else { -+ if (MAX_PACKET_LENGTH < lexer->length) { -+ lexer->length = 0; - return character_pushback(lexer, GROUND_STATE); -- } -+ } // else -+ lexer->state = GEOSTAR_LENGTH_2; - break; - case GEOSTAR_LENGTH_2: - lexer->state = GEOSTAR_PAYLOAD; -@@ -2160,6 +2182,16 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c) - #endif // STASH_ENABLE - } - -+ /* Catch length overflow. Should not happen. -+ * length is size_t, so underflow looks like overflow too. */ -+ if (MAX_PACKET_LENGTH <= lexer->length) { -+ GPSD_LOG(LOG_WARN, &lexer->errout, -+ "Too long: %zu state %u %s c x%x\n", -+ lexer->length, lexer->state, state_table[lexer->state], c); -+ // exit(255); -+ lexer->length = 0; -+ return character_pushback(lexer, GROUND_STATE); -+ } - return true; // no pushback - } - --- -2.52.0 - diff --git a/package/gpsd/gpsd.hash b/package/gpsd/gpsd.hash index 984ddab125a3..a7b76afbc6b1 100644 --- a/package/gpsd/gpsd.hash +++ b/package/gpsd/gpsd.hash @@ -1,3 +1,3 @@ # Locally calculated -sha256 dc7e465968c1540e61bc57c7586d6a57a0047212a014efdad348f907bc2e0990 gpsd-3.26.1.tar.gz +sha256 ebb66ed92018b79cec88efb60e35a596925eef46502cf03d6ff0aea636ee7461 gpsd-3.27.2.tar.gz sha256 fdf339997bbca9eaf507476b82fbcac608fc39a3d89b86b51e16db4c9f933716 COPYING diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk index 99cc0b8161e5..6dc01253a571 100644 --- a/package/gpsd/gpsd.mk +++ b/package/gpsd/gpsd.mk @@ -4,7 +4,7 @@ # ################################################################################ -GPSD_VERSION = 3.26.1 +GPSD_VERSION = 3.27.2 GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd GPSD_LICENSE = BSD-2-Clause GPSD_LICENSE_FILES = COPYING