Skip to content

Commit e653176

Browse files
prattmicgvisor-bot
authored andcommitted
Drop sched_getaffinity from sentry syscall filters
As of https://go.dev/cl/677037, runtime.GOMAXPROCS guarantees that sched_getaffinity will not be called after returning. Thus it is safe to drop from the syscall filters, as the sentry always sets a custom GOMAXPROCS. The gofer keeps the filter, as it doesn't set a custom GOMAXPROCS. PiperOrigin-RevId: 795577263
1 parent 8d0454e commit e653176

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

runsc/boot/filter/config/config_main.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -263,22 +263,7 @@ var allowedSyscalls = seccomp.MakeSyscallRules(map[uintptr]seccomp.SyscallRule{
263263
unix.SYS_RT_SIGACTION: seccomp.MatchAll{},
264264
unix.SYS_RT_SIGPROCMASK: seccomp.MatchAll{},
265265
unix.SYS_RT_SIGRETURN: seccomp.MatchAll{},
266-
// TODO(go.dev/issue/73193): sched_getaffinity is used by Go's
267-
// automatic GOMAXPROCS updater. The runtime.GOMAXPROCS call in
268-
// boot.New explicitly disables this updater. Currently
269-
// runtime.GOMAXPROCS guarantees that the updater will not change
270-
// GOMAXPROCS after runtime.GOMAXPROCS return. However, it does not
271-
// guarantee that a concurrent update run will not perform the system
272-
// call after runtime.GOMAXPROCS returns. So there is a tiny probability
273-
// that we will manage to install filters before such a concurrent run
274-
// calls sched_getaffinity.
275-
//
276-
// The Go runtime should make a stronger guarantee. Until then, allow the
277-
// syscall.
278-
unix.SYS_SCHED_GETAFFINITY: seccomp.PerArg{
279-
seccomp.EqualTo(0),
280-
},
281-
unix.SYS_SCHED_YIELD: seccomp.MatchAll{},
266+
unix.SYS_SCHED_YIELD: seccomp.MatchAll{},
282267
unix.SYS_SENDMSG: seccomp.PerArg{
283268
seccomp.AnyValue{},
284269
seccomp.AnyValue{},

0 commit comments

Comments
 (0)