From 7fc336484b1e4727f419dd930955048f323580be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Bo=C5=99ek?= Date: Tue, 8 Feb 2022 18:02:53 +0100 Subject: [PATCH 1/3] rpcd: backport 802.11ax support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of commit 7a560a1a5769 ("iwinfo: add 802.11ax HE support"). enables 802.11ax capability detection through ubus in OpenWrt 21.02 (e.g. with MT7915E 802.11ax PCI Express Wireless Network Adapter) Signed-off-by: Šimon Bořek [commit message facelift, use openwrt-21.02 branch] Signed-off-by: Petr Štetiar --- package/system/rpcd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index 0896a7dada..7f5f527d3e 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -12,10 +12,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2021-03-11 -PKG_SOURCE_VERSION:=ccb75178cf6a726896729c6904bd623636aa0b29 +PKG_SOURCE_DATE:=2022-02-19 +PKG_SOURCE_VERSION:=8d26a1ba3a175016b342cc5e25d340c08ae20eed PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=87b1839275c209f9767057d6da5272cae973a064767fa28f380a37fb65e2e643 +PKG_MIRROR_HASH:=0a692c87811e38022e7446d37fea75cc823d00534d5b91faefc58eba3b6debb1 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= From 7612ecb201eebd0b273aa9225539fd45d538a1db Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Mon, 21 Feb 2022 03:22:02 +0100 Subject: [PATCH 2/3] ramips: mt7621: do memory detection on KSEG1 It's reported that current memory detection code occasionally detects larger memory under some bootloaders. Current memory detection code tests whether address space wraps around on KSEG0, which is unreliable because it's cached. Rewrite memory size detection to perform the same test on KSEG1 instead. While at it, this patch also does the following two things: 1. use a fixed pattern instead of a random function pointer as the magic value. 2. add an additional memory write and a second comparison as part of the test to prevent possible smaller memory detection result due to leftover values in memory. Fixes: 6d91ddf517 ("ramips: mt7621: add support for memory detection") Reported-by: Rui Salvaterra Tested-by: Rui Salvaterra Signed-off-by: Chuanhong Guo (cherry picked from commit 2f024b79331141e2a62c9bf3601c803b26bde77b) [backport for OpenWrt 21.02 as it was reproducible with Kernel 5.4, see [1]] [1]: https://forum.openwrt.org/t/113081 Tested-by: Dimitri Souza [mt7621/archer-c6-v3] Signed-off-by: Szabolcs Hubai --- .../325-mt7621-fix-memory-detect.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/ramips/patches-5.4/325-mt7621-fix-memory-detect.patch diff --git a/target/linux/ramips/patches-5.4/325-mt7621-fix-memory-detect.patch b/target/linux/ramips/patches-5.4/325-mt7621-fix-memory-detect.patch new file mode 100644 index 0000000000..f8616c31fc --- /dev/null +++ b/target/linux/ramips/patches-5.4/325-mt7621-fix-memory-detect.patch @@ -0,0 +1,62 @@ +--- a/arch/mips/ralink/mt7621.c ++++ b/arch/mips/ralink/mt7621.c +@@ -58,7 +58,9 @@ + #define MT7621_GPIO_MODE_SDHCI_SHIFT 18 + #define MT7621_GPIO_MODE_SDHCI_GPIO 1 + +-static void *detect_magic __initdata = detect_memory_region; ++#define MT7621_MEM_TEST_PATTERN 0xaa5555aa ++ ++static u32 detect_magic __initdata; + + static struct rt2880_pmx_func uart1_grp[] = { FUNC("uart1", 0, 1, 2) }; + static struct rt2880_pmx_func i2c_grp[] = { FUNC("i2c", 0, 3, 2) }; +@@ -144,26 +146,34 @@ static struct clk *__init mt7621_add_sys + return clk; + } + ++static bool __init mt7621_addr_wraparound_test(phys_addr_t size) ++{ ++ void *dm = (void *)KSEG1ADDR(&detect_magic); ++ if (CPHYSADDR(dm + size) >= MT7621_LOWMEM_MAX_SIZE) ++ return true; ++ __raw_writel(MT7621_MEM_TEST_PATTERN, dm); ++ if (__raw_readl(dm) != __raw_readl(dm + size)) ++ return false; ++ __raw_writel(!MT7621_MEM_TEST_PATTERN, dm); ++ return __raw_readl(dm) == __raw_readl(dm + size); ++} ++ + void __init mt7621_memory_detect(void) + { +- void *dm = &detect_magic; + phys_addr_t size; + +- for (size = 32 * SZ_1M; size < 256 * SZ_1M; size <<= 1) { +- if (!__builtin_memcmp(dm, dm + size, sizeof(detect_magic))) +- break; ++ for (size = 32 * SZ_1M; size <= 256 * SZ_1M; size <<= 1) { ++ if (mt7621_addr_wraparound_test(size)) { ++ add_memory_region(MT7621_LOWMEM_BASE, size, BOOT_MEM_RAM); ++ return; ++ } + } + +- if ((size == 256 * SZ_1M) && +- (CPHYSADDR(dm + size) < MT7621_LOWMEM_MAX_SIZE) && +- __builtin_memcmp(dm, dm + size, sizeof(detect_magic))) { +- add_memory_region(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE, +- BOOT_MEM_RAM); +- add_memory_region(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE, +- BOOT_MEM_RAM); +- } else { +- add_memory_region(MT7621_LOWMEM_BASE, size, BOOT_MEM_RAM); +- } ++ /* addr doesn't wrap around at dm + 256M, assume 512M memory. */ ++ add_memory_region(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE, ++ BOOT_MEM_RAM); ++ add_memory_region(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE, ++ BOOT_MEM_RAM); + } + + void __init ralink_clk_init(void) From b99d7aecc83fd180f7a3c3efaae00845e7a73129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 22 Feb 2022 20:00:28 +0100 Subject: [PATCH 3/3] wolfssl: fix API breakage of SSL_get_verify_result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport fix for API breakage of SSL_get_verify_result() introduced in v5.1.1-stable. In v4.8.1-stable SSL_get_verify_result() used to return X509_V_OK when used on LE powered sites or other sites utilizing relaxed/alternative cert chain validation feature. After an update to v5.1.1-stable that API calls started returning X509_V_ERR_INVALID_CA error and thus rendered all such connection attempts imposible: $ docker run -it openwrt/rootfs:x86_64-21.02.2 sh -c "wget https://letsencrypt.org" Downloading 'https://letsencrypt.org' Connecting to 18.159.128.50:443 Connection error: Invalid SSL certificate Fixes: #9283 References: https://github.com/wolfSSL/wolfssl/issues/4879 Signed-off-by: Petr Štetiar (cherry picked from commit b9251e3b407592f3114e739231088c3d27663c4c) --- ...fix-SSL_get_verify_result-regression.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch diff --git a/package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch b/package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch new file mode 100644 index 0000000000..9651c03af6 --- /dev/null +++ b/package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Juliusz Sosinowicz +Date: Sat, 12 Feb 2022 00:34:24 +0100 +Subject: [PATCH] Reported in ZD13631 + +`ssl->peerVerifyRet` wasn't being cleared when retrying with an alternative cert chain + +References: https://github.com/wolfSSL/wolfssl/issues/4879 +--- + src/internal.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/internal.c b/src/internal.c +index 0dded42a76c4..f5814d30607c 100644 +--- a/src/internal.c ++++ b/src/internal.c +@@ -12372,6 +12372,9 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx, + } + + ret = 0; /* clear errors and continue */ ++ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) ++ ssl->peerVerifyRet = 0; ++ #endif + args->verifyErr = 0; + } +