2014-02-18 14:04:57 +01:00
|
|
|
# HG changeset patch
|
2014-04-25 15:11:58 +02:00
|
|
|
# Parent bde6f1a808f345e141a976ebc3e37903c81a09cb
|
2014-02-18 14:04:57 +01:00
|
|
|
add 'getuid' syscall to list of allowed ones to prevent the sanboxed thread
|
|
|
|
from being killed by the seccomp filter
|
|
|
|
|
2016-04-06 13:34:51 +02:00
|
|
|
diff --git a/openssh-6.6p1/sandbox-seccomp-filter.c b/openssh-6.6p1/sandbox-seccomp-filter.c
|
|
|
|
--- a/openssh-6.6p1/sandbox-seccomp-filter.c
|
|
|
|
+++ b/openssh-6.6p1/sandbox-seccomp-filter.c
|
|
|
|
@@ -85,16 +85,20 @@ static const struct sock_filter preauth_
|
|
|
|
offsetof(struct seccomp_data, arch)),
|
|
|
|
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SECCOMP_AUDIT_ARCH, 1, 0),
|
|
|
|
BPF_STMT(BPF_RET+BPF_K, SECCOMP_FILTER_FAIL),
|
|
|
|
/* Load the syscall number for checking. */
|
|
|
|
BPF_STMT(BPF_LD+BPF_W+BPF_ABS,
|
|
|
|
offsetof(struct seccomp_data, nr)),
|
|
|
|
SC_DENY(open, EACCES),
|
2014-02-18 14:04:57 +01:00
|
|
|
SC_ALLOW(getpid),
|
|
|
|
+ SC_ALLOW(getuid),
|
2014-02-19 14:30:54 +01:00
|
|
|
+#ifdef __NR_getuid32
|
2014-02-19 14:22:51 +01:00
|
|
|
+ SC_ALLOW(getuid32),
|
2014-02-19 14:30:54 +01:00
|
|
|
+#endif
|
2014-02-18 14:04:57 +01:00
|
|
|
SC_ALLOW(gettimeofday),
|
2016-04-06 13:34:51 +02:00
|
|
|
SC_ALLOW(clock_gettime),
|
|
|
|
#ifdef __NR_time /* not defined on EABI ARM */
|
|
|
|
SC_ALLOW(time),
|
2014-02-18 14:04:57 +01:00
|
|
|
#endif
|
2016-04-06 13:34:51 +02:00
|
|
|
SC_ALLOW(read),
|
|
|
|
SC_ALLOW(write),
|
|
|
|
SC_ALLOW(close),
|