From 70db205020b12a7f820700e5f85fc39bffb2b31e Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 25 Jun 2022 16:41:18 +0200 Subject: [PATCH 1/5] ethtool: update to 5.18 9eabf30 Release version 5.18. 2b3ddcb ethtool: fec: Change the prompt string to adapt to current situations d660dde pretty: add missing message descriptions for rings aaeb16a pretty: support u8 enumerated types 6b320b8 rings: add support to set/get cqe size 41fddc0 update UAPI header copies 42e6c28 help: fix alignment of rx-buf-len parameter e1d0a19 ethtool.8: Fix typo in man page 37f0586 Release version 5.17. 8c2984c strset: do not put a pointer to a local variable to nlctx 8fd02a2 ioctl: add the memory free operation after send_ioctl call fails b9f25ea ethtool: Add support for OSFP transceiver modules 6e79542 features: add --json support 5ed5ce5 Merge branch 'next' into master b90abbb man: document recently added parameters 51a9312 tunables: add support to get/set tx copybreak buf size a081c2a rings: add support to set/get rx buf len d699bab Merge branch 'master' into next 52db6b9 Merge branch 'review/module-extstate' into next 6407b52 monitor: add option for --show-module/--set-module 1f35786 ethtool: Add transceiver module extended state 2d4c5b7 ethtool: Add ability to control transceiver modules' power mode 005908b Update UAPI header copies Signed-off-by: Nick Hainke (cherry picked from commit fe5d3a4204c543053f61e838588f24ad7b5f830b) --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index 5182c55331..dffcab357c 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=5.16 +PKG_VERSION:=5.18 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=aa2fef1936dd4a11755dfa0bdb93f0ec5bea45208d27c9754bc3abe1aa42c1cb +PKG_HASH:=9577b2ffbce710b659fb239598ec92bced1ca400ca0f1286762bfa44e4784270 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 0db8ea126391ba66b0a5f02dd4ce5afd6db4da8d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 20 Jun 2022 21:09:08 -0700 Subject: [PATCH 2/5] tools/meson: update to 0.61.5 Mostly backports by a Red Hat employee as 0.62 and newer demands Python 3.7+. Same reason 0.61 is kept here. Signed-off-by: Rosen Penev (cherry picked from commit d60cfa5a9e85c4d74411ce0afbde47f54030cea8) --- tools/meson/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/meson/Makefile b/tools/meson/Makefile index e2ea3d285c..d53ed897a3 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.61.4 +PKG_VERSION:=0.61.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=4e3733ddc66bac38e38c63b739c9b8b8fc5a866de5333396b0c85c2b144ddee9 +PKG_HASH:=5e9a0d65c1a51936362b9686d1c5e9e184a6fd245d57e7269750ce50c20f5d9a PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 From dec2584cf5093a8ccad4c65feeba416d5724b1d1 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Mon, 20 Jun 2022 10:37:15 +0300 Subject: [PATCH 3/5] dropbear: cherry-pick upstream commit 544f28a0 Resolves #10081 Reported-By: Chen Minqiang Signed-off-by: Konstantin Demin (cherry picked from commit f98bb1ffe5327d7309f11a3647efd8116d637b33) --- ...01-fix-MAX_UNAUTH_CLIENTS-regression.patch | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 package/network/services/dropbear/patches/001-fix-MAX_UNAUTH_CLIENTS-regression.patch diff --git a/package/network/services/dropbear/patches/001-fix-MAX_UNAUTH_CLIENTS-regression.patch b/package/network/services/dropbear/patches/001-fix-MAX_UNAUTH_CLIENTS-regression.patch new file mode 100644 index 0000000000..e0dca544ec --- /dev/null +++ b/package/network/services/dropbear/patches/001-fix-MAX_UNAUTH_CLIENTS-regression.patch @@ -0,0 +1,134 @@ +From: Matt Johnston +Date: Wed, 8 Jun 2022 21:26:20 +0800 +Subject: Fix MAX_UNAUTH_CLIENTS regression + +Since re-exec change in 2022.82 Dropbear count +treat authenticated sessions towards the unauthenticated +session limit. This is fixed by passing the childpipe FD +through to the re-execed process. +--- + runopts.h | 5 +++-- + svr-main.c | 21 +++++++++++---------- + svr-runopts.c | 15 ++++++++++++--- + 3 files changed, 26 insertions(+), 15 deletions(-) + +--- a/runopts.h ++++ b/runopts.h +@@ -79,8 +79,9 @@ typedef struct svr_runopts { + char *addresses[DROPBEAR_MAX_PORTS]; + + int inetdmode; +- /* Hidden "-2" flag indicates it's re-executing itself */ +- int reexec_child; ++ /* Hidden "-2 childpipe_fd" flag indicates it's re-executing itself, ++ stores the childpipe preauth file descriptor. Set to -1 otherwise. */ ++ int reexec_childpipe; + + /* Flags indicating whether to use ipv4 and ipv6 */ + /* not used yet +--- a/svr-main.c ++++ b/svr-main.c +@@ -71,7 +71,7 @@ int main(int argc, char ** argv) + #endif + + #if DROPBEAR_DO_REEXEC +- if (svr_opts.reexec_child) { ++ if (svr_opts.reexec_childpipe >= 0) { + #ifdef PR_SET_NAME + /* Fix the "Name:" in /proc/pid/status, otherwise it's + a FD number from fexecve. +@@ -102,7 +102,7 @@ static void main_inetd() { + + seedrandom(); + +- if (!svr_opts.reexec_child) { ++ if (svr_opts.reexec_childpipe < 0) { + /* In case our inetd was lax in logging source addresses */ + get_socket_address(0, NULL, NULL, &host, &port, 0); + dropbear_log(LOG_INFO, "Child connection from %s:%s", host, port); +@@ -115,10 +115,8 @@ static void main_inetd() { + setsid(); + } + +- /* Start service program +- * -1 is a dummy childpipe, just something we can close() without +- * mattering. */ +- svr_session(0, -1); ++ /* -1 for childpipe in the inetd case is discarded */ ++ svr_session(0, svr_opts.reexec_childpipe); + + /* notreached */ + } +@@ -347,9 +345,10 @@ static void main_noinetd(int argc, char + + if (execfd >= 0) { + #if DROPBEAR_DO_REEXEC +- /* Add "-2" to the args and re-execute ourself. */ +- char **new_argv = m_malloc(sizeof(char*) * (argc+3)); +- int pos0 = 0, new_argc = argc+1; ++ /* Add "-2 childpipe[1]" to the args and re-execute ourself. */ ++ char **new_argv = m_malloc(sizeof(char*) * (argc+4)); ++ char buf[10]; ++ int pos0 = 0, new_argc = argc+2; + + /* We need to specially handle "dropbearmulti dropbear". */ + if (multipath) { +@@ -359,7 +358,9 @@ static void main_noinetd(int argc, char + } + + memcpy(&new_argv[pos0], argv, sizeof(char*) * argc); +- new_argv[new_argc-1] = "-2"; ++ new_argv[new_argc-2] = "-2"; ++ snprintf(buf, sizeof(buf), "%d", childpipe[1]); ++ new_argv[new_argc-1] = buf; + new_argv[new_argc] = NULL; + + if ((dup2(childsock, STDIN_FILENO) < 0)) { +--- a/svr-runopts.c ++++ b/svr-runopts.c +@@ -138,6 +138,7 @@ void svr_getopts(int argc, char ** argv) + char* keepalive_arg = NULL; + char* idle_timeout_arg = NULL; + char* maxauthtries_arg = NULL; ++ char* reexec_fd_arg = NULL; + char* keyfile = NULL; + char c; + #if DROPBEAR_PLUGIN +@@ -175,6 +176,7 @@ void svr_getopts(int argc, char ** argv) + svr_opts.pubkey_plugin_options = NULL; + #endif + svr_opts.pass_on_env = 0; ++ svr_opts.reexec_childpipe = -1; + + #ifndef DISABLE_ZLIB + opts.compress_mode = DROPBEAR_COMPRESS_DELAYED; +@@ -250,12 +252,12 @@ void svr_getopts(int argc, char ** argv) + #if DROPBEAR_DO_REEXEC && NON_INETD_MODE + /* For internal use by re-exec */ + case '2': +- svr_opts.reexec_child = 1; ++ next = &reexec_fd_arg; + break; + #endif + case 'p': +- nextisport = 1; +- break; ++ nextisport = 1; ++ break; + case 'P': + next = &svr_opts.pidfile; + break; +@@ -426,6 +428,13 @@ void svr_getopts(int argc, char ** argv) + dropbear_log(LOG_INFO, "Forced command set to '%s'", svr_opts.forced_command); + } + ++ if (reexec_fd_arg) { ++ if (m_str_to_uint(reexec_fd_arg, &svr_opts.reexec_childpipe) == DROPBEAR_FAILURE ++ || svr_opts.reexec_childpipe < 0) { ++ dropbear_exit("Bad -2"); ++ } ++ } ++ + #if INETD_MODE + if (svr_opts.inetdmode && ( + opts.usingsyslog == 0 From e4a257513276b6efff7f7618d14175d66ce88344 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 21 Jun 2022 15:21:44 -0300 Subject: [PATCH 4/5] wolfssl: disable AES-NI by default for x86_64 WolfSSL is crashing with an illegal opcode in some x86_64 CPUs that have AES instructions but lack other extensions that are used by WolfSSL when AES-NI is enabled. Disable the option by default for now until the issue is properly fixed. People can enable them in a custom build if they are sure it will work for them. Signed-off-by: Eneas U de Queiroz (cherry picked from commit 0bd536723303ccd178e289690d073740c928bb34) (cherry picked from commit a972ca784ff5cf3e433ee37238c4b1e5bee06326) --- package/libs/wolfssl/Config.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/libs/wolfssl/Config.in b/package/libs/wolfssl/Config.in index 3d264e7743..eca9572c49 100644 --- a/package/libs/wolfssl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -68,7 +68,7 @@ config WOLFSSL_ASM_CAPABLE choice prompt "Hardware Acceleration" - default WOLFSSL_HAS_CPU_CRYPTO if WOLFSSL_ASM_CAPABLE + default WOLFSSL_HAS_CPU_CRYPTO if WOLFSSL_ASM_CAPABLE && !x86_64 default WOLFSSL_HAS_NO_HW config WOLFSSL_HAS_NO_HW @@ -80,6 +80,7 @@ choice help This will use Intel AESNI insturctions or armv8 Crypto Extensions. Either of them should easily outperform hardware crypto in WolfSSL. + Beware that for Intel, the CPU has to support SSE4 instructions. config WOLFSSL_HAS_AFALG bool "AF_ALG" @@ -96,5 +97,9 @@ choice bool "/dev/crypto - full" select WOLFSSL_HAS_DEVCRYPTO endchoice +if x86_64 && WOLFSSL_HAS_CPU_CRYPTO + comment "WARNING: make sure your CPU supports SSE4 instructions" + comment "WolfSSL may crash with an invalid opcode exception" +endif endif From da9b81accd658359d0d9eb24ccb73bc5897e27f8 Mon Sep 17 00:00:00 2001 From: lean Date: Sat, 19 Jun 2021 19:26:22 +0800 Subject: [PATCH 5/5] fstools: enable any device with non-MTD rootfs_data volume Fixes: #673 (cherry picked from commit 90ace9890f07c710c7659142135231a9cf7bc747) [rebased patch] Signed-off-by: Tianling Shen --- package/system/fstools/Makefile | 4 +- ...port-extroot-for-non-MTD-rootfs_data.patch | 123 ++++++++++++++++++ 2 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 package/system/fstools/patches/100-fstools-support-extroot-for-non-MTD-rootfs_data.patch diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 4668338c48..e39e44b893 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -79,14 +79,14 @@ define Package/block-mount SECTION:=base CATEGORY:=Base system TITLE:=Block device mounting and checking - DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c + DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c +fstools endef define Package/blockd SECTION:=base CATEGORY:=Base system TITLE:=Block device automounting - DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c + DEPENDS:=+block-mount +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c endef define Package/fstools/install diff --git a/package/system/fstools/patches/100-fstools-support-extroot-for-non-MTD-rootfs_data.patch b/package/system/fstools/patches/100-fstools-support-extroot-for-non-MTD-rootfs_data.patch new file mode 100644 index 0000000000..f7a4ad3c8e --- /dev/null +++ b/package/system/fstools/patches/100-fstools-support-extroot-for-non-MTD-rootfs_data.patch @@ -0,0 +1,123 @@ +From: Qi Liu + +In order to support extroot, block extroot command has to be able to +discover and properly mount the rootfs_data volume in order to discover +the extroot volume. Currently this process can only discover MTD devices. +This patch leverages libfstools in a similar way as mount_root to +discover, initialize, and mount rootfs_data volume. It would enable any +device with non-MTD rootfs_data volume to support extroot, including x86. + +Signed-off-by: Qi Liu +--- + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,9 +77,9 @@ INSTALL(TARGETS blockd RUNTIME DESTINATION sbin) + ADD_EXECUTABLE(block block.c probe.c probe-libblkid.c) + IF(DEFINED CMAKE_UBIFS_EXTROOT) + ADD_DEFINITIONS(-DUBIFS_EXTROOT) +- TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ubi-utils ${json}) ++ TARGET_LINK_LIBRARIES(block blkid-tiny dl fstools uci ubox ubus blobmsg_json ubi-utils ${json}) + ELSE(DEFINED CMAKE_UBIFS_EXTROOT) +- TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ${json}) ++ TARGET_LINK_LIBRARIES(block blkid-tiny dl fstools uci ubox ubus blobmsg_json ${json}) + ENDIF(DEFINED CMAKE_UBIFS_EXTROOT) + INSTALL(TARGETS block RUNTIME DESTINATION sbin) + +--- a/block.c ++++ b/block.c +@@ -46,6 +46,9 @@ + #include + #include + ++#include "libfstools/fstype.h" ++#include "libfstools/volume.h" ++ + #include "probe.h" + + #define AUTOFS_MOUNT_PATH "/tmp/run/blockd/" +@@ -1600,6 +1603,44 @@ static int main_extroot(int argc, char **argv) + } + #endif + ++ /* Find volume using libfstools */ ++ struct volume *data = volume_find("rootfs_data"); ++ if (data) { ++ volume_init(data); ++ ++ switch (volume_identify(data)) { ++ case FS_EXT4: { ++ char cfg[] = "/tmp/ext4_cfg"; ++ ++ /* Mount volume and try extroot (using fstab from that vol) */ ++ mkdir_p(cfg, 0755); ++ if (!mount(data->blk, cfg, "ext4", MS_NOATIME, NULL)) { ++ err = mount_extroot(cfg); ++ umount2(cfg, MNT_DETACH); ++ } ++ if (err < 0) ++ rmdir("/tmp/overlay"); ++ rmdir(cfg); ++ return err; ++ } ++ ++ case FS_F2FS: { ++ char cfg[] = "/tmp/f2fs_cfg"; ++ ++ /* Mount volume and try extroot (using fstab from that vol) */ ++ mkdir_p(cfg, 0755); ++ if (!mount(data->blk, cfg, "f2fs", MS_NOATIME, NULL)) { ++ err = mount_extroot(cfg); ++ umount2(cfg, MNT_DETACH); ++ } ++ if (err < 0) ++ rmdir("/tmp/overlay"); ++ rmdir(cfg); ++ return err; ++ } ++ } ++ } ++ + /* As a last resort look for /etc/config/fstab on "rootfs" partition */ + return mount_extroot(NULL); + } +--- /dev/null ++++ b/libfstools/fstype.h +@@ -0,0 +1,13 @@ ++#ifndef _FS_TYPE_H__ ++#define _FS_TYPE_H__ ++enum { ++ FS_NONE, ++ FS_SNAPSHOT, ++ FS_JFFS2, ++ FS_DEADCODE, ++ FS_UBIFS, ++ FS_F2FS, ++ FS_EXT4, ++ FS_TARGZ, ++}; ++#endif +--- a/libfstools/libfstools.h ++++ b/libfstools/libfstools.h +@@ -18,20 +18,10 @@ + #include + #include + #include ++#include "fstype.h" + + struct volume; + +-enum { +- FS_NONE, +- FS_SNAPSHOT, +- FS_JFFS2, +- FS_DEADCODE, +- FS_UBIFS, +- FS_F2FS, +- FS_EXT4, +- FS_TARGZ, +-}; +- + enum fs_state { + FS_STATE_UNKNOWN, + FS_STATE_PENDING,