bmh10 / rpms / openssh

Forked from rpms/openssh 10 days ago
Clone
943807
In order to use the OpenSSL-ibmpkcs11 engine it is needed to allow flock
943807
and ipc calls, because this engine calls OpenCryptoki (a PKCS#11
943807
implementation) which calls the libraries that will communicate with the
943807
crypto cards. OpenCryptoki makes use of flock and ipc and, as of now,
943807
this is only need on s390 architecture.
943807
943807
Signed-off-by: Eduardo Barretto <ebarretto@xxxxxxxxxxxxxxxxxx>
943807
---
943807
 sandbox-seccomp-filter.c | 6 ++++++
943807
 1 file changed, 6 insertions(+)
943807
943807
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
943807
index ca75cc7..6e7de31 100644
943807
--- a/sandbox-seccomp-filter.c
943807
+++ b/sandbox-seccomp-filter.c
943807
@@ -166,6 +166,9 @@ static const struct sock_filter preauth_insns[] = {
943807
 #ifdef __NR_exit_group
943807
 	SC_ALLOW(__NR_exit_group),
943807
 #endif
943807
+#if defined(__NR_flock) && defined(__s390__)
943807
+	SC_ALLOW(__NR_flock),
943807
+#endif
943807
 #ifdef __NR_futex
943807
 	SC_ALLOW(__NR_futex),
943807
 #endif
943807
@@ -178,6 +181,9 @@ static const struct sock_filter preauth_insns[] = {
943807
 #ifdef __NR_gettimeofday
943807
 	SC_ALLOW(__NR_gettimeofday),
943807
 #endif
943807
+#if defined(__NR_ipc) && defined(__s390__)
943807
+	SC_ALLOW(__NR_ipc),
943807
+#endif
943807
 #ifdef __NR_getuid
943807
 	SC_ALLOW(__NR_getuid),
943807
 #endif
943807
-- 
943807
1.9.1
943807
943807
getuid and geteuid are needed when using an openssl engine that calls a
943807
crypto card, e.g. ICA (libica).
943807
Those syscalls are also needed by the distros for audit code.
943807
943807
Signed-off-by: Eduardo Barretto <ebarretto@xxxxxxxxxxxxxxxxxx>
943807
---
943807
 sandbox-seccomp-filter.c | 12 ++++++++++++
943807
 1 file changed, 12 insertions(+)
943807
943807
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
943807
index 6e7de31..e86aa2c 100644
943807
--- a/sandbox-seccomp-filter.c
943807
+++ b/sandbox-seccomp-filter.c
943807
@@ -175,6 +175,18 @@ static const struct sock_filter preauth_insns[] = {
943807
 #ifdef __NR_getpid
943807
 	SC_ALLOW(__NR_getpid),
943807
 #endif
943807
+#ifdef __NR_getuid
943807
+	SC_ALLOW(__NR_getuid),
943807
+#endif
943807
+#ifdef __NR_getuid32
943807
+	SC_ALLOW(__NR_getuid32),
943807
+#endif
943807
+#ifdef __NR_geteuid
943807
+	SC_ALLOW(__NR_geteuid),
943807
+#endif
943807
+#ifdef __NR_geteuid32
943807
+	SC_ALLOW(__NR_geteuid32),
943807
+#endif
943807
 #ifdef __NR_getrandom
943807
 	SC_ALLOW(__NR_getrandom),
943807
 #endif
943807
-- 1.9.1
943807
1.9.1
943807
diff -up openssh-7.6p1/sandbox-seccomp-filter.c.sandbox openssh-7.6p1/sandbox-seccomp-filter.c
943807
--- openssh-7.6p1/sandbox-seccomp-filter.c.sandbox	2017-12-12 13:59:30.563874059 +0100
943807
+++ openssh-7.6p1/sandbox-seccomp-filter.c	2017-12-12 13:59:14.842784083 +0100
943807
@@ -190,6 +190,9 @@ static const struct sock_filter preauth_
943807
 #ifdef __NR_geteuid32
943807
 	SC_ALLOW(__NR_geteuid32),
943807
 #endif
943807
+#ifdef __NR_gettid
943807
+	SC_ALLOW(__NR_gettid),
943807
+#endif
943807
 #ifdef __NR_getrandom
943807
 	SC_ALLOW(__NR_getrandom),
943807
 #endif
943807