09320cf
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
09320cf
index 3a1aedce72c2..a8d472a63ccb 100644
09320cf
--- a/sandbox-seccomp-filter.c
09320cf
+++ b/sandbox-seccomp-filter.c
fb74d1e
@@ -50,6 +50,9 @@
fb74d1e
 #include <elf.h>
fb74d1e
 
fb74d1e
 #include <asm/unistd.h>
fb74d1e
+#ifdef __s390__
fb74d1e
+#include <asm/zcrypt.h>
fb74d1e
+#endif
fb74d1e
 
fb74d1e
 #include <errno.h>
fb74d1e
 #include <signal.h>
09320cf
@@ -235,7 +235,7 @@ static const struct sock_filter preauth_insns[] = {
09320cf
 	 * x86-64 syscall under some circumstances, e.g.
09320cf
 	 * https://bugs.debian.org/849923
09320cf
 	 */
09320cf
-	SC_ALLOW(__NR_clock_gettime & ~__X32_SYSCALL_BIT);
09320cf
+	SC_ALLOW(__NR_clock_gettime & ~__X32_SYSCALL_BIT),
09320cf
 #endif
09320cf
 
09320cf
 	/* Default deny */
8bcc21e
8bcc21e
8bcc21e
In order to use the OpenSSL-ibmpkcs11 engine it is needed to allow flock
8bcc21e
and ipc calls, because this engine calls OpenCryptoki (a PKCS#11
8bcc21e
implementation) which calls the libraries that will communicate with the
8bcc21e
crypto cards. OpenCryptoki makes use of flock and ipc and, as of now,
8bcc21e
this is only need on s390 architecture.
8bcc21e
8bcc21e
Signed-off-by: Eduardo Barretto <ebarretto@xxxxxxxxxxxxxxxxxx>
8bcc21e
---
8bcc21e
 sandbox-seccomp-filter.c | 6 ++++++
8bcc21e
 1 file changed, 6 insertions(+)
8bcc21e
8bcc21e
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
8bcc21e
index ca75cc7..6e7de31 100644
8bcc21e
--- a/sandbox-seccomp-filter.c
8bcc21e
+++ b/sandbox-seccomp-filter.c
8bcc21e
@@ -166,6 +166,9 @@ static const struct sock_filter preauth_insns[] = {
8bcc21e
 #ifdef __NR_exit_group
8bcc21e
 	SC_ALLOW(__NR_exit_group),
8bcc21e
 #endif
8bcc21e
+#if defined(__NR_flock) && defined(__s390__)
8bcc21e
+	SC_ALLOW(__NR_flock),
8bcc21e
+#endif
8bcc21e
 #ifdef __NR_getpgid
8bcc21e
 	SC_ALLOW(__NR_getpgid),
8bcc21e
 #endif
8bcc21e
@@ -178,6 +181,9 @@ static const struct sock_filter preauth_insns[] = {
8bcc21e
 #ifdef __NR_gettimeofday
8bcc21e
 	SC_ALLOW(__NR_gettimeofday),
8bcc21e
 #endif
8bcc21e
+#if defined(__NR_ipc) && defined(__s390__)
8bcc21e
+	SC_ALLOW(__NR_ipc),
8bcc21e
+#endif
8bcc21e
 #ifdef __NR_madvise
8bcc21e
 	SC_ALLOW(__NR_madvise),
8bcc21e
 #endif
8bcc21e
-- 
8bcc21e
1.9.1
8bcc21e
8bcc21e
getuid and geteuid are needed when using an openssl engine that calls a
8bcc21e
crypto card, e.g. ICA (libica).
8bcc21e
Those syscalls are also needed by the distros for audit code.
8bcc21e
8bcc21e
Signed-off-by: Eduardo Barretto <ebarretto@xxxxxxxxxxxxxxxxxx>
8bcc21e
---
8bcc21e
 sandbox-seccomp-filter.c | 12 ++++++++++++
8bcc21e
 1 file changed, 12 insertions(+)
8bcc21e
8bcc21e
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
8bcc21e
index 6e7de31..e86aa2c 100644
8bcc21e
--- a/sandbox-seccomp-filter.c
8bcc21e
+++ b/sandbox-seccomp-filter.c
8bcc21e
@@ -175,6 +175,18 @@ static const struct sock_filter preauth_insns[] = {
8bcc21e
 #ifdef __NR_getpid
8bcc21e
 	SC_ALLOW(__NR_getpid),
8bcc21e
 #endif
8bcc21e
+#ifdef __NR_getuid
8bcc21e
+	SC_ALLOW(__NR_getuid),
8bcc21e
+#endif
8bcc21e
+#ifdef __NR_getuid32
8bcc21e
+	SC_ALLOW(__NR_getuid32),
8bcc21e
+#endif
8bcc21e
+#ifdef __NR_geteuid
8bcc21e
+	SC_ALLOW(__NR_geteuid),
8bcc21e
+#endif
8bcc21e
+#ifdef __NR_geteuid32
8bcc21e
+	SC_ALLOW(__NR_geteuid32),
8bcc21e
+#endif
8bcc21e
 #ifdef __NR_getrandom
8bcc21e
 	SC_ALLOW(__NR_getrandom),
8bcc21e
 #endif
8bcc21e
-- 1.9.1
8bcc21e
8bcc21e
The EP11 crypto card needs to make an ioctl call, which receives an
8bcc21e
specific argument. This crypto card is for s390 only.
8bcc21e
8bcc21e
Signed-off-by: Eduardo Barretto <ebarretto@xxxxxxxxxxxxxxxxxx>
8bcc21e
---
8bcc21e
 sandbox-seccomp-filter.c | 2 ++
8bcc21e
 1 file changed, 2 insertions(+)
8bcc21e
8bcc21e
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
8bcc21e
index e86aa2c..98062f1 100644
8bcc21e
--- a/sandbox-seccomp-filter.c
8bcc21e
+++ b/sandbox-seccomp-filter.c
8bcc21e
@@ -250,6 +250,8 @@ static const struct sock_filter preauth_insns[] = {
8bcc21e
 	SC_ALLOW_ARG(__NR_ioctl, 1, Z90STAT_STATUS_MASK),
8bcc21e
 	SC_ALLOW_ARG(__NR_ioctl, 1, ICARSAMODEXPO),
8bcc21e
 	SC_ALLOW_ARG(__NR_ioctl, 1, ICARSACRT),
8bcc21e
+	/* Allow ioctls for EP11 crypto card on s390 */
8bcc21e
+	SC_ALLOW_ARG(__NR_ioctl, 1, ZSENDEP11CPRB),
8bcc21e
 #endif
8bcc21e
 #if defined(__x86_64__) && defined(__ILP32__) && defined(__X32_SYSCALL_BIT)
8bcc21e
 	/*
8bcc21e
-- 
8bcc21e
1.9.1