From 95bc057edfb679211a9fce540521e8a1d8e67748 Mon Sep 17 00:00:00 2001 From: Chunmei Xu Date: Fri, 4 Sep 2020 11:35:08 +0800 Subject: [PATCH] seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 Signed-off-by: Chunmei Xu Signed-off-by: weitao zhou --- 1001-openssh-8.1p1-seccomp-nanosleep.patch | 45 ++++++++++++++++++++++ openssh.spec | 13 ++++++- 2 files changed, 56 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..a7a16fd --- /dev/null +++ b/1001-openssh-8.1p1-seccomp-nanosleep.patch @@ -0,0 +1,45 @@ +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 ab3b01e..29567e7 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 @@ -246,6 +247,8 @@ Patch977: openssh-8.0p1-cve-2020-14145.patch # sshd -T requires -C when "Match" is used in sshd_config (#1836277) Patch978: openssh-8.0p1-sshd_config.patch +Patch1001: 1001-openssh-8.1p1-seccomp-nanosleep.patch + License: BSD Group: Applications/Internet Requires: /sbin/nologin @@ -337,7 +340,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 @@ -477,6 +480,8 @@ popd %patch100 -p1 -b .coverity +%patch1001 -p1 + autoreconf pushd pam_ssh_agent_auth-%{pam_ssh_agent_ver} autoreconf @@ -761,6 +766,10 @@ getent passwd sshd >/dev/null || \ %endif %changelog +* Tue Nov 30 2021 Weitao Zhou - 8.0p1-10.0.1 +- seccomp: Allow check_nanosleep to better compatibility for both glibc2.28 and glibc2.32 + + * Mon Jun 21 2021 Dmitry Belyavskiy - 8.0p1-10 - sshd -T requires -C when "Match" is used in sshd_config (#1836277) -- Gitee