diff --git a/lib/EvalServer.pm b/lib/EvalServer.pm index 52d88a6..5ddbb7d 100644 --- a/lib/EvalServer.pm +++ b/lib/EvalServer.pm @@ -75,7 +75,9 @@ sub timeout { warn "Trying to kill: ", $wheel->PID; - kill( 9, $wheel->PID ); + kill( 'TERM', $wheel->PID ); # Try to avoid orphaning any sub processes first + sleep(3); + kill( 'KILL', $wheel->PID ); } sub _append_output { diff --git a/lib/EvalServer/Seccomp.pm b/lib/EvalServer/Seccomp.pm index a01d920..b607fa6 100644 --- a/lib/EvalServer/Seccomp.pm +++ b/lib/EvalServer/Seccomp.pm @@ -39,6 +39,7 @@ our %rule_sets = ( {syscall => 'exit_group'}, {syscall => 'rt_sigaction'}, {syscall => 'rt_sigprocmask'}, + {syscall => 'rt_sigreturn'}, {syscall => 'getuid'}, {syscall => 'geteuid'}, @@ -165,6 +166,9 @@ our %rule_sets = ( # Thread IPC writes, these might not be fixed but I don't know how to detect them otherwise {syscall => 'write', rules => [[0, '==', 5]]}, {syscall => 'write', rules => [[0, '==', 7]]}, + # TODO these should be defaults? locked down more? + {syscall => 'prctl',}, + {syscall => 'poll',}, ], include => ['default', 'ruby_timer_thread'], }, diff --git a/lib/eval.pl b/lib/eval.pl index fa629da..c3848cc 100755 --- a/lib/eval.pl +++ b/lib/eval.pl @@ -262,15 +262,15 @@ use Storable qw/nfreeze/; nfreeze([]); #Preload Nfreeze since it's loaded on dem and setrlimit(RLIMIT_STACK, $limit, $limit ) and - setrlimit(RLIMIT_NPROC, 4,4) # CHANGED to 3 for Ruby. Might take it away. + setrlimit(RLIMIT_NPROC, 10,10) # CHANGED to 3 for Ruby. Might take it away. and - setrlimit(RLIMIT_NOFILE, 20,20) + setrlimit(RLIMIT_NOFILE, 30,30) and - setrlimit(RLIMIT_OFILE, 20,20) + setrlimit(RLIMIT_OFILE, 30,30) and - setrlimit(RLIMIT_OPEN_MAX,20,20) + setrlimit(RLIMIT_OPEN_MAX,30,30) and - setrlimit(RLIMIT_LOCKS, 0,0) + setrlimit(RLIMIT_LOCKS, 5,5) and setrlimit(RLIMIT_AS,$limit,$limit) and