From 4f53a26f064ad676374c70457083f13f946f008f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 13 Apr 2021 21:33:25 +0800 Subject: [PATCH 01/10] scripts/download.pl: update mirrors Signed-off-by: Tianling Shen --- scripts/download.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download.pl b/scripts/download.pl index fb77df4ca3..5f5ec266ff 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -280,9 +280,9 @@ foreach my $mirror (@ARGV) { } } -unshift @mirrors, "https://openwrt.cc/dl/immortalwrt/openwrt-18.06"; -unshift @mirrors, "https://mirror01.download.immortalwrt.org/openwrt-18.06"; +unshift @mirrors, "https://mirror01.download.immortalwrt.eu.org/openwrt-18.06"; unshift @mirrors, "http://182.140.223.146/dl"; +push @mirrors, "https://openwrt.cc/dl/immortalwrt/openwrt-18.06"; push @mirrors, 'https://sources.cdn.openwrt.org'; push @mirrors, 'https://sources.openwrt.org'; push @mirrors, 'https://mirror2.openwrt.org/sources'; From 9d03842e2c3895f5367d3997aa7794aec77bace9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 13 Apr 2021 17:18:27 +0200 Subject: [PATCH 02/10] kernel: crypto: format "crypto-hw-ccp" dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use multiples lines for better readability and sort lines. Suggested-by: Stijn Tintel Signed-off-by: Rafał Miłecki --- package/kernel/linux/modules/crypto.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 3a5a4f2036..18877d0648 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -307,7 +307,14 @@ $(eval $(call KernelPackage,crypto-hmac)) define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor - DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 +!LINUX_4_9:kmod-crypto-rsa + DEPENDS:= \ + +kmod-crypto-authenc \ + +kmod-crypto-hash \ + +kmod-crypto-manager \ + +!LINUX_4_9:kmod-crypto-rsa \ + +kmod-crypto-sha1 \ + +kmod-crypto-sha256 \ + +kmod-random-core KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_CCP=y \ From bf1bbe4a0bc980608169e27323e15c77c0248b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 13 Apr 2021 10:15:39 +0200 Subject: [PATCH 03/10] kernel: limit crypto-hw-ccp to the x86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRYPTO_DEV_CCP depends on X86 or ARM64 CRYPTO_DEV_CCP_DD depends on CPU_SUP_AMD or ARM64 Compiling this driver makes sense for x86 mainly. If one day support for ARM64 board with AMD Secure Processor gets added this package may be updated. Trying to build this package on bcm4908 was causing: ERROR: module 'build_dir/target-aarch64_cortex-a53_musl/linux-bcm4908_generic/linux-5.4.110/drivers/crypto/ccp/ccp-crypto.ko' is missing. Signed-off-by: Rafał Miłecki --- package/kernel/linux/modules/crypto.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 18877d0648..a588459f1e 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -308,6 +308,7 @@ $(eval $(call KernelPackage,crypto-hmac)) define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor DEPENDS:= \ + @TARGET_x86 \ +kmod-crypto-authenc \ +kmod-crypto-hash \ +kmod-crypto-manager \ From 662a7b3aa546250f32d7605ae66f07ecb50b87a0 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 14 Feb 2021 19:41:40 +0100 Subject: [PATCH 04/10] mac80211: Remove 357-mac80211-optimize-skb-resizing.patch This patch was adapted to apply on top of some stable changes, but we are not sure if this is working correctly. Felix suggested to remove this patch for now. Fixes: 0a59e2a76e6d ("mac80211: Update to version 4.19.161-1") Signed-off-by: Hauke Mehrtens --- .../357-mac80211-optimize-skb-resizing.patch | 215 ------------------ ...ee80211_schedule_txq-schedule-empty-.patch | 6 +- ...ing-iTXQ-select-the-queue-in-ieee802.patch | 4 +- ...nd-deauth-when-expiring-inactive-STA.patch | 2 +- 4 files changed, 6 insertions(+), 221 deletions(-) delete mode 100644 package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch diff --git a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch deleted file mode 100644 index e7e8a0b286..0000000000 --- a/package/kernel/mac80211/patches/subsys/357-mac80211-optimize-skb-resizing.patch +++ /dev/null @@ -1,215 +0,0 @@ -From: Felix Fietkau -Date: Sun, 17 Mar 2019 18:11:30 +0100 -Subject: [PATCH] mac80211: optimize skb resizing - -When forwarding unicast packets from ethernet to batman-adv over 802.11s -(with forwarding disabled), the typical required headroom to transmit -encrypted packets on mt76 is 32 (802.11) + 6 (802.11s) + 8 (CCMP) + -2 (padding) + 6 (LLC) + 18 (batman-adv) - 14 (old ethernet header) = 58 bytes. - -On systems where NET_SKB_PAD is 64 this leads to a call to pskb_expand_head -for every packet, since mac80211 also tries to allocate 16 bytes status -headroom for radiotap headers. - -This patch fixes these unnecessary reallocations by only requiring the extra -status headroom in ieee80211_tx_monitor() -If however a reallocation happens before that call, the status headroom gets -added there as well, in order to avoid double reallocation. - -The patch also cleans up the code by moving the headroom calculation to -ieee80211_skb_resize. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1762,6 +1762,9 @@ void ieee80211_clear_fast_xmit(struct st - int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, - const u8 *buf, size_t len, - const u8 *dest, __be16 proto, bool unencrypted); -+int ieee80211_skb_resize(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct sk_buff *skb, int hdrlen, int hdr_add); - - /* HT */ - void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -671,6 +671,11 @@ void ieee80211_tx_monitor(struct ieee802 - } - } - -+ if (ieee80211_skb_resize(local, NULL, skb, 0, 0)) { -+ dev_kfree_skb(skb); -+ return; -+ } -+ - /* send frame to monitor interfaces now */ - rtap_len = ieee80211_tx_radiotap_len(info); - if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) { ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1914,42 +1914,53 @@ static bool ieee80211_tx(struct ieee8021 - } - - /* device xmit handlers */ -- --enum ieee80211_encrypt { -- ENCRYPT_NO, -- ENCRYPT_MGMT, -- ENCRYPT_DATA, --}; -- --static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata, -- struct sk_buff *skb, -- int head_need, -- enum ieee80211_encrypt encrypt) -+int ieee80211_skb_resize(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct sk_buff *skb, int hdr_len, int hdr_extra) - { -- struct ieee80211_local *local = sdata->local; -- bool enc_tailroom; -- int tail_need = 0; -- -- enc_tailroom = encrypt == ENCRYPT_MGMT || -- (encrypt == ENCRYPT_DATA && -- sdata->crypto_tx_tailroom_needed_cnt); -- -- if (enc_tailroom) { -- tail_need = IEEE80211_ENCRYPT_TAILROOM; -- tail_need -= skb_tailroom(skb); -- tail_need = max_t(int, tail_need, 0); -+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -+ struct ieee80211_hdr *hdr; -+ int head_need, head_max; -+ int tail_need, tail_max; -+ bool enc_tailroom = false; -+ -+ if (sdata && !hdr_len && -+ !(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) { -+ hdr = (struct ieee80211_hdr *) skb->data; -+ enc_tailroom = (sdata->crypto_tx_tailroom_needed_cnt || -+ ieee80211_is_mgmt(hdr->frame_control)); -+ hdr_len += sdata->encrypt_headroom; -+ } -+ -+ head_need = head_max = hdr_len; -+ tail_need = tail_max = 0; -+ if (!sdata) { -+ head_need = head_max = local->tx_headroom; -+ } else { -+ head_max += hdr_extra; -+ head_max += max_t(int, local->tx_headroom, -+ local->hw.extra_tx_headroom); -+ head_need += local->hw.extra_tx_headroom; -+ -+ tail_max = IEEE80211_ENCRYPT_TAILROOM; -+ if (enc_tailroom) -+ tail_need = tail_max; - } - - if (skb_cloned(skb) && - (!ieee80211_hw_check(&local->hw, SUPPORTS_CLONED_SKBS) || - !skb_clone_writable(skb, ETH_HLEN) || enc_tailroom)) - I802_DEBUG_INC(local->tx_expand_skb_head_cloned); -- else if (head_need || tail_need) -+ else if (head_need > skb_headroom(skb) || -+ tail_need > skb_tailroom(skb)) - I802_DEBUG_INC(local->tx_expand_skb_head); - else - return 0; - -- if (pskb_expand_head(skb, head_need, tail_need, GFP_ATOMIC)) { -+ head_max = max_t(int, 0, head_max - skb_headroom(skb)); -+ tail_max = max_t(int, 0, tail_max - skb_tailroom(skb)); -+ -+ if (pskb_expand_head(skb, head_max, tail_max, GFP_ATOMIC)) { - wiphy_debug(local->hw.wiphy, - "failed to reallocate TX buffer\n"); - return -ENOMEM; -@@ -1964,24 +1975,9 @@ void ieee80211_xmit(struct ieee80211_sub - { - struct ieee80211_local *local = sdata->local; - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; -- int headroom; -- enum ieee80211_encrypt encrypt; -- -- if (info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT) -- encrypt = ENCRYPT_NO; -- else if (ieee80211_is_mgmt(hdr->frame_control)) -- encrypt = ENCRYPT_MGMT; -- else -- encrypt = ENCRYPT_DATA; -- -- headroom = local->tx_headroom; -- if (encrypt != ENCRYPT_NO) -- headroom += sdata->encrypt_headroom; -- headroom -= skb_headroom(skb); -- headroom = max_t(int, 0, headroom); -+ struct ieee80211_hdr *hdr; - -- if (ieee80211_skb_resize(sdata, skb, headroom, encrypt)) { -+ if (ieee80211_skb_resize(local, sdata, skb, 0, 0)) { - ieee80211_free_txskb(&local->hw, skb); - return; - } -@@ -2752,30 +2748,14 @@ static struct sk_buff *ieee80211_build_h - - skb_pull(skb, skip_header_bytes); - padsize = ieee80211_hdr_padsize(&local->hw, hdrlen); -- head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb); -+ head_need = hdrlen + encaps_len + meshhdrlen; - head_need += padsize; - -- /* -- * So we need to modify the skb header and hence need a copy of -- * that. The head_need variable above doesn't, so far, include -- * the needed header space that we don't need right away. If we -- * can, then we don't reallocate right now but only after the -- * frame arrives at the master device (if it does...) -- * -- * If we cannot, however, then we will reallocate to include all -- * the ever needed space. Also, if we need to reallocate it anyway, -- * make it big enough for everything we may ever need. -- */ -- -- if (head_need > 0 || skb_cloned(skb)) { -- head_need += sdata->encrypt_headroom; -- head_need += local->tx_headroom; -- head_need = max_t(int, 0, head_need); -- if (ieee80211_skb_resize(sdata, skb, head_need, ENCRYPT_DATA)) { -- ieee80211_free_txskb(&local->hw, skb); -- skb = NULL; -- return ERR_PTR(-ENOMEM); -- } -+ if (ieee80211_skb_resize(local, sdata, skb, head_need, -+ sdata->encrypt_headroom)) { -+ ieee80211_free_txskb(&local->hw, skb); -+ skb = NULL; -+ return ERR_PTR(-ENOMEM); - } - - if (encaps_data) -@@ -3388,7 +3368,6 @@ static bool ieee80211_xmit_fast(struct i - struct ieee80211_local *local = sdata->local; - u16 ethertype = (skb->data[12] << 8) | skb->data[13]; - int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2); -- int hw_headroom = sdata->local->hw.extra_tx_headroom; - struct ethhdr eth; - struct ieee80211_tx_info *info; - struct ieee80211_hdr *hdr = (void *)fast_tx->hdr; -@@ -3440,10 +3419,7 @@ static bool ieee80211_xmit_fast(struct i - * as the may-encrypt argument for the resize to not account for - * more room than we already have in 'extra_head' - */ -- if (unlikely(ieee80211_skb_resize(sdata, skb, -- max_t(int, extra_head + hw_headroom - -- skb_headroom(skb), 0), -- ENCRYPT_NO))) { -+ if (unlikely(ieee80211_skb_resize(local, sdata, skb, extra_head, 0))) { - kfree_skb(skb); - return true; - } diff --git a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch b/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch index c1e0c5c24c..9c6a7e4f74 100644 --- a/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch +++ b/package/kernel/mac80211/patches/subsys/358-mac80211-make-ieee80211_schedule_txq-schedule-empty-.patch @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau /** --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3674,8 +3674,9 @@ out: +@@ -3698,8 +3698,9 @@ out: } EXPORT_SYMBOL(ieee80211_next_txq); @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau { struct ieee80211_local *local = hw_to_local(hw); struct txq_info *txqi = to_txq_info(txq); -@@ -3683,7 +3684,8 @@ void ieee80211_schedule_txq(struct ieee8 +@@ -3707,7 +3708,8 @@ void ieee80211_schedule_txq(struct ieee8 spin_lock_bh(&local->active_txq_lock[txq->ac]); if (list_empty(&txqi->schedule_order) && @@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau /* If airtime accounting is active, always enqueue STAs at the * head of the list to ensure that they only get moved to the * back by the airtime DRR scheduler once they have a negative -@@ -3703,7 +3705,7 @@ void ieee80211_schedule_txq(struct ieee8 +@@ -3727,7 +3729,7 @@ void ieee80211_schedule_txq(struct ieee8 spin_unlock_bh(&local->active_txq_lock[txq->ac]); } diff --git a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch b/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch index ea86758ea0..6e8cff46ac 100644 --- a/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch +++ b/package/kernel/mac80211/patches/subsys/360-mac80211-when-using-iTXQ-select-the-queue-in-ieee802.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3773,6 +3773,7 @@ void __ieee80211_subif_start_xmit(struct +@@ -3797,6 +3797,7 @@ void __ieee80211_subif_start_xmit(struct u32 ctrl_flags) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau struct sta_info *sta; struct sk_buff *next; -@@ -3786,7 +3787,15 @@ void __ieee80211_subif_start_xmit(struct +@@ -3810,7 +3811,15 @@ void __ieee80211_subif_start_xmit(struct if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) goto out_free; diff --git a/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch b/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch index 20345cf924..5fa8fcddcb 100644 --- a/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch +++ b/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch @@ -54,7 +54,7 @@ Signed-off-by: Johannes Berg } --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -2071,7 +2071,8 @@ void ieee80211_send_auth(struct ieee8021 +@@ -2068,7 +2068,8 @@ void ieee80211_send_auth(struct ieee8021 const u8 *da, const u8 *key, u8 key_len, u8 key_idx, u32 tx_flags); void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, From a3f306c5497d49ae255ba36bdfd771db11f0d449 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 2 Apr 2021 12:21:24 +0200 Subject: [PATCH 05/10] mac80211: backport upstream fixes Refreshed all patches. Includes all fixes up to 4.19.184 Signed-off-by: Koen Vandeputte --- ...et-set-TDLS-STA-bandwidth-wider-than.patch | 65 +++++++++++++++++ ...use-TX-while-changing-interface-type.patch | 57 +++++++++++++++ ...ac80211-fix-fast-rx-encryption-check.patch | 29 ++++++++ ...-station-rate-table-updates-on-assoc.patch | 49 +++++++++++++ ...ential-overflow-when-multiplying-to-.patch | 34 +++++++++ .../374-mac80211-fix-rate-mask-reset.patch | 50 ++++++++++++++ ...c80211-fix-double-free-in-ibss_leave.patch | 69 +++++++++++++++++++ .../522-mac80211_configure_antenna_gain.patch | 2 +- 8 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch create mode 100644 package/kernel/mac80211/patches/subsys/370-mac80211-pause-TX-while-changing-interface-type.patch create mode 100644 package/kernel/mac80211/patches/subsys/371-mac80211-fix-fast-rx-encryption-check.patch create mode 100644 package/kernel/mac80211/patches/subsys/372-mac80211-fix-station-rate-table-updates-on-assoc.patch create mode 100644 package/kernel/mac80211/patches/subsys/373-mac80211-fix-potential-overflow-when-multiplying-to-.patch create mode 100644 package/kernel/mac80211/patches/subsys/374-mac80211-fix-rate-mask-reset.patch create mode 100644 package/kernel/mac80211/patches/subsys/375-mac80211-fix-double-free-in-ibss_leave.patch diff --git a/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch b/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch new file mode 100644 index 0000000000..a88b24d402 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch @@ -0,0 +1,65 @@ +From ebbd7dc7ca856a182769c17c4c8a739cedc064c4 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Sun, 6 Dec 2020 14:54:44 +0200 +Subject: [PATCH] mac80211: don't set set TDLS STA bandwidth wider than + possible + +[ Upstream commit f65607cdbc6b0da356ef5a22552ddd9313cf87a0 ] + +When we set up a TDLS station, we set sta->sta.bandwidth solely based +on the capabilities, because the "what's the current bandwidth" check +is bypassed and only applied for other types of stations. + +This leads to the unfortunate scenario that the sta->sta.bandwidth is +160 MHz if both stations support it, but we never actually configure +this bandwidth unless the AP is already using 160 MHz; even for wider +bandwidth support we only go up to 80 MHz (at least right now.) + +For iwlwifi, this can also lead to firmware asserts, telling us that +we've configured the TX rates for a higher bandwidth than is actually +available due to the PHY configuration. + +For non-TDLS, we check against the interface's requested bandwidth, +but we explicitly skip this check for TDLS to cope with the wider BW +case. Change this to + (a) still limit to the TDLS peer's own chandef, which gets factored + into the overall PHY configuration we request from the driver, + and + (b) limit it to when the TDLS peer is authorized, because it's only + factored into the channel context in this case. + +Fixes: 504871e602d9 ("mac80211: fix bandwidth computation for TDLS peers") +Signed-off-by: Johannes Berg +Signed-off-by: Luca Coelho +Link: https://lore.kernel.org/r/iwlwifi.20201206145305.fcc7d29c4590.I11f77e9e25ddf871a3c8d5604650c763e2c5887a@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/vht.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/net/mac80211/vht.c ++++ b/net/mac80211/vht.c +@@ -421,12 +421,18 @@ enum ieee80211_sta_rx_bandwidth ieee8021 + * IEEE80211-2016 specification makes higher bandwidth operation + * possible on the TDLS link if the peers have wider bandwidth + * capability. ++ * ++ * However, in this case, and only if the TDLS peer is authorized, ++ * limit to the tdls_chandef so that the configuration here isn't ++ * wider than what's actually requested on the channel context. + */ + if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && +- test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW)) +- return bw; +- +- bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width)); ++ test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW) && ++ test_sta_flag(sta, WLAN_STA_AUTHORIZED) && ++ sta->tdls_chandef.chan) ++ bw = min(bw, ieee80211_chan_width_to_rx_bw(sta->tdls_chandef.width)); ++ else ++ bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width)); + + return bw; + } diff --git a/package/kernel/mac80211/patches/subsys/370-mac80211-pause-TX-while-changing-interface-type.patch b/package/kernel/mac80211/patches/subsys/370-mac80211-pause-TX-while-changing-interface-type.patch new file mode 100644 index 0000000000..ce9776c112 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/370-mac80211-pause-TX-while-changing-interface-type.patch @@ -0,0 +1,57 @@ +From b26b5e0861578fa7cdf444b1aa61d06f739eb306 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Fri, 22 Jan 2021 17:11:16 +0100 +Subject: [PATCH] mac80211: pause TX while changing interface type + +[ Upstream commit 054c9939b4800a91475d8d89905827bf9e1ad97a ] + +syzbot reported a crash that happened when changing the interface +type around a lot, and while it might have been easy to fix just +the symptom there, a little deeper investigation found that really +the reason is that we allowed packets to be transmitted while in +the middle of changing the interface type. + +Disallow TX by stopping the queues while changing the type. + +Fixes: 34d4bc4d41d2 ("mac80211: support runtime interface type changes") +Reported-by: syzbot+d7a3b15976bf7de2238a@syzkaller.appspotmail.com +Link: https://lore.kernel.org/r/20210122171115.b321f98f4d4f.I6997841933c17b093535c31d29355be3c0c39628@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/ieee80211_i.h | 1 + + net/mac80211/iface.c | 6 ++++++ + 2 files changed, 7 insertions(+) + +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -1057,6 +1057,7 @@ enum queue_stop_reason { + IEEE80211_QUEUE_STOP_REASON_FLUSH, + IEEE80211_QUEUE_STOP_REASON_TDLS_TEARDOWN, + IEEE80211_QUEUE_STOP_REASON_RESERVE_TID, ++ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE, + + IEEE80211_QUEUE_STOP_REASONS, + }; +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1621,6 +1621,10 @@ static int ieee80211_runtime_change_ifty + if (ret) + return ret; + ++ ieee80211_stop_vif_queues(local, sdata, ++ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE); ++ synchronize_net(); ++ + ieee80211_do_stop(sdata, false); + + ieee80211_teardown_sdata(sdata); +@@ -1641,6 +1645,8 @@ static int ieee80211_runtime_change_ifty + err = ieee80211_do_open(&sdata->wdev, false); + WARN(err, "type change: do_open returned %d", err); + ++ ieee80211_wake_vif_queues(local, sdata, ++ IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE); + return ret; + } + diff --git a/package/kernel/mac80211/patches/subsys/371-mac80211-fix-fast-rx-encryption-check.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-fix-fast-rx-encryption-check.patch new file mode 100644 index 0000000000..f6ce40ac24 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/371-mac80211-fix-fast-rx-encryption-check.patch @@ -0,0 +1,29 @@ +From b70798906c4c85314511cf6d5cae98385861fc07 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 18 Dec 2020 19:47:17 +0100 +Subject: [PATCH] mac80211: fix fast-rx encryption check + +[ Upstream commit 622d3b4e39381262da7b18ca1ed1311df227de86 ] + +When using WEP, the default unicast key needs to be selected, instead of +the STA PTK. + +Signed-off-by: Felix Fietkau +Link: https://lore.kernel.org/r/20201218184718.93650-5-nbd@nbd.name +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/rx.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -4019,6 +4019,8 @@ void ieee80211_check_fast_rx(struct sta_ + + rcu_read_lock(); + key = rcu_dereference(sta->ptk[sta->ptk_idx]); ++ if (!key) ++ key = rcu_dereference(sdata->default_unicast_key); + if (key) { + switch (key->conf.cipher) { + case WLAN_CIPHER_SUITE_TKIP: diff --git a/package/kernel/mac80211/patches/subsys/372-mac80211-fix-station-rate-table-updates-on-assoc.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-fix-station-rate-table-updates-on-assoc.patch new file mode 100644 index 0000000000..693904b495 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/372-mac80211-fix-station-rate-table-updates-on-assoc.patch @@ -0,0 +1,49 @@ +From 1d3a84f92f75bb0c2f981a75f507f55afed12f2c Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 1 Feb 2021 09:33:24 +0100 +Subject: [PATCH] mac80211: fix station rate table updates on assoc + +commit 18fe0fae61252b5ae6e26553e2676b5fac555951 upstream. + +If the driver uses .sta_add, station entries are only uploaded after the sta +is in assoc state. Fix early station rate table updates by deferring them +until the sta has been uploaded. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +Link: https://lore.kernel.org/r/20210201083324.3134-1-nbd@nbd.name +[use rcu_access_pointer() instead since we won't dereference here] +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/driver-ops.c | 5 ++++- + net/mac80211/rate.c | 3 ++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -128,8 +128,11 @@ int drv_sta_state(struct ieee80211_local + } else if (old_state == IEEE80211_STA_AUTH && + new_state == IEEE80211_STA_ASSOC) { + ret = drv_sta_add(local, sdata, &sta->sta); +- if (ret == 0) ++ if (ret == 0) { + sta->uploaded = true; ++ if (rcu_access_pointer(sta->sta.rates)) ++ drv_sta_rate_tbl_update(local, sdata, &sta->sta); ++ } + } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH) { + drv_sta_remove(local, sdata, &sta->sta); +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -941,7 +941,8 @@ int rate_control_set_rates(struct ieee80 + if (old) + kfree_rcu(old, rcu_head); + +- drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); ++ if (sta->uploaded) ++ drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); + + ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta)); + diff --git a/package/kernel/mac80211/patches/subsys/373-mac80211-fix-potential-overflow-when-multiplying-to-.patch b/package/kernel/mac80211/patches/subsys/373-mac80211-fix-potential-overflow-when-multiplying-to-.patch new file mode 100644 index 0000000000..f5d9d843f5 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/373-mac80211-fix-potential-overflow-when-multiplying-to-.patch @@ -0,0 +1,34 @@ +From 2a4b99ffcda9f6739d4deb7bd7d2e0ed8444dda7 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Fri, 5 Feb 2021 17:53:52 +0000 +Subject: [PATCH] mac80211: fix potential overflow when multiplying to u32 + integers + +[ Upstream commit 6194f7e6473be78acdc5d03edd116944bdbb2c4e ] + +The multiplication of the u32 variables tx_time and estimated_retx is +performed using a 32 bit multiplication and the result is stored in +a u64 result. This has a potential u32 overflow issue, so avoid this +by casting tx_time to a u64 to force a 64 bit multiply. + +Addresses-Coverity: ("Unintentional integer overflow") +Fixes: 050ac52cbe1f ("mac80211: code for on-demand Hybrid Wireless Mesh Protocol") +Signed-off-by: Colin Ian King +Link: https://lore.kernel.org/r/20210205175352.208841-1-colin.king@canonical.com +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/mesh_hwmp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -355,7 +355,7 @@ static u32 airtime_link_metric_get(struc + */ + tx_time = (device_constant + 10 * test_frame_len / rate); + estimated_retx = ((1 << (2 * ARITH_SHIFT)) / (s_unit - err)); +- result = (tx_time * estimated_retx) >> (2 * ARITH_SHIFT); ++ result = ((u64)tx_time * estimated_retx) >> (2 * ARITH_SHIFT); + return (u32)result; + } + diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-fix-rate-mask-reset.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-fix-rate-mask-reset.patch new file mode 100644 index 0000000000..36d5bee123 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/374-mac80211-fix-rate-mask-reset.patch @@ -0,0 +1,50 @@ +From 4311a94e7598ca19311b04eb965556b5bb33accd Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Fri, 12 Feb 2021 11:22:14 +0100 +Subject: [PATCH] mac80211: fix rate mask reset + +[ Upstream commit 1944015fe9c1d9fa5e9eb7ffbbb5ef8954d6753b ] + +Coverity reported the strange "if (~...)" condition that's +always true. It suggested that ! was intended instead of ~, +but upon further analysis I'm convinced that what really was +intended was a comparison to 0xff/0xffff (in HT/VHT cases +respectively), since this indicates that all of the rates +are enabled. + +Change the comparison accordingly. + +I'm guessing this never really mattered because a reset to +not having a rate mask is basically equivalent to having a +mask that enables all rates. + +Reported-by: Colin Ian King +Fixes: 2ffbe6d33366 ("mac80211: fix and optimize MCS mask handling") +Fixes: b119ad6e726c ("mac80211: add rate mask logic for vht rates") +Reviewed-by: Colin Ian King +Link: https://lore.kernel.org/r/20210212112213.36b38078f569.I8546a20c80bc1669058eb453e213630b846e107b@changeid +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/mac80211/cfg.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2779,14 +2779,14 @@ static int ieee80211_set_bitrate_mask(st + continue; + + for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { +- if (~sdata->rc_rateidx_mcs_mask[i][j]) { ++ if (sdata->rc_rateidx_mcs_mask[i][j] != 0xff) { + sdata->rc_has_mcs_mask[i] = true; + break; + } + } + + for (j = 0; j < NL80211_VHT_NSS_MAX; j++) { +- if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) { ++ if (sdata->rc_rateidx_vht_mcs_mask[i][j] != 0xffff) { + sdata->rc_has_vht_mcs_mask[i] = true; + break; + } diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-fix-double-free-in-ibss_leave.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-fix-double-free-in-ibss_leave.patch new file mode 100644 index 0000000000..e5245811bc --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/375-mac80211-fix-double-free-in-ibss_leave.patch @@ -0,0 +1,69 @@ +From 7da363fba2fc8526dbf3f966bac6f03fec98f095 Mon Sep 17 00:00:00 2001 +From: Markus Theil +Date: Sat, 13 Feb 2021 14:36:53 +0100 +Subject: [PATCH] mac80211: fix double free in ibss_leave + +commit 3bd801b14e0c5d29eeddc7336558beb3344efaa3 upstream. + +Clear beacon ie pointer and ie length after free +in order to prevent double free. + +================================================================== +BUG: KASAN: double-free or invalid-free \ +in ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876 + +CPU: 0 PID: 8472 Comm: syz-executor100 Not tainted 5.11.0-rc6-syzkaller #0 +Call Trace: + __dump_stack lib/dump_stack.c:79 [inline] + dump_stack+0x107/0x163 lib/dump_stack.c:120 + print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 + kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 + ____kasan_slab_free+0xcc/0xe0 mm/kasan/common.c:341 + kasan_slab_free include/linux/kasan.h:192 [inline] + __cache_free mm/slab.c:3424 [inline] + kfree+0xed/0x270 mm/slab.c:3760 + ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876 + rdev_leave_ibss net/wireless/rdev-ops.h:545 [inline] + __cfg80211_leave_ibss+0x19a/0x4c0 net/wireless/ibss.c:212 + __cfg80211_leave+0x327/0x430 net/wireless/core.c:1172 + cfg80211_leave net/wireless/core.c:1221 [inline] + cfg80211_netdev_notifier_call+0x9e8/0x12c0 net/wireless/core.c:1335 + notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 + call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2040 + call_netdevice_notifiers_extack net/core/dev.c:2052 [inline] + call_netdevice_notifiers net/core/dev.c:2066 [inline] + __dev_close_many+0xee/0x2e0 net/core/dev.c:1586 + __dev_close net/core/dev.c:1624 [inline] + __dev_change_flags+0x2cb/0x730 net/core/dev.c:8476 + dev_change_flags+0x8a/0x160 net/core/dev.c:8549 + dev_ifsioc+0x210/0xa70 net/core/dev_ioctl.c:265 + dev_ioctl+0x1b1/0xc40 net/core/dev_ioctl.c:511 + sock_do_ioctl+0x148/0x2d0 net/socket.c:1060 + sock_ioctl+0x477/0x6a0 net/socket.c:1177 + vfs_ioctl fs/ioctl.c:48 [inline] + __do_sys_ioctl fs/ioctl.c:753 [inline] + __se_sys_ioctl fs/ioctl.c:739 [inline] + __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 + do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Reported-by: syzbot+93976391bf299d425f44@syzkaller.appspotmail.com +Signed-off-by: Markus Theil +Link: https://lore.kernel.org/r/20210213133653.367130-1-markus.theil@tu-ilmenau.de +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + net/mac80211/ibss.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -1869,6 +1869,8 @@ int ieee80211_ibss_leave(struct ieee8021 + + /* remove beacon */ + kfree(sdata->u.ibss.ie); ++ sdata->u.ibss.ie = NULL; ++ sdata->u.ibss.ie_len = 0; + + /* on the next join, re-program HT parameters */ + memset(&ifibss->ht_capa, 0, sizeof(ifibss->ht_capa)); diff --git a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch index 31137e1b37..ebf46c6a4c 100644 --- a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1365,6 +1365,7 @@ struct ieee80211_local { +@@ -1366,6 +1366,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ From cda237f66da704b948eab6dbac3b92fbf61f0202 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 9 Apr 2021 15:14:37 +0200 Subject: [PATCH 06/10] kernel: backport fix for flexcan bug This patch fixes a DIV/0 error which was introduced in 4.14.225 This patch was forgotten in upstream <= 4.14 and is now queued for future release. Signed-off-by: Koen Vandeputte --- ...can_chip_freeze-fix-chip-freeze-for-.patch | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 target/linux/generic/pending-4.14/840-can-flexcan-flexcan_chip_freeze-fix-chip-freeze-for-.patch diff --git a/target/linux/generic/pending-4.14/840-can-flexcan-flexcan_chip_freeze-fix-chip-freeze-for-.patch b/target/linux/generic/pending-4.14/840-can-flexcan-flexcan_chip_freeze-fix-chip-freeze-for-.patch new file mode 100644 index 0000000000..20c84617d1 --- /dev/null +++ b/target/linux/generic/pending-4.14/840-can-flexcan-flexcan_chip_freeze-fix-chip-freeze-for-.patch @@ -0,0 +1,50 @@ +From 47c5e474bc1e1061fb037d13b5000b38967eb070 Mon Sep 17 00:00:00 2001 +From: Angelo Dureghello +Date: Tue, 16 Mar 2021 00:15:10 +0100 +Subject: can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate + +From: Angelo Dureghello + +commit 47c5e474bc1e1061fb037d13b5000b38967eb070 upstream. + +For cases when flexcan is built-in, bitrate is still not set at +registering. So flexcan_chip_freeze() generates: + +[ 1.860000] *** ZERO DIVIDE *** FORMAT=4 +[ 1.860000] Current process id is 1 +[ 1.860000] BAD KERNEL TRAP: 00000000 +[ 1.860000] PC: [<402e70c8>] flexcan_chip_freeze+0x1a/0xa8 + +To allow chip freeze, using an hardcoded timeout when bitrate is still +not set. + +Fixes: ec15e27cc890 ("can: flexcan: enable RX FIFO after FRZ/HALT valid") +Link: https://lore.kernel.org/r/20210315231510.650593-1-angelo@kernel-space.org +Signed-off-by: Angelo Dureghello +[mkl: use if instead of ? operator] +Signed-off-by: Marc Kleine-Budde +Cc: Koen Vandeputte +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/can/flexcan.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/net/can/flexcan.c ++++ b/drivers/net/can/flexcan.c +@@ -413,9 +413,15 @@ static int flexcan_chip_disable(struct f + static int flexcan_chip_freeze(struct flexcan_priv *priv) + { + struct flexcan_regs __iomem *regs = priv->regs; +- unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate; ++ unsigned int timeout; ++ u32 bitrate = priv->can.bittiming.bitrate; + u32 reg; + ++ if (bitrate) ++ timeout = 1000 * 1000 * 10 / bitrate; ++ else ++ timeout = FLEXCAN_TIMEOUT_US / 10; ++ + reg = flexcan_read(®s->mcr); + reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT; + flexcan_write(reg, ®s->mcr); From a5b9ff72cff3f25516b9c8142da9c875eb41e044 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Sat, 3 Apr 2021 22:59:15 +0800 Subject: [PATCH 07/10] ramips: mt7530 swconfig: fix race condition in register access The mt7530_{r,w}32 operation over MDIO uses 3 mdiobus operations and does not hold a lock, which causes a race condition when multiple threads try to access a register, they may get unexpected results. To avoid this, handle the MDIO lock manually, and use the unlocked __mdiobus_{read,write} in the critical section. This fixes the "Ghost VLAN" artifact[1] in MT7530/7621 when the VLAN operation and the swconfig LED link status poll race between each other. [1] https://forum.openwrt.org/t/mysterious-vlan-ids-on-mt7621-device/64495 Signed-off-by: DENG Qingfang --- .../drivers/net/ethernet/mediatek/mt7530.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c index 7003f3efe4..959c777d62 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mt7530.c @@ -323,9 +323,11 @@ mt7530_r32(struct mt7530_priv *priv, u32 reg) if (priv->bus) { u16 high, low; - mdiobus_write(priv->bus, 0x1f, 0x1f, (reg >> 6) & 0x3ff); - low = mdiobus_read(priv->bus, 0x1f, (reg >> 2) & 0xf); - high = mdiobus_read(priv->bus, 0x1f, 0x10); + mutex_lock(&priv->bus->mdio_lock); + __mdiobus_write(priv->bus, 0x1f, 0x1f, (reg >> 6) & 0x3ff); + low = __mdiobus_read(priv->bus, 0x1f, (reg >> 2) & 0xf); + high = __mdiobus_read(priv->bus, 0x1f, 0x10); + mutex_unlock(&priv->bus->mdio_lock); return (high << 16) | (low & 0xffff); } @@ -340,9 +342,11 @@ static void mt7530_w32(struct mt7530_priv *priv, u32 reg, u32 val) { if (priv->bus) { - mdiobus_write(priv->bus, 0x1f, 0x1f, (reg >> 6) & 0x3ff); - mdiobus_write(priv->bus, 0x1f, (reg >> 2) & 0xf, val & 0xffff); - mdiobus_write(priv->bus, 0x1f, 0x10, val >> 16); + mutex_lock(&priv->bus->mdio_lock); + __mdiobus_write(priv->bus, 0x1f, 0x1f, (reg >> 6) & 0x3ff); + __mdiobus_write(priv->bus, 0x1f, (reg >> 2) & 0xf, val & 0xffff); + __mdiobus_write(priv->bus, 0x1f, 0x10, val >> 16); + mutex_unlock(&priv->bus->mdio_lock); return; } From 01b72fdea1c48a1b8fb733d83f6018601341d4b4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Apr 2021 20:18:26 -0700 Subject: [PATCH 08/10] libsemanage: fix pkgconfig paths The pkgconfig file currently points to host paths. Signed-off-by: Rosen Penev --- package/libs/libsemanage/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/libs/libsemanage/Makefile b/package/libs/libsemanage/Makefile index ff1519f14e..2fde14c06c 100644 --- a/package/libs/libsemanage/Makefile +++ b/package/libs/libsemanage/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsemanage PKG_VERSION:=3.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 @@ -58,6 +58,8 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsemanage.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsemanage.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsemanage.pc $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ endef From 1687ea5cfcfec88ce2c1a9c93660950ea28acebd Mon Sep 17 00:00:00 2001 From: badgv <45598380+badgv@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:34:43 +0800 Subject: [PATCH 09/10] dnsforwarder: fix dnsmasq configuration modification logic Signed-off-by: Tianling Shen --- .../lean/dnsforwarder/files/etc/init.d/dnsforwarder | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/lean/dnsforwarder/files/etc/init.d/dnsforwarder b/package/lean/dnsforwarder/files/etc/init.d/dnsforwarder index 379c17f091..7ae9612036 100755 --- a/package/lean/dnsforwarder/files/etc/init.d/dnsforwarder +++ b/package/lean/dnsforwarder/files/etc/init.d/dnsforwarder @@ -196,6 +196,12 @@ start() uci commit dhcp /etc/init.d/dnsmasq restart fi + local dnsmasq_server_addr=$(uci get dhcp.@dnsmasq[0].server 2>/dev/null) + if [ -n "${dnsmasq_server_addr}" ]; then + uci set dhcp.@dnsmasq[0].noresolv=1 + uci commit dhcp + /etc/init.d/dnsmasq restart + fi add_cron } @@ -204,8 +210,11 @@ stop() del_cron logger -t stopping dnsforwarder local addr=$(uci get dnsforwarder.@arguments[0].addr 2>/dev/null) + local dnsmasq=$(uci get dnsforwarder.@arguments[0].dnsmasq 2>/dev/null) addr=${addr/:/#} - uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null + if [ "${dnsmasq}" = "1" ]; then + uci del_list dhcp.@dnsmasq[0].server=$addr 2>/dev/null + fi uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.d/resolv.conf.auto 2>/dev/null uci delete dhcp.@dnsmasq[0].noresolv 2>/dev/null uci delete dhcp.@dnsmasq[0].serversfile 2>/dev/null From 9961791b9ec0d245da3f3cdeef55df1fa37442cc Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 17 Apr 2021 00:12:02 +0800 Subject: [PATCH 10/10] scripts/download.pl: remove unavailable mirror Signed-off-by: Tianling Shen --- CONTRIBUTED.md | 1 - scripts/download.pl | 1 - 2 files changed, 2 deletions(-) diff --git a/CONTRIBUTED.md b/CONTRIBUTED.md index c5e0f4bb63..ff2bc3b758 100644 --- a/CONTRIBUTED.md +++ b/CONTRIBUTED.md @@ -66,7 +66,6 @@ luci-theme-infinityfreedom source: [xiaoqingfengATGH/luci-theme-infinityfreedom] luci-proto-minieap source: [ysc3839/luci-proto-minieap](https://github.com/ysc3839/luci-proto-minieap). ## Download Mirrors -[182.140.223.146](http://182.140.223.146/dl) by [hzjnet@163.com](mailto://hzjnet@163.com).
[openwrt.cc](https://openwrt.cc/dl/immortalwrt) by [@SuLingGG](https://github.com/SuLingGG). ## License diff --git a/scripts/download.pl b/scripts/download.pl index 5f5ec266ff..515196f7a1 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -281,7 +281,6 @@ foreach my $mirror (@ARGV) { } unshift @mirrors, "https://mirror01.download.immortalwrt.eu.org/openwrt-18.06"; -unshift @mirrors, "http://182.140.223.146/dl"; push @mirrors, "https://openwrt.cc/dl/immortalwrt/openwrt-18.06"; push @mirrors, 'https://sources.cdn.openwrt.org'; push @mirrors, 'https://sources.openwrt.org';