From af88bdb1700cae8a789f8a3ea52499f35c29af6f Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 11 Sep 2022 08:15:52 +0200 Subject: [PATCH 01/11] Makefile: fix stray \ warnings with grep-3.8 We simply grep for "/usr". So no need for "-E" or "\/". Furthermore, in the new grep versions this creates warnings. As written in the grep-3.8 announcement: Regular expressions with stray backslashes now cause warnings, as their unspecified behavior can lead to unexpected results. For example, '\a' and 'a' are not always equivalent . Fixes warnings in the form of: grep: warning: stray \ before / Signed-off-by: Nick Hainke (cherry picked from commit a29d3bc48c40c6a2a93ae1806bea2ac26455cdbb) [ fix conflict error ] Signed-off-by: Christian Marangi --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e18bc18608..11531d4760 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir world: -DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1) +DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep '/usr' | head -n 1) export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH) ifneq ($(OPENWRT_BUILD),1) From fc86176363149493810dc0b424583dd120e7f4c7 Mon Sep 17 00:00:00 2001 From: Chris Osgood Date: Thu, 15 Sep 2022 08:09:38 -0400 Subject: [PATCH 02/11] build: fix warnings from grep Fixes build warnings when using newer versions of grep. Signed-off-by: Chris Osgood Tested-by: Georgi Valkov (cherry picked from commit c5e167e0d6075c46ca92c30b425c4dcb05fec5ed) [ fix conflict error ] Signed-off-by: Christian Marangi --- target/sdk/files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sdk/files/Makefile b/target/sdk/files/Makefile index 2f89ce0cf8..3d5d06a727 100644 --- a/target/sdk/files/Makefile +++ b/target/sdk/files/Makefile @@ -14,7 +14,7 @@ export TOPDIR LC_ALL LANG SDK world: -DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1) +DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep '/usr' | head -n 1) export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH) ifneq ($(OPENWRT_BUILD),1) From abf2c60e715bbaf0e1e7a229d82d8a615840806e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 29 Sep 2022 05:51:25 +0200 Subject: [PATCH 03/11] bcm53xx: backport clk driver fix for DT nodes names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 77d9cce604d32005ddb90e91c6cc9b9cf35068d7) --- ...-rely-on-node-name-for-correct-PLL-s.patch | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 target/linux/bcm53xx/patches-5.4/083-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch diff --git a/target/linux/bcm53xx/patches-5.4/083-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch b/target/linux/bcm53xx/patches-5.4/083-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch new file mode 100644 index 0000000000..12c60ce297 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.4/083-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch @@ -0,0 +1,72 @@ +From 1b24a132eba7a1c19475ba2510ec1c00af3ff914 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Mon, 5 Sep 2022 09:15:03 -0700 +Subject: [PATCH] clk: iproc: Do not rely on node name for correct PLL setup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +After commit 31fd9b79dc58 ("ARM: dts: BCM5301X: update CRU block +description") a warning from clk-iproc-pll.c was generated due to a +duplicate PLL name as well as the console stopped working. Upon closer +inspection it became clear that iproc_pll_clk_setup() used the Device +Tree node unit name as an unique identifier as well as a parent name to +parent all clocks under the PLL. + +BCM5301X was the first platform on which that got noticed because of the +DT node unit name renaming but the same assumptions hold true for any +user of the iproc_pll_clk_setup() function. + +The first 'clock-output-names' property is always guaranteed to be +unique as well as providing the actual desired PLL clock name, so we +utilize that to register the PLL and as a parent name of all children +clock. + +Fixes: 5fe225c105fd ("clk: iproc: add initial common clock support") +Signed-off-by: Florian Fainelli +Acked-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220905161504.1526-1-f.fainelli@gmail.com +Signed-off-by: Stephen Boyd +--- + drivers/clk/bcm/clk-iproc-pll.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/clk/bcm/clk-iproc-pll.c ++++ b/drivers/clk/bcm/clk-iproc-pll.c +@@ -736,6 +736,7 @@ void iproc_pll_clk_setup(struct device_n + const char *parent_name; + struct iproc_clk *iclk_array; + struct clk_hw_onecell_data *clk_data; ++ const char *clk_name; + + if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl)) + return; +@@ -783,7 +784,12 @@ void iproc_pll_clk_setup(struct device_n + iclk = &iclk_array[0]; + iclk->pll = pll; + +- init.name = node->name; ++ ret = of_property_read_string_index(node, "clock-output-names", ++ 0, &clk_name); ++ if (WARN_ON(ret)) ++ goto err_pll_register; ++ ++ init.name = clk_name; + init.ops = &iproc_pll_ops; + init.flags = 0; + parent_name = of_clk_get_parent_name(node, 0); +@@ -803,13 +809,11 @@ void iproc_pll_clk_setup(struct device_n + goto err_pll_register; + + clk_data->hws[0] = &iclk->hw; ++ parent_name = clk_name; + + /* now initialize and register all leaf clocks */ + for (i = 1; i < num_clks; i++) { +- const char *clk_name; +- + memset(&init, 0, sizeof(init)); +- parent_name = node->name; + + ret = of_property_read_string_index(node, "clock-output-names", + i, &clk_name); From 221c6242deceb49b04da9886761d28c18202609a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 4 Oct 2022 12:04:37 +0200 Subject: [PATCH 04/11] kernel: fix possible mtd NULL pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: edf3363959d3c ("kernel: backport mtd dynamic partition patch") Signed-off-by: Rafał Miłecki (cherry picked from commit a5265497a4f6da158e95d6a450cb2cb6dc085cab) --- ...e-check-partition-before-dereference.patch | 30 +++++++++++++++++++ .../480-mtd-set-rootfs-to-be-root-dev.patch | 2 +- ...-mtd-core-add-get_mtd_device_by_node.patch | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 target/linux/generic/backport-5.4/415-v6.0-mtd-core-check-partition-before-dereference.patch diff --git a/target/linux/generic/backport-5.4/415-v6.0-mtd-core-check-partition-before-dereference.patch b/target/linux/generic/backport-5.4/415-v6.0-mtd-core-check-partition-before-dereference.patch new file mode 100644 index 0000000000..028f5baaaa --- /dev/null +++ b/target/linux/generic/backport-5.4/415-v6.0-mtd-core-check-partition-before-dereference.patch @@ -0,0 +1,30 @@ +From 7ec4cdb321738d44ae5d405e7b6ac73dfbf99caa Mon Sep 17 00:00:00 2001 +From: Tetsuo Handa +Date: Mon, 25 Jul 2022 22:49:25 +0900 +Subject: [PATCH] mtd: core: check partition before dereference + +syzbot is reporting NULL pointer dereference at mtd_check_of_node() [1], +for mtdram test device (CONFIG_MTD_MTDRAM) is not partition. + +Link: https://syzkaller.appspot.com/bug?extid=fe013f55a2814a9e8cfd [1] +Reported-by: syzbot +Reported-by: kernel test robot +Fixes: ad9b10d1eaada169 ("mtd: core: introduce of support for dynamic partitions") +Signed-off-by: Tetsuo Handa +CC: stable@vger.kernel.org +Signed-off-by: Richard Weinberger +--- + drivers/mtd/mtdcore.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -602,6 +602,8 @@ static void mtd_check_of_node(struct mtd + return; + + /* Check if a partitions node exist */ ++ if (!mtd_is_partition(mtd)) ++ return; + parent = mtd_get_master(mtd); + parent_dn = dev_of_node(&parent->dev); + if (!parent_dn) diff --git a/target/linux/generic/pending-5.4/480-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/pending-5.4/480-mtd-set-rootfs-to-be-root-dev.patch index 1189ce0f89..2544fa4b69 100644 --- a/target/linux/generic/pending-5.4/480-mtd-set-rootfs-to-be-root-dev.patch +++ b/target/linux/generic/pending-5.4/480-mtd-set-rootfs-to-be-root-dev.patch @@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos #include #include -@@ -760,6 +761,15 @@ int add_mtd_device(struct mtd_info *mtd) +@@ -762,6 +763,15 @@ int add_mtd_device(struct mtd_info *mtd) of this try_ nonsense, and no bitching about it either. :) */ __module_get(THIS_MODULE); diff --git a/target/linux/generic/pending-5.4/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-5.4/495-mtd-core-add-get_mtd_device_by_node.patch index a73775783e..ada1415853 100644 --- a/target/linux/generic/pending-5.4/495-mtd-core-add-get_mtd_device_by_node.patch +++ b/target/linux/generic/pending-5.4/495-mtd-core-add-get_mtd_device_by_node.patch @@ -17,7 +17,7 @@ Reviewed-by: Miquel Raynal --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -1142,6 +1142,44 @@ out_unlock: +@@ -1144,6 +1144,44 @@ out_unlock: } EXPORT_SYMBOL_GPL(get_mtd_device_nm); From 049e8f6c1313707d8a029cf75ae097e179799748 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 10 May 2022 16:39:11 -0300 Subject: [PATCH 05/11] wolfssl: bump to v5.3.0-stable This is mostly a bug fix release, including two that were already patched here: - 300-fix-SSL_get_verify_result-regression.patch - 400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch Signed-off-by: Eneas U de Queiroz (cherry picked from commit 73c1fe2890baa5c0bfa46f53c5387f5e47de1acb) (cherry picked from commit 6f8db8fee3b7bd5cb8b1b2be59ee710a8f96860b) --- package/libs/wolfssl/Makefile | 4 ++-- ...fix-SSL_get_verify_result-regression.patch | 24 ------------------- ...rt-devcrypto-devcrypto_aes.c-remove-.patch | 19 --------------- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch delete mode 100644 package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index e8bf252de6..1324a43929 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.2.0-stable +PKG_VERSION:=5.3.0-stable PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=409b4646c5f54f642de0e9f3544c3b83de7238134f5b1ff93fb44527bf119d05 +PKG_HASH:=1a3bb310dc01d3e73d9ad91b6ea8249d081016f8eef4ae8f21d3421f91ef1de9 PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 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 deleted file mode 100644 index d6e7998744..0000000000 --- a/package/libs/wolfssl/patches/300-fix-SSL_get_verify_result-regression.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 87e43dd63ba429297e439f2dfd1ee8b45981e18b 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(+) - ---- a/src/internal.c -+++ b/src/internal.c -@@ -12342,6 +12342,9 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* - } - - ret = 0; /* clear errors and continue */ -+ #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) -+ ssl->peerVerifyRet = 0; -+ #endif - args->verifyErr = 0; - } - diff --git a/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch b/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch deleted file mode 100644 index 3c0c0a07af..0000000000 --- a/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 096889927d9528d4fbeb3aab56d1fe8225d2e7ec Mon Sep 17 00:00:00 2001 -From: Daniel Pouzzner -Date: Thu, 14 Apr 2022 20:23:31 -0500 -Subject: [PATCH] wolfcrypt/src/port/devcrypto/devcrypto_aes.c: remove - redundant "int ret" in wc_AesCtrEncrypt() (supersedes #5052). - - -diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c -index 3bc1d5bb1..28e145e27 100644 ---- a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c -+++ b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c -@@ -208,7 +208,6 @@ int wc_AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) - int ret; - struct crypt_op crt; - byte* tmp; -- int ret; - - if (aes == NULL || out == NULL || in == NULL) { - return BAD_FUNC_ARG; From a13dacbfe016b5d047c0496e2ebcf3839a5a5560 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 15 Jul 2022 16:09:58 -0300 Subject: [PATCH 06/11] wolfssl: bump to 5.4.0 This version fixes two vulnerabilities: -CVE-2022-34293[high]: Potential for DTLS DoS attack -[medium]: Ciphertext side channel attack on ECC and DH operations. The patch fixing x86 aesni build has been merged upstream. Signed-off-by: Eneas U de Queiroz (cherry picked from commit 9710fe70a68e0a004b1906db192d7a6c8f810ac5) Signed-off-by: Christian Marangi (cherry picked from commit ade7c6db1e6c2c0c8d2338948c37cfa7429ebccc) --- package/libs/wolfssl/Makefile | 4 ++-- .../libs/wolfssl/patches/100-disable-hardening-check.patch | 2 +- package/libs/wolfssl/patches/200-ecc-rng.patch | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 1324a43929..d0a67e118b 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.3.0-stable +PKG_VERSION:=5.4.0-stable PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=1a3bb310dc01d3e73d9ad91b6ea8249d081016f8eef4ae8f21d3421f91ef1de9 +PKG_HASH:=dc36cc19dad197253e5c2ecaa490c7eef579ad448706e55d73d79396e814098b PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index 7e473b390b..d3ad2e27bc 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -2338,7 +2338,7 @@ extern void uITRON4_free(void *p) ; +@@ -2442,7 +2442,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch index f1f156a8ae..2e09e6d273 100644 --- a/package/libs/wolfssl/patches/200-ecc-rng.patch +++ b/package/libs/wolfssl/patches/200-ecc-rng.patch @@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl. --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c -@@ -11655,21 +11655,21 @@ void wc_ecc_fp_free(void) +@@ -12288,21 +12288,21 @@ void wc_ecc_fp_free(void) #endif /* FP_ECC */ From 4be7eb7735453a6b1f578942afccc5f742c9d8d8 Mon Sep 17 00:00:00 2001 From: Ivan Pavlov Date: Wed, 31 Aug 2022 08:04:42 +0300 Subject: [PATCH 07/11] wolfssl: bump to 5.5.0 Remove upstreamed: 101-update-sp_rand_prime-s-preprocessor-gating-to-match.patch Some low severity vulnerabilities fixed OpenVPN compatibility fixed (broken in 5.4.0) Other fixes && improvements Signed-off-by: Ivan Pavlov (cherry picked from commit 3d88f26d74f7771b808082cef541ed8286c40491) (cherry picked from commit 0c8425bf11590afb0c6f1545b328ecb6ed4aee87) --- package/libs/wolfssl/Makefile | 4 ++-- .../libs/wolfssl/patches/100-disable-hardening-check.patch | 2 +- package/libs/wolfssl/patches/200-ecc-rng.patch | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index d0a67e118b..ce66ec81ea 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.4.0-stable +PKG_VERSION:=5.5.0-stable PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=dc36cc19dad197253e5c2ecaa490c7eef579ad448706e55d73d79396e814098b +PKG_HASH:=c34b74b5f689fac7becb05583b044e84d3b10d39f38709f0095dd5d423ded67f PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index d3ad2e27bc..01bb5974ba 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -2442,7 +2442,7 @@ extern void uITRON4_free(void *p) ; +@@ -2445,7 +2445,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch index 2e09e6d273..d68ef7f385 100644 --- a/package/libs/wolfssl/patches/200-ecc-rng.patch +++ b/package/libs/wolfssl/patches/200-ecc-rng.patch @@ -11,7 +11,7 @@ RNG regardless of the built settings for wolfssl. --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c -@@ -12288,21 +12288,21 @@ void wc_ecc_fp_free(void) +@@ -12348,21 +12348,21 @@ void wc_ecc_fp_free(void) #endif /* FP_ECC */ @@ -37,7 +37,7 @@ RNG regardless of the built settings for wolfssl. --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h -@@ -650,10 +650,8 @@ WOLFSSL_API +@@ -650,10 +650,8 @@ WOLFSSL_ABI WOLFSSL_API void wc_ecc_fp_free(void); WOLFSSL_LOCAL void wc_ecc_fp_init(void); From 914d91274162ba7e125fcfc781b1128b7c42a856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 28 Sep 2022 11:28:06 +0200 Subject: [PATCH 08/11] wolfssl: fix TLSv1.3 RCE in uhttpd by using 5.5.1-stable (CVE-2022-39173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes denial of service attack and buffer overflow against TLS 1.3 servers using session ticket resumption. When built with --enable-session-ticket and making use of TLS 1.3 server code in wolfSSL, there is the possibility of a malicious client to craft a malformed second ClientHello packet that causes the server to crash. This issue is limited to when using both --enable-session-ticket and TLS 1.3 on the server side. Users with TLS 1.3 servers, and having --enable-session-ticket, should update to the latest version of wolfSSL. Thanks to Max at Trail of Bits for the report and "LORIA, INRIA, France" for research on tlspuffin. Complete release notes https://github.com/wolfSSL/wolfssl/releases/tag/v5.5.1-stable Fixes: CVE-2022-39173 Fixes: https://github.com/openwrt/luci/issues/5962 References: https://github.com/wolfSSL/wolfssl/issues/5629 Tested-by: Kien Truong Reported-by: Kien Truong Signed-off-by: Petr Štetiar (cherry picked from commit ec8fb542ec3e4f584444a97de5ac05dbc2a9cde5) (cherry picked from commit ce59843662961049a28033077587cabdc5243b15) --- package/libs/wolfssl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index ce66ec81ea..a1c968b81f 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.5.0-stable +PKG_VERSION:=5.5.1-stable PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=c34b74b5f689fac7becb05583b044e84d3b10d39f38709f0095dd5d423ded67f +PKG_HASH:=97339e6956c90e7c881ba5c748dd04f7c30e5dbe0c06da765418c51375a6dee3 PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 From 8444302a92e601a1e05cb8468aaffa140d5a5b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 29 Sep 2022 18:45:40 +0200 Subject: [PATCH 09/11] treewide: fix security issues by bumping all packages using libwolfssl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As wolfSSL is having hard time maintaining ABI compatibility between releases, we need to manually force rebuild of packages depending on libwolfssl and thus force their upgrade. Otherwise due to the ABI handling we would endup with possibly two libwolfssl libraries in the system, including the patched libwolfssl-5.5.1, but still have vulnerable services running using the vulnerable libwolfssl-5.4.0. So in order to propagate update of libwolfssl to latest stable release done in commit ec8fb542ec3e4 ("wolfssl: fix TLSv1.3 RCE in uhttpd by using 5.5.1-stable (CVE-2022-39173)") which fixes several remotely exploitable vulnerabilities, we need to bump PKG_RELEASE of all packages using wolfSSL library. Signed-off-by: Petr Štetiar (cherry picked from commit f1b7e1434f66a3cb09cb9e70b40add354a22e458) (cherry picked from commit 562894b39da381264a34ce31e9334c8a036fa139) --- package/libs/ustream-ssl/Makefile | 2 +- package/network/services/hostapd/Makefile | 2 +- package/utils/px5g-wolfssl/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index 7d9e830381..4f474978db 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ustream-ssl -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index e529a2efd3..001bdb439e 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=40 +PKG_RELEASE:=41 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/utils/px5g-wolfssl/Makefile b/package/utils/px5g-wolfssl/Makefile index 90296008d6..264a12aa4d 100644 --- a/package/utils/px5g-wolfssl/Makefile +++ b/package/utils/px5g-wolfssl/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=px5g-wolfssl -PKG_RELEASE:=$(COMMITCOUNT) +PKG_RELEASE:=$(COMMITCOUNT).1 PKG_LICENSE:=GPL-2.0-or-later PKG_USE_MIPS16:=0 From 084a8a2fafbaecb821cfa71f0e1c9b8464f23a80 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 3 Oct 2022 20:40:59 +0200 Subject: [PATCH 10/11] kernel: bump 5.4 to 5.4.215 Compile-tested: x86/64 Run-tested: x86/64 Signed-off-by: Hauke Mehrtens --- include/kernel-version.mk | 4 +- ...011-drivers-soc-fsl-add-qixis-driver.patch | 2 +- ...fsl-select-MFD_CORE-for-qixis-driver.patch | 2 +- ...pare-common-code-for-cdns-and-rk-dpi.patch | 74 +++++++++---------- ...-bridge-add-Cadence-MHDP-HDMI-DP-API.patch | 30 ++++---- ...-drm-rockchip-Fix-build-failed-issue.patch | 2 +- ...nge-base-address-name-from-regs-to-r.patch | 2 +- ...dp-Remove-link-rate-lanes-set-by-dev.patch | 8 +- ...nge-irq-handler-from-chained-to-norm.patch | 2 +- ...088a-ls1028a-edge-detection-mode-bug.patch | 2 +- .../813-pm-0001-soc-fsl-add-RCPM-driver.patch | 2 +- ...add-EPU-FSM-configuration-for-deep-s.patch | 2 +- ...5-usb-dwc3-add-otg-properties-update.patch | 4 +- ...-usb-role-switch-class-support-for-d.patch | 2 +- ...karound-for-host-mode-VBUS-glitch-wh.patch | 4 +- 15 files changed, 71 insertions(+), 71 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 6d9eba5ee3..07e64d4edd 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .213 +LINUX_VERSION-5.4 = .215 -LINUX_KERNEL_HASH-5.4.213 = e67ce168477e580375a80f3caef16819a85b15faa2d382adc6df18a62ad6baf1 +LINUX_KERNEL_HASH-5.4.215 = 2d2bf7c3a25297f2b4686aa50a7cdaac68b52fc4c81b2cd3dddfe9f592b34ebd remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/layerscape/patches-5.4/301-arch-0011-drivers-soc-fsl-add-qixis-driver.patch b/target/linux/layerscape/patches-5.4/301-arch-0011-drivers-soc-fsl-add-qixis-driver.patch index bd82274be2..f1913c0af5 100644 --- a/target/linux/layerscape/patches-5.4/301-arch-0011-drivers-soc-fsl-add-qixis-driver.patch +++ b/target/linux/layerscape/patches-5.4/301-arch-0011-drivers-soc-fsl-add-qixis-driver.patch @@ -16,7 +16,7 @@ Signed-off-by: Pankaj Bansal --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig -@@ -40,4 +40,15 @@ config DPAA2_CONSOLE +@@ -41,4 +41,15 @@ config DPAA2_CONSOLE /dev/dpaa2_mc_console and /dev/dpaa2_aiop_console, which can be used to dump the Management Complex and AIOP firmware logs. diff --git a/target/linux/layerscape/patches-5.4/301-arch-0012-soc-fsl-select-MFD_CORE-for-qixis-driver.patch b/target/linux/layerscape/patches-5.4/301-arch-0012-soc-fsl-select-MFD_CORE-for-qixis-driver.patch index aefae7c6c2..f754b4873c 100644 --- a/target/linux/layerscape/patches-5.4/301-arch-0012-soc-fsl-select-MFD_CORE-for-qixis-driver.patch +++ b/target/linux/layerscape/patches-5.4/301-arch-0012-soc-fsl-select-MFD_CORE-for-qixis-driver.patch @@ -12,7 +12,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig -@@ -46,6 +46,7 @@ config FSL_QIXIS +@@ -47,6 +47,7 @@ config FSL_QIXIS depends on OF select REGMAP_I2C select REGMAP_MMIO diff --git a/target/linux/layerscape/patches-5.4/805-display-0002-drm-rockchip-prepare-common-code-for-cdns-and-rk-dpi.patch b/target/linux/layerscape/patches-5.4/805-display-0002-drm-rockchip-prepare-common-code-for-cdns-and-rk-dpi.patch index 8ce4380664..91b2dba7d8 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0002-drm-rockchip-prepare-common-code-for-cdns-and-rk-dpi.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0002-drm-rockchip-prepare-common-code-for-cdns-and-rk-dpi.patch @@ -164,8 +164,8 @@ Signed-off-by: Sandor Yu edid->width_cm, edid->height_cm); dp->sink_has_audio = drm_detect_monitor_audio(edid); -@@ -279,7 +282,8 @@ static int cdn_dp_connector_mode_valid(s - struct drm_display_mode *mode) +@@ -280,7 +283,8 @@ cdn_dp_connector_mode_valid(struct drm_c + struct drm_display_mode *mode) { struct cdn_dp_device *dp = connector_to_dp(connector); - struct drm_display_info *display_info = &dp->connector.display_info; @@ -174,7 +174,7 @@ Signed-off-by: Sandor Yu u32 requested, actual, rate, sink_max, source_max = 0; u8 lanes, bpc; -@@ -305,7 +309,7 @@ static int cdn_dp_connector_mode_valid(s +@@ -306,7 +310,7 @@ cdn_dp_connector_mode_valid(struct drm_c sink_max = drm_dp_max_lane_count(dp->dpcd); lanes = min(source_max, sink_max); @@ -183,7 +183,7 @@ Signed-off-by: Sandor Yu sink_max = drm_dp_max_link_rate(dp->dpcd); rate = min(source_max, sink_max); -@@ -315,7 +319,7 @@ static int cdn_dp_connector_mode_valid(s +@@ -316,7 +320,7 @@ cdn_dp_connector_mode_valid(struct drm_c actual = actual * 8 / 10; if (requested > actual) { @@ -192,7 +192,7 @@ Signed-off-by: Sandor Yu "requested=%d, actual=%d, clock=%d\n", requested, actual, mode->clock); return MODE_CLOCK_HIGH; -@@ -335,28 +339,29 @@ static int cdn_dp_firmware_init(struct c +@@ -336,28 +340,29 @@ static int cdn_dp_firmware_init(struct c const u32 *iram_data, *dram_data; const struct firmware *fw = dp->fw; const struct cdn_firmware_header *hdr; @@ -228,7 +228,7 @@ Signed-off-by: Sandor Yu } static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) -@@ -366,28 +371,29 @@ static int cdn_dp_get_sink_capability(st +@@ -367,28 +372,29 @@ static int cdn_dp_get_sink_capability(st if (!cdn_dp_check_sink_connection(dp)) return -ENODEV; @@ -264,7 +264,7 @@ Signed-off-by: Sandor Yu ret); goto err_phy; } -@@ -397,28 +403,28 @@ static int cdn_dp_enable_phy(struct cdn_ +@@ -398,28 +404,28 @@ static int cdn_dp_enable_phy(struct cdn_ ret = cdn_dp_grf_write(dp, GRF_SOC_CON26, DPTX_HPD_SEL_MASK | DPTX_HPD_SEL); if (ret) { @@ -299,7 +299,7 @@ Signed-off-by: Sandor Yu ret); goto err_power_on; } -@@ -428,7 +434,7 @@ static int cdn_dp_enable_phy(struct cdn_ +@@ -429,7 +435,7 @@ static int cdn_dp_enable_phy(struct cdn_ err_power_on: if (phy_power_off(port->phy)) @@ -308,7 +308,7 @@ Signed-off-by: Sandor Yu else port->phy_enabled = false; -@@ -446,7 +452,8 @@ static int cdn_dp_disable_phy(struct cdn +@@ -447,7 +453,8 @@ static int cdn_dp_disable_phy(struct cdn if (port->phy_enabled) { ret = phy_power_off(port->phy); if (ret) { @@ -318,7 +318,7 @@ Signed-off-by: Sandor Yu return ret; } } -@@ -470,16 +477,16 @@ static int cdn_dp_disable(struct cdn_dp_ +@@ -471,16 +478,16 @@ static int cdn_dp_disable(struct cdn_dp_ ret = cdn_dp_grf_write(dp, GRF_SOC_CON26, DPTX_HPD_SEL_MASK | DPTX_HPD_DEL); if (ret) { @@ -339,7 +339,7 @@ Signed-off-by: Sandor Yu if (!dp->connected) { kfree(dp->edid); dp->edid = NULL; -@@ -492,11 +499,11 @@ static int cdn_dp_enable(struct cdn_dp_d +@@ -493,11 +500,11 @@ static int cdn_dp_enable(struct cdn_dp_d { int ret, i, lanes; struct cdn_dp_port *port; @@ -353,7 +353,7 @@ Signed-off-by: Sandor Yu return -ENODEV; } -@@ -509,7 +516,7 @@ static int cdn_dp_enable(struct cdn_dp_d +@@ -510,7 +517,7 @@ static int cdn_dp_enable(struct cdn_dp_d ret = cdn_dp_firmware_init(dp); if (ret) { @@ -362,7 +362,7 @@ Signed-off-by: Sandor Yu goto err_clk_disable; } -@@ -543,8 +550,9 @@ static void cdn_dp_encoder_mode_set(stru +@@ -544,8 +551,9 @@ static void cdn_dp_encoder_mode_set(stru struct drm_display_mode *adjusted) { struct cdn_dp_device *dp = encoder_to_dp(encoder); @@ -374,7 +374,7 @@ Signed-off-by: Sandor Yu switch (display_info->bpc) { case 10: -@@ -562,7 +570,7 @@ static void cdn_dp_encoder_mode_set(stru +@@ -563,7 +571,7 @@ static void cdn_dp_encoder_mode_set(stru video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC); @@ -383,7 +383,7 @@ Signed-off-by: Sandor Yu } static bool cdn_dp_check_link_status(struct cdn_dp_device *dp) -@@ -571,11 +579,11 @@ static bool cdn_dp_check_link_status(str +@@ -572,11 +580,11 @@ static bool cdn_dp_check_link_status(str struct cdn_dp_port *port = cdn_dp_connected_port(dp); u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd); @@ -398,7 +398,7 @@ Signed-off-by: Sandor Yu DRM_ERROR("Failed to get link status\n"); return false; } -@@ -587,15 +595,16 @@ static bool cdn_dp_check_link_status(str +@@ -588,15 +596,16 @@ static bool cdn_dp_check_link_status(str static void cdn_dp_encoder_enable(struct drm_encoder *encoder) { struct cdn_dp_device *dp = encoder_to_dp(encoder); @@ -418,7 +418,7 @@ Signed-off-by: Sandor Yu (ret) ? "LIT" : "BIG"); if (ret) val = DP_SEL_VOP_LIT | (DP_SEL_VOP_LIT << 16); -@@ -610,33 +619,33 @@ static void cdn_dp_encoder_enable(struct +@@ -611,33 +620,33 @@ static void cdn_dp_encoder_enable(struct ret = cdn_dp_enable(dp); if (ret) { @@ -461,7 +461,7 @@ Signed-off-by: Sandor Yu goto out; } out: -@@ -652,7 +661,8 @@ static void cdn_dp_encoder_disable(struc +@@ -653,7 +662,8 @@ static void cdn_dp_encoder_disable(struc if (dp->active) { ret = cdn_dp_disable(dp); if (ret) { @@ -471,7 +471,7 @@ Signed-off-by: Sandor Yu ret); } } -@@ -696,7 +706,7 @@ static const struct drm_encoder_funcs cd +@@ -697,7 +707,7 @@ static const struct drm_encoder_funcs cd static int cdn_dp_parse_dt(struct cdn_dp_device *dp) { @@ -480,7 +480,7 @@ Signed-off-by: Sandor Yu struct device_node *np = dev->of_node; struct platform_device *pdev = to_platform_device(dev); struct resource *res; -@@ -708,10 +718,10 @@ static int cdn_dp_parse_dt(struct cdn_dp +@@ -709,10 +719,10 @@ static int cdn_dp_parse_dt(struct cdn_dp } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -494,7 +494,7 @@ Signed-off-by: Sandor Yu } dp->core_clk = devm_clk_get(dev, "core-clk"); -@@ -726,10 +736,10 @@ static int cdn_dp_parse_dt(struct cdn_dp +@@ -727,10 +737,10 @@ static int cdn_dp_parse_dt(struct cdn_dp return PTR_ERR(dp->pclk); } @@ -508,7 +508,7 @@ Signed-off-by: Sandor Yu } dp->grf_clk = devm_clk_get(dev, "grf"); -@@ -738,10 +748,10 @@ static int cdn_dp_parse_dt(struct cdn_dp +@@ -739,10 +749,10 @@ static int cdn_dp_parse_dt(struct cdn_dp return PTR_ERR(dp->grf_clk); } @@ -522,7 +522,7 @@ Signed-off-by: Sandor Yu } dp->dptx_rst = devm_reset_control_get(dev, "dptx"); -@@ -796,7 +806,7 @@ static int cdn_dp_audio_hw_params(struct +@@ -797,7 +807,7 @@ static int cdn_dp_audio_hw_params(struct goto out; } @@ -531,7 +531,7 @@ Signed-off-by: Sandor Yu if (!ret) dp->audio_info = audio; -@@ -814,7 +824,7 @@ static void cdn_dp_audio_shutdown(struct +@@ -815,7 +825,7 @@ static void cdn_dp_audio_shutdown(struct if (!dp->active) goto out; @@ -540,7 +540,7 @@ Signed-off-by: Sandor Yu if (!ret) dp->audio_info.format = AFMT_UNUSED; out: -@@ -833,7 +843,7 @@ static int cdn_dp_audio_digital_mute(str +@@ -834,7 +844,7 @@ static int cdn_dp_audio_digital_mute(str goto out; } @@ -549,7 +549,7 @@ Signed-off-by: Sandor Yu out: mutex_unlock(&dp->lock); -@@ -845,7 +855,8 @@ static int cdn_dp_audio_get_eld(struct d +@@ -846,7 +856,8 @@ static int cdn_dp_audio_get_eld(struct d { struct cdn_dp_device *dp = dev_get_drvdata(dev); @@ -559,7 +559,7 @@ Signed-off-by: Sandor Yu return 0; } -@@ -879,6 +890,7 @@ static int cdn_dp_request_firmware(struc +@@ -880,6 +891,7 @@ static int cdn_dp_request_firmware(struc int ret; unsigned long timeout = jiffies + msecs_to_jiffies(CDN_FW_TIMEOUT_MS); unsigned long sleep = 1000; @@ -567,7 +567,7 @@ Signed-off-by: Sandor Yu WARN_ON(!mutex_is_locked(&dp->lock)); -@@ -889,13 +901,13 @@ static int cdn_dp_request_firmware(struc +@@ -890,13 +902,13 @@ static int cdn_dp_request_firmware(struc mutex_unlock(&dp->lock); while (time_before(jiffies, timeout)) { @@ -583,7 +583,7 @@ Signed-off-by: Sandor Yu "failed to request firmware: %d\n", ret); goto out; } -@@ -905,7 +917,7 @@ static int cdn_dp_request_firmware(struc +@@ -906,7 +918,7 @@ static int cdn_dp_request_firmware(struc goto out; } @@ -592,7 +592,7 @@ Signed-off-by: Sandor Yu ret = -ETIMEDOUT; out: mutex_lock(&dp->lock); -@@ -916,8 +928,9 @@ static void cdn_dp_pd_event_work(struct +@@ -917,8 +929,9 @@ static void cdn_dp_pd_event_work(struct { struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, event_work); @@ -603,7 +603,7 @@ Signed-off-by: Sandor Yu int ret; -@@ -934,44 +947,45 @@ static void cdn_dp_pd_event_work(struct +@@ -935,44 +948,45 @@ static void cdn_dp_pd_event_work(struct /* Not connected, notify userspace to disable the block */ if (!cdn_dp_connected_port(dp)) { @@ -662,7 +662,7 @@ Signed-off-by: Sandor Yu "Failed to config video %d\n", ret); } -@@ -1040,7 +1054,7 @@ static int cdn_dp_bind(struct device *de +@@ -1041,7 +1055,7 @@ static int cdn_dp_bind(struct device *de drm_encoder_helper_add(encoder, &cdn_dp_encoder_helper_funcs); @@ -671,7 +671,7 @@ Signed-off-by: Sandor Yu connector->polled = DRM_CONNECTOR_POLL_HPD; connector->dpms = DRM_MODE_DPMS_OFF; -@@ -1064,7 +1078,7 @@ static int cdn_dp_bind(struct device *de +@@ -1065,7 +1079,7 @@ static int cdn_dp_bind(struct device *de port = dp->port[i]; port->event_nb.notifier_call = cdn_dp_pd_event; @@ -680,7 +680,7 @@ Signed-off-by: Sandor Yu EXTCON_DISP_DP, &port->event_nb); if (ret) { -@@ -1091,7 +1105,7 @@ static void cdn_dp_unbind(struct device +@@ -1092,7 +1106,7 @@ static void cdn_dp_unbind(struct device { struct cdn_dp_device *dp = dev_get_drvdata(dev); struct drm_encoder *encoder = &dp->encoder; @@ -689,7 +689,7 @@ Signed-off-by: Sandor Yu cancel_work_sync(&dp->event_work); cdn_dp_encoder_disable(encoder); -@@ -1151,7 +1165,7 @@ static int cdn_dp_probe(struct platform_ +@@ -1152,7 +1166,7 @@ static int cdn_dp_probe(struct platform_ dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); if (!dp) return -ENOMEM; @@ -698,7 +698,7 @@ Signed-off-by: Sandor Yu match = of_match_node(cdn_dp_dt_ids, pdev->dev.of_node); dp_data = (struct cdn_dp_data *)match->data; -@@ -1196,7 +1210,7 @@ static int cdn_dp_remove(struct platform +@@ -1197,7 +1211,7 @@ static int cdn_dp_remove(struct platform struct cdn_dp_device *dp = platform_get_drvdata(pdev); platform_device_unregister(dp->audio_pdev); @@ -707,7 +707,7 @@ Signed-off-by: Sandor Yu component_del(&pdev->dev, &cdn_dp_component_ops); return 0; -@@ -1206,7 +1220,7 @@ static void cdn_dp_shutdown(struct platf +@@ -1207,7 +1221,7 @@ static void cdn_dp_shutdown(struct platf { struct cdn_dp_device *dp = platform_get_drvdata(pdev); diff --git a/target/linux/layerscape/patches-5.4/805-display-0003-drm-bridge-add-Cadence-MHDP-HDMI-DP-API.patch b/target/linux/layerscape/patches-5.4/805-display-0003-drm-bridge-add-Cadence-MHDP-HDMI-DP-API.patch index 14089a7b36..7606af4796 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0003-drm-bridge-add-Cadence-MHDP-HDMI-DP-API.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0003-drm-bridge-add-Cadence-MHDP-HDMI-DP-API.patch @@ -1794,7 +1794,7 @@ Signed-off-by: Sandor Yu #define encoder_to_dp(c) \ container_of(c, struct cdn_dp_device, encoder) -@@ -283,7 +283,7 @@ static int cdn_dp_connector_mode_valid(s +@@ -284,7 +284,7 @@ cdn_dp_connector_mode_valid(struct drm_c { struct cdn_dp_device *dp = connector_to_dp(connector); struct drm_display_info *display_info = @@ -1803,7 +1803,7 @@ Signed-off-by: Sandor Yu u32 requested, actual, rate, sink_max, source_max = 0; u8 lanes, bpc; -@@ -379,7 +379,7 @@ static int cdn_dp_get_sink_capability(st +@@ -380,7 +380,7 @@ static int cdn_dp_get_sink_capability(st } kfree(dp->edid); @@ -1812,7 +1812,7 @@ Signed-off-by: Sandor Yu cdns_mhdp_get_edid_block, &dp->mhdp); return 0; } -@@ -485,8 +485,8 @@ static int cdn_dp_disable(struct cdn_dp_ +@@ -486,8 +486,8 @@ static int cdn_dp_disable(struct cdn_dp_ cdns_mhdp_set_firmware_active(&dp->mhdp, false); cdn_dp_clk_disable(dp); dp->active = false; @@ -1823,7 +1823,7 @@ Signed-off-by: Sandor Yu if (!dp->connected) { kfree(dp->edid); dp->edid = NULL; -@@ -551,7 +551,7 @@ static void cdn_dp_encoder_mode_set(stru +@@ -552,7 +552,7 @@ static void cdn_dp_encoder_mode_set(stru { struct cdn_dp_device *dp = encoder_to_dp(encoder); struct drm_display_info *display_info = @@ -1832,7 +1832,7 @@ Signed-off-by: Sandor Yu struct video_info *video = &dp->mhdp.video_info; switch (display_info->bpc) { -@@ -579,7 +579,7 @@ static bool cdn_dp_check_link_status(str +@@ -580,7 +580,7 @@ static bool cdn_dp_check_link_status(str struct cdn_dp_port *port = cdn_dp_connected_port(dp); u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd); @@ -1841,7 +1841,7 @@ Signed-off-by: Sandor Yu return false; if (cdns_mhdp_dpcd_read(&dp->mhdp, DP_LANE0_1_STATUS, link_status, -@@ -808,7 +808,7 @@ static int cdn_dp_audio_hw_params(struct +@@ -809,7 +809,7 @@ static int cdn_dp_audio_hw_params(struct ret = cdns_mhdp_audio_config(&dp->mhdp, &audio); if (!ret) @@ -1850,7 +1850,7 @@ Signed-off-by: Sandor Yu out: mutex_unlock(&dp->lock); -@@ -824,9 +824,9 @@ static void cdn_dp_audio_shutdown(struct +@@ -825,9 +825,9 @@ static void cdn_dp_audio_shutdown(struct if (!dp->active) goto out; @@ -1862,7 +1862,7 @@ Signed-off-by: Sandor Yu out: mutex_unlock(&dp->lock); } -@@ -855,8 +855,8 @@ static int cdn_dp_audio_get_eld(struct d +@@ -856,8 +856,8 @@ static int cdn_dp_audio_get_eld(struct d { struct cdn_dp_device *dp = dev_get_drvdata(dev); @@ -1873,7 +1873,7 @@ Signed-off-by: Sandor Yu return 0; } -@@ -878,11 +878,11 @@ static int cdn_dp_audio_codec_init(struc +@@ -879,11 +879,11 @@ static int cdn_dp_audio_codec_init(struc .max_i2s_channels = 8, }; @@ -1889,7 +1889,7 @@ Signed-off-by: Sandor Yu } static int cdn_dp_request_firmware(struct cdn_dp_device *dp) -@@ -928,7 +928,7 @@ static void cdn_dp_pd_event_work(struct +@@ -929,7 +929,7 @@ static void cdn_dp_pd_event_work(struct { struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device, event_work); @@ -1898,7 +1898,7 @@ Signed-off-by: Sandor Yu enum drm_connector_status old_status; struct device *dev = dp->mhdp.dev; -@@ -966,8 +966,8 @@ static void cdn_dp_pd_event_work(struct +@@ -967,8 +967,8 @@ static void cdn_dp_pd_event_work(struct /* Enabled and connected with a sink, re-train if requested */ } else if (!cdn_dp_check_link_status(dp)) { @@ -1909,7 +1909,7 @@ Signed-off-by: Sandor Yu struct drm_display_mode *mode = &dp->mhdp.mode; DRM_DEV_INFO(dev, "Connected with sink. Re-train link\n"); -@@ -980,8 +980,8 @@ static void cdn_dp_pd_event_work(struct +@@ -981,8 +981,8 @@ static void cdn_dp_pd_event_work(struct /* If training result is changed, update the video config */ if (mode->clock && @@ -1920,7 +1920,7 @@ Signed-off-by: Sandor Yu ret = cdns_mhdp_config_video(&dp->mhdp); if (ret) { dp->connected = false; -@@ -1054,7 +1054,7 @@ static int cdn_dp_bind(struct device *de +@@ -1055,7 +1055,7 @@ static int cdn_dp_bind(struct device *de drm_encoder_helper_add(encoder, &cdn_dp_encoder_helper_funcs); @@ -1929,7 +1929,7 @@ Signed-off-by: Sandor Yu connector->polled = DRM_CONNECTOR_POLL_HPD; connector->dpms = DRM_MODE_DPMS_OFF; -@@ -1105,7 +1105,7 @@ static void cdn_dp_unbind(struct device +@@ -1106,7 +1106,7 @@ static void cdn_dp_unbind(struct device { struct cdn_dp_device *dp = dev_get_drvdata(dev); struct drm_encoder *encoder = &dp->encoder; @@ -1938,7 +1938,7 @@ Signed-off-by: Sandor Yu cancel_work_sync(&dp->event_work); cdn_dp_encoder_disable(encoder); -@@ -1209,7 +1209,7 @@ static int cdn_dp_remove(struct platform +@@ -1210,7 +1210,7 @@ static int cdn_dp_remove(struct platform { struct cdn_dp_device *dp = platform_get_drvdata(pdev); diff --git a/target/linux/layerscape/patches-5.4/805-display-0009-drm-rockchip-Fix-build-failed-issue.patch b/target/linux/layerscape/patches-5.4/805-display-0009-drm-rockchip-Fix-build-failed-issue.patch index 6f44ce2219..258079c222 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0009-drm-rockchip-Fix-build-failed-issue.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0009-drm-rockchip-Fix-build-failed-issue.patch @@ -13,7 +13,7 @@ Signed-off-by: Sandor Yu --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c -@@ -798,7 +798,7 @@ static int cdn_dp_audio_hw_params(struct +@@ -799,7 +799,7 @@ static int cdn_dp_audio_hw_params(struct audio.format = AFMT_I2S; break; case HDMI_SPDIF: diff --git a/target/linux/layerscape/patches-5.4/805-display-0012-drm-rockchip-change-base-address-name-from-regs-to-r.patch b/target/linux/layerscape/patches-5.4/805-display-0012-drm-rockchip-change-base-address-name-from-regs-to-r.patch index bb87fbcfbd..2b202dd25f 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0012-drm-rockchip-change-base-address-name-from-regs-to-r.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0012-drm-rockchip-change-base-address-name-from-regs-to-r.patch @@ -13,7 +13,7 @@ Signed-off-by: Sandor Yu --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c -@@ -718,10 +718,10 @@ static int cdn_dp_parse_dt(struct cdn_dp +@@ -719,10 +719,10 @@ static int cdn_dp_parse_dt(struct cdn_dp } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/target/linux/layerscape/patches-5.4/805-display-0018-drm-bridge-cdns-dp-Remove-link-rate-lanes-set-by-dev.patch b/target/linux/layerscape/patches-5.4/805-display-0018-drm-bridge-cdns-dp-Remove-link-rate-lanes-set-by-dev.patch index fba2ac4f02..3019b0c43f 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0018-drm-bridge-cdns-dp-Remove-link-rate-lanes-set-by-dev.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0018-drm-bridge-cdns-dp-Remove-link-rate-lanes-set-by-dev.patch @@ -142,7 +142,7 @@ Signed-off-by: Sandor Yu msg[4] = PTS1 | PTS2 | PTS3 | PTS4; --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c -@@ -306,12 +306,10 @@ static int cdn_dp_connector_mode_valid(s +@@ -307,12 +307,10 @@ cdn_dp_connector_mode_valid(struct drm_c requested = mode->clock * bpc * 3 / 1000; source_max = dp->lanes; @@ -157,7 +157,7 @@ Signed-off-by: Sandor Yu actual = rate * lanes / 100; -@@ -366,21 +364,25 @@ static int cdn_dp_firmware_init(struct c +@@ -367,21 +365,25 @@ static int cdn_dp_firmware_init(struct c static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) { @@ -188,7 +188,7 @@ Signed-off-by: Sandor Yu return 0; } -@@ -422,7 +424,8 @@ static int cdn_dp_enable_phy(struct cdn_ +@@ -423,7 +425,8 @@ static int cdn_dp_enable_phy(struct cdn_ } port->lanes = cdn_dp_get_port_lanes(port); @@ -198,7 +198,7 @@ Signed-off-by: Sandor Yu if (ret) { DRM_DEV_ERROR(dev, "set host capabilities failed: %d\n", ret); -@@ -577,9 +580,9 @@ static bool cdn_dp_check_link_status(str +@@ -578,9 +581,9 @@ static bool cdn_dp_check_link_status(str { u8 link_status[DP_LINK_STATUS_SIZE]; struct cdn_dp_port *port = cdn_dp_connected_port(dp); diff --git a/target/linux/layerscape/patches-5.4/807-gpio-0001-gpio-mpc8xxx-change-irq-handler-from-chained-to-norm.patch b/target/linux/layerscape/patches-5.4/807-gpio-0001-gpio-mpc8xxx-change-irq-handler-from-chained-to-norm.patch index 01d2772138..759480d4ac 100644 --- a/target/linux/layerscape/patches-5.4/807-gpio-0001-gpio-mpc8xxx-change-irq-handler-from-chained-to-norm.patch +++ b/target/linux/layerscape/patches-5.4/807-gpio-0001-gpio-mpc8xxx-change-irq-handler-from-chained-to-norm.patch @@ -59,7 +59,7 @@ Signed-off-by: Song Hui } static void mpc8xxx_irq_unmask(struct irq_data *d) -@@ -414,8 +414,16 @@ static int mpc8xxx_probe(struct platform +@@ -415,8 +415,16 @@ static int mpc8xxx_probe(struct platform if (devtype->gpio_dir_in_init) devtype->gpio_dir_in_init(gc); diff --git a/target/linux/layerscape/patches-5.4/807-gpio-0002-gpio-mpc8xxx-ls1088a-ls1028a-edge-detection-mode-bug.patch b/target/linux/layerscape/patches-5.4/807-gpio-0002-gpio-mpc8xxx-ls1088a-ls1028a-edge-detection-mode-bug.patch index 2809a8373e..1413e75d58 100644 --- a/target/linux/layerscape/patches-5.4/807-gpio-0002-gpio-mpc8xxx-ls1088a-ls1028a-edge-detection-mode-bug.patch +++ b/target/linux/layerscape/patches-5.4/807-gpio-0002-gpio-mpc8xxx-ls1088a-ls1028a-edge-detection-mode-bug.patch @@ -14,7 +14,7 @@ Signed-off-by: Song Hui --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c -@@ -296,6 +296,7 @@ static const struct mpc8xxx_gpio_devtype +@@ -297,6 +297,7 @@ static const struct mpc8xxx_gpio_devtype static const struct mpc8xxx_gpio_devtype ls1028a_gpio_devtype = { .gpio_dir_in_init = ls1028a_gpio_dir_in_init, diff --git a/target/linux/layerscape/patches-5.4/813-pm-0001-soc-fsl-add-RCPM-driver.patch b/target/linux/layerscape/patches-5.4/813-pm-0001-soc-fsl-add-RCPM-driver.patch index 533534d7c9..6bb5be37ee 100644 --- a/target/linux/layerscape/patches-5.4/813-pm-0001-soc-fsl-add-RCPM-driver.patch +++ b/target/linux/layerscape/patches-5.4/813-pm-0001-soc-fsl-add-RCPM-driver.patch @@ -24,7 +24,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig -@@ -52,4 +52,13 @@ config FSL_QIXIS +@@ -53,4 +53,13 @@ config FSL_QIXIS Say y here to enable QIXIS system controller api. The qixis driver provides FPGA functions to control system. diff --git a/target/linux/layerscape/patches-5.4/813-pm-0003-drivers-soc-fsl-add-EPU-FSM-configuration-for-deep-s.patch b/target/linux/layerscape/patches-5.4/813-pm-0003-drivers-soc-fsl-add-EPU-FSM-configuration-for-deep-s.patch index 21ac78b68d..bcf8099f5b 100644 --- a/target/linux/layerscape/patches-5.4/813-pm-0003-drivers-soc-fsl-add-EPU-FSM-configuration-for-deep-s.patch +++ b/target/linux/layerscape/patches-5.4/813-pm-0003-drivers-soc-fsl-add-EPU-FSM-configuration-for-deep-s.patch @@ -26,7 +26,7 @@ Signed-off-by: Ran Wang --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig -@@ -31,6 +31,13 @@ config FSL_MC_DPIO +@@ -32,6 +32,13 @@ config FSL_MC_DPIO objects individually, but groups them under a service layer API. diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index 62220ee8e5..e85d3531f3 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -44,7 +44,7 @@ Signed-off-by: Peter Chen * @revision: revision register contents * @version_type: VERSIONTYPE register contents, a sub release of a revision * @dr_mode: requested mode of operation -@@ -1111,6 +1112,7 @@ struct dwc3 { +@@ -1112,6 +1113,7 @@ struct dwc3 { u32 nr_scratch; u32 u1u2; u32 maximum_speed; @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3701,6 +3701,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3706,6 +3706,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch index 4e6f128695..f2a8190509 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch @@ -23,7 +23,7 @@ Signed-off-by: Li Jun #include #include -@@ -1096,6 +1097,7 @@ struct dwc3 { +@@ -1097,6 +1098,7 @@ struct dwc3 { void __iomem *regs; size_t regs_size; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch index 60b110ad58..a5b84f3db9 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch @@ -44,7 +44,7 @@ Reviewed-by: Peter Chen --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -1048,6 +1048,8 @@ struct dwc3_scratchpad_array { +@@ -1049,6 +1049,8 @@ struct dwc3_scratchpad_array { * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. * @dis_split_quirk: set to disable split boundary. @@ -53,7 +53,7 @@ Reviewed-by: Peter Chen * @imod_interval: set the interrupt moderation interval in 250ns * increments or 0 to disable. */ -@@ -1243,6 +1245,8 @@ struct dwc3 { +@@ -1245,6 +1247,8 @@ struct dwc3 { unsigned dis_split_quirk:1; From 830b07f08e7dfde0d5c44b6659dfa3d9af44e208 Mon Sep 17 00:00:00 2001 From: Oscar Molnar Date: Sat, 6 Aug 2022 16:13:41 +0100 Subject: [PATCH 11/11] build: add support for python3.11 and higher python3.11 beta is out but fails to run the makefile currently this supports python versions from 3.6 to 3.99 with the python3 binary it also checks specifically for 3.11 as it is the latest version out Signed-off-by: Oscar Molnar (cherry picked from commit a9e8eec221874e5840d659aed3f68850ff1d9982) Signed-off-by: Michal Vasilek [rebase for 21.02] --- include/prereq-build.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 61cd8ae516..b86e2e00b2 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -153,22 +153,24 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ $(eval $(call CleanupPython2)) $(eval $(call SetupHostCommand,python,Please install Python >= 3.5, \ + python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ python3.8 -V 2>&1 | grep 'Python 3', \ python3.7 -V 2>&1 | grep 'Python 3', \ python3.6 -V 2>&1 | grep 'Python 3', \ python3.5 -V 2>&1 | grep 'Python 3', \ - python3 -V 2>&1 | grep -E 'Python 3\.([5-9]|10)\.?')) + python3 -V 2>&1 | grep -E 'Python 3\.([5-9]|[0-9][0-9])\.?')) $(eval $(call SetupHostCommand,python3,Please install Python >= 3.5, \ + python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ python3.8 -V 2>&1 | grep 'Python 3', \ python3.7 -V 2>&1 | grep 'Python 3', \ python3.6 -V 2>&1 | grep 'Python 3', \ python3.5 -V 2>&1 | grep 'Python 3', \ - python3 -V 2>&1 | grep -E 'Python 3\.([5-9]|10)\.?')) + python3 -V 2>&1 | grep -E 'Python 3\.([5-9]|[0-9][0-9])\.?')) $(eval $(call TestHostCommand,python3-distutils, \ Please install the Python3 distutils module, \