Add timer_create and timer_settime to filters

Go 1.18 (as of golang.org/cl/324129) uses per-thread timers created and set
with timer_create/timer_settime for more accurate CPU pprof profiling.

Add these syscalls to the allowed syscall filters.

PiperOrigin-RevId: 399941561
This commit is contained in:
Michael Pratt
2021-09-30 08:46:04 -07:00
committed by gVisor bot
parent db88937abb
commit b4d4f4bd86
+16
View File
@@ -304,6 +304,22 @@ var allowedSyscalls = seccomp.SyscallRules{
seccomp.EqualTo(unix.SPLICE_F_NONBLOCK), /* flags */
},
},
unix.SYS_TIMER_CREATE: []seccomp.Rule{
{
seccomp.EqualTo(unix.CLOCK_THREAD_CPUTIME_ID), /* which */
seccomp.MatchAny{}, /* sevp */
seccomp.MatchAny{}, /* timerid */
},
},
unix.SYS_TIMER_DELETE: []seccomp.Rule{},
unix.SYS_TIMER_SETTIME: []seccomp.Rule{
{
seccomp.MatchAny{}, /* timerid */
seccomp.EqualTo(0), /* flags */
seccomp.MatchAny{}, /* new_value */
seccomp.EqualTo(0), /* old_value */
},
},
unix.SYS_TGKILL: []seccomp.Rule{
{
seccomp.EqualTo(uint64(os.Getpid())),