From 94ae5985394ba9fc64a7642577225f4d95bfa4cb Mon Sep 17 00:00:00 2001 From: anolis-bot Date: Wed, 22 Feb 2023 02:33:38 +0800 Subject: [PATCH 1/3] update to openssh-8.0p1-17.el8_7 Signed-off-by: anolis-bot --- 1000-openssh-anolis-fix-seccomp-error.patch | 26 ------------ 1001-openssh-8.1p1-seccomp-nanosleep.patch | 44 --------------------- dist | 2 +- openssh-8.0p1-ipv6-process.patch | 27 +++++++++++++ openssh.spec | 25 ++++-------- 5 files changed, 36 insertions(+), 88 deletions(-) delete mode 100644 1000-openssh-anolis-fix-seccomp-error.patch delete mode 100644 1001-openssh-8.1p1-seccomp-nanosleep.patch create mode 100644 openssh-8.0p1-ipv6-process.patch diff --git a/1000-openssh-anolis-fix-seccomp-error.patch b/1000-openssh-anolis-fix-seccomp-error.patch deleted file mode 100644 index f398ce9..0000000 --- a/1000-openssh-anolis-fix-seccomp-error.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -Nur openssh-8.0p1/configure openssh-8.0p1.new/configure ---- openssh-8.0p1/configure 2021-10-29 10:17:53.162420064 +0800 -+++ openssh-8.0p1.new/configure 2021-10-29 10:24:52.638846543 +0800 -@@ -7875,6 +7875,9 @@ - aarch64*-*) - seccomp_audit_arch=AUDIT_ARCH_AARCH64 - ;; -+ loongarch64*-*) -+ seccomp_audit_arch=AUDIT_ARCH_LOONGARCH64 -+ ;; - s390x-*) - seccomp_audit_arch=AUDIT_ARCH_S390X - ;; -diff -Nur openssh-8.0p1/configure.ac openssh-8.0p1.new/configure.ac ---- openssh-8.0p1/configure.ac 2021-10-29 10:17:49.986802431 +0800 -+++ openssh-8.0p1.new/configure.ac 2021-10-29 10:25:31.102923736 +0800 -@@ -882,6 +882,9 @@ - aarch64*-*) - seccomp_audit_arch=AUDIT_ARCH_AARCH64 - ;; -+ loongarch64*-*) -+ seccomp_audit_arch=AUDIT_ARCH_LOONGARCH64 -+ ;; - s390x-*) - seccomp_audit_arch=AUDIT_ARCH_S390X - ;; diff --git a/1001-openssh-8.1p1-seccomp-nanosleep.patch b/1001-openssh-8.1p1-seccomp-nanosleep.patch deleted file mode 100644 index 4ff852c..0000000 --- a/1001-openssh-8.1p1-seccomp-nanosleep.patch +++ /dev/null @@ -1,44 +0,0 @@ -commit 7e929163ed40f9ce90060a3ca6df558c3d901379 -Author: Jakub Jelen -Date: Wed Nov 13 12:57:05 2019 +0100 - - seccomp: Allow clock_nanosleep() to make OpenSSH working with latest glibc - -diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c -index b5cda70b..be239767 100644 ---- a/sandbox-seccomp-filter.c -+++ b/sandbox-seccomp-filter.c -@@ -242,6 +242,9 @@ static const struct sock_filter preauth_insns[] = { - #ifdef __NR_nanosleep - SC_ALLOW(__NR_nanosleep), - #endif -+#ifdef __NR_clock_nanosleep -+ SC_ALLOW(__NR_clock_nanosleep), -+#endif - #ifdef __NR__newselect - SC_ALLOW(__NR__newselect), - #endif - -commit 500c30eaf88f26e4a74b06717fe04afec7a7516f -Author: Jakub Jelen -Date: Wed Nov 27 11:06:55 2019 +0100 - - sandbox-seccomp: Allow clock_nanosleep on ARM - -diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c -index be239767..3ef30c9d 100644 ---- a/sandbox-seccomp-filter.c -+++ b/sandbox-seccomp-filter.c -@@ -245,6 +245,12 @@ static const struct sock_filter preauth_insns[] = { - #ifdef __NR_clock_nanosleep - SC_ALLOW(__NR_clock_nanosleep), - #endif -+#ifdef __NR_clock_nanosleep_time64 -+ SC_ALLOW(__NR_clock_nanosleep_time64), -+#endif -+#ifdef __NR_clock_gettime64 -+ SC_ALLOW(__NR_clock_gettime64), -+#endif - #ifdef __NR__newselect - SC_ALLOW(__NR__newselect), - #endif diff --git a/dist b/dist index 9c0e36e..535c690 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8 +an8_7 diff --git a/openssh-8.0p1-ipv6-process.patch b/openssh-8.0p1-ipv6-process.patch new file mode 100644 index 0000000..cb76938 --- /dev/null +++ b/openssh-8.0p1-ipv6-process.patch @@ -0,0 +1,27 @@ +diff --git a/sftp.c b/sftp.c +index 04881c83..03c7a5c7 100644 +--- a/sftp.c ++++ b/sftp.c +@@ -2527,12 +2527,17 @@ main(int argc, char **argv) + port = tmp; + break; + default: ++ /* Try with user, host and path. */ + if (parse_user_host_path(*argv, &user, &host, +- &file1) == -1) { +- /* Treat as a plain hostname. */ +- host = xstrdup(*argv); +- host = cleanhostname(host); +- } ++ &file1) == 0) ++ break; ++ /* Try with user and host. */ ++ if (parse_user_host_port(*argv, &user, &host, NULL) ++ == 0) ++ break; ++ /* Treat as a plain hostname. */ ++ host = xstrdup(*argv); ++ host = cleanhostname(host); + break; + } + file2 = *(argv + 1); diff --git a/openssh.spec b/openssh.spec index b738161..34a50f0 100644 --- a/openssh.spec +++ b/openssh.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 # Do we want SELinux & Audit %if 0%{?!noselinux:1} %global WITH_SELINUX 1 @@ -67,14 +66,14 @@ # Do not forget to bump pam_ssh_agent_auth release if you rewind the main package release to 1 %global openssh_ver 8.0p1 -%global openssh_rel 16 +%global openssh_rel 17 %global pam_ssh_agent_ver 0.10.3 %global pam_ssh_agent_rel 7 Summary: An open source implementation of SSH protocol version 2 Name: openssh Version: %{openssh_ver} -Release: %{openssh_rel}%{anolis_release}%{?dist}%{?rescue_rel} +Release: %{openssh_rel}%{?dist}%{?rescue_rel} URL: http://www.openssh.com/portable.html #URL1: http://pamsshagentauth.sourceforge.net Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz @@ -273,13 +272,8 @@ Patch984: openssh-8.0p1-crypto-policy-doc.patch # 0fa33683223c76289470a954404047bc762be84c # f8df0413f0a057b6a3d3dd7bd8bc7c5d80911d3a Patch985: openssh-8.7p1-minimize-sha1-use.patch - -Patch1001: 1001-openssh-8.1p1-seccomp-nanosleep.patch - -# Add by Anolis -# fix error: seccomp_filter sandbox not supported on loongarch64-Anolis-linux-gnu -Patch1002: 1000-openssh-anolis-fix-seccomp-error.patch -# End +# Upstream 25e3bccbaa63d27b9d5e09c123f1eb28594d2bd6 +Patch987: openssh-8.0p1-ipv6-process.patch License: BSD Group: Applications/Internet @@ -372,7 +366,7 @@ Requires: openssh = %{version}-%{release} Summary: PAM module for authentication with ssh-agent Group: System Environment/Base Version: %{pam_ssh_agent_ver} -Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{anolis_release}%{?dist}%{?rescue_rel} +Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{?dist}%{?rescue_rel} License: BSD %description @@ -511,6 +505,7 @@ popd %patch983 -p1 -b .sftp-realpath %patch984 -p1 -b .crypto-policy-doc %patch985 -p1 -b .minimize-sha1-use +%patch987 -p1 -b .sftp_ipv6 %patch200 -p1 -b .audit %patch201 -p1 -b .audit-race @@ -518,9 +513,6 @@ popd %patch100 -p1 -b .coverity -%patch1001 -p1 -%patch1002 -p1 - autoreconf pushd pam_ssh_agent_auth-%{pam_ssh_agent_ver} autoreconf @@ -805,9 +797,8 @@ getent passwd sshd >/dev/null || \ %endif %changelog -* Thu Dec 29 2022 Weitao Zhou - 8.0p1-16.0.1 -- seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 -- Support loongarch64 seccomp_filter sandbox (xuezhixin@uniontech.com) +* Mon Jan 23 2023 Dmitry Belyavskiy - 8.0p1-17 +- Fix parsing of IPv6 IPs in sftp client (#2162733) * Wed Jun 29 2022 Zoltan Fridrich - 8.0p1-16 - Omit client side from minimize-sha1-use.patch to prevent regression (#2093897) -- Gitee From e26c94b93b607489839affeebd79eabb1a6c2200 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Fri, 22 Apr 2022 14:02:21 +0800 Subject: [PATCH 2/3] seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 --- 1001-openssh-8.1p1-seccomp-nanosleep.patch | 44 ++++++++++++++++++++++ openssh.spec | 12 +++++- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 1001-openssh-8.1p1-seccomp-nanosleep.patch diff --git a/1001-openssh-8.1p1-seccomp-nanosleep.patch b/1001-openssh-8.1p1-seccomp-nanosleep.patch new file mode 100644 index 0000000..4ff852c --- /dev/null +++ b/1001-openssh-8.1p1-seccomp-nanosleep.patch @@ -0,0 +1,44 @@ +commit 7e929163ed40f9ce90060a3ca6df558c3d901379 +Author: Jakub Jelen +Date: Wed Nov 13 12:57:05 2019 +0100 + + seccomp: Allow clock_nanosleep() to make OpenSSH working with latest glibc + +diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c +index b5cda70b..be239767 100644 +--- a/sandbox-seccomp-filter.c ++++ b/sandbox-seccomp-filter.c +@@ -242,6 +242,9 @@ static const struct sock_filter preauth_insns[] = { + #ifdef __NR_nanosleep + SC_ALLOW(__NR_nanosleep), + #endif ++#ifdef __NR_clock_nanosleep ++ SC_ALLOW(__NR_clock_nanosleep), ++#endif + #ifdef __NR__newselect + SC_ALLOW(__NR__newselect), + #endif + +commit 500c30eaf88f26e4a74b06717fe04afec7a7516f +Author: Jakub Jelen +Date: Wed Nov 27 11:06:55 2019 +0100 + + sandbox-seccomp: Allow clock_nanosleep on ARM + +diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c +index be239767..3ef30c9d 100644 +--- a/sandbox-seccomp-filter.c ++++ b/sandbox-seccomp-filter.c +@@ -245,6 +245,12 @@ static const struct sock_filter preauth_insns[] = { + #ifdef __NR_clock_nanosleep + SC_ALLOW(__NR_clock_nanosleep), + #endif ++#ifdef __NR_clock_nanosleep_time64 ++ SC_ALLOW(__NR_clock_nanosleep_time64), ++#endif ++#ifdef __NR_clock_gettime64 ++ SC_ALLOW(__NR_clock_gettime64), ++#endif + #ifdef __NR__newselect + SC_ALLOW(__NR__newselect), + #endif diff --git a/openssh.spec b/openssh.spec index 34a50f0..d88d7f3 100644 --- a/openssh.spec +++ b/openssh.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # Do we want SELinux & Audit %if 0%{?!noselinux:1} %global WITH_SELINUX 1 @@ -73,7 +74,7 @@ Summary: An open source implementation of SSH protocol version 2 Name: openssh Version: %{openssh_ver} -Release: %{openssh_rel}%{?dist}%{?rescue_rel} +Release: %{openssh_rel}%{anolis_release}%{?dist}%{?rescue_rel} URL: http://www.openssh.com/portable.html #URL1: http://pamsshagentauth.sourceforge.net Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz @@ -275,6 +276,8 @@ Patch985: openssh-8.7p1-minimize-sha1-use.patch # Upstream 25e3bccbaa63d27b9d5e09c123f1eb28594d2bd6 Patch987: openssh-8.0p1-ipv6-process.patch +Patch1001: 1001-openssh-8.1p1-seccomp-nanosleep.patch + License: BSD Group: Applications/Internet Requires: /sbin/nologin @@ -366,7 +369,7 @@ Requires: openssh = %{version}-%{release} Summary: PAM module for authentication with ssh-agent Group: System Environment/Base Version: %{pam_ssh_agent_ver} -Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{?dist}%{?rescue_rel} +Release: %{pam_ssh_agent_rel}.%{openssh_rel}%{anolis_release}%{?dist}%{?rescue_rel} License: BSD %description @@ -513,6 +516,8 @@ popd %patch100 -p1 -b .coverity +%patch1001 -p1 + autoreconf pushd pam_ssh_agent_auth-%{pam_ssh_agent_ver} autoreconf @@ -797,6 +802,9 @@ getent passwd sshd >/dev/null || \ %endif %changelog +* Wed Feb 22 2023 Weitao Zhou - 8.0p1-17.0.1 +- seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 + * Mon Jan 23 2023 Dmitry Belyavskiy - 8.0p1-17 - Fix parsing of IPv6 IPs in sftp client (#2162733) -- Gitee From 5dd1167e344582deb31544180e95a94c43d91bb8 Mon Sep 17 00:00:00 2001 From: songmingliang Date: Fri, 22 Apr 2022 14:04:11 +0800 Subject: [PATCH 3/3] build: support loongarch64 seccomp_filter sandbox --- 1000-openssh-anolis-fix-seccomp-error.patch | 26 +++++++++++++++++++++ openssh.spec | 7 ++++++ 2 files changed, 33 insertions(+) create mode 100644 1000-openssh-anolis-fix-seccomp-error.patch diff --git a/1000-openssh-anolis-fix-seccomp-error.patch b/1000-openssh-anolis-fix-seccomp-error.patch new file mode 100644 index 0000000..f398ce9 --- /dev/null +++ b/1000-openssh-anolis-fix-seccomp-error.patch @@ -0,0 +1,26 @@ +diff -Nur openssh-8.0p1/configure openssh-8.0p1.new/configure +--- openssh-8.0p1/configure 2021-10-29 10:17:53.162420064 +0800 ++++ openssh-8.0p1.new/configure 2021-10-29 10:24:52.638846543 +0800 +@@ -7875,6 +7875,9 @@ + aarch64*-*) + seccomp_audit_arch=AUDIT_ARCH_AARCH64 + ;; ++ loongarch64*-*) ++ seccomp_audit_arch=AUDIT_ARCH_LOONGARCH64 ++ ;; + s390x-*) + seccomp_audit_arch=AUDIT_ARCH_S390X + ;; +diff -Nur openssh-8.0p1/configure.ac openssh-8.0p1.new/configure.ac +--- openssh-8.0p1/configure.ac 2021-10-29 10:17:49.986802431 +0800 ++++ openssh-8.0p1.new/configure.ac 2021-10-29 10:25:31.102923736 +0800 +@@ -882,6 +882,9 @@ + aarch64*-*) + seccomp_audit_arch=AUDIT_ARCH_AARCH64 + ;; ++ loongarch64*-*) ++ seccomp_audit_arch=AUDIT_ARCH_LOONGARCH64 ++ ;; + s390x-*) + seccomp_audit_arch=AUDIT_ARCH_S390X + ;; diff --git a/openssh.spec b/openssh.spec index d88d7f3..e977d88 100644 --- a/openssh.spec +++ b/openssh.spec @@ -278,6 +278,11 @@ Patch987: openssh-8.0p1-ipv6-process.patch Patch1001: 1001-openssh-8.1p1-seccomp-nanosleep.patch +# Add by Anolis +# fix error: seccomp_filter sandbox not supported on loongarch64-Anolis-linux-gnu +Patch1002: 1000-openssh-anolis-fix-seccomp-error.patch +# End + License: BSD Group: Applications/Internet Requires: /sbin/nologin @@ -517,6 +522,7 @@ popd %patch100 -p1 -b .coverity %patch1001 -p1 +%patch1002 -p1 autoreconf pushd pam_ssh_agent_auth-%{pam_ssh_agent_ver} @@ -804,6 +810,7 @@ getent passwd sshd >/dev/null || \ %changelog * Wed Feb 22 2023 Weitao Zhou - 8.0p1-17.0.1 - seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 +- Support loongarch64 seccomp_filter sandbox (xuezhixin@uniontech.com) * Mon Jan 23 2023 Dmitry Belyavskiy - 8.0p1-17 - Fix parsing of IPv6 IPs in sftp client (#2162733) -- Gitee