mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Use UMASK syscall instead of AFS_SYSCALL in seccomp test.
AFS_SYSCALL is not defined on ARM which causes nogo tests to fail when they land on ARM machines. I don't think umask(2) is being called by go runtime or any instrumentation, otherwise the test would be failing because it doesn't exist in filters. PiperOrigin-RevId: 454037751
This commit is contained in:
@@ -98,15 +98,13 @@ func main() {
|
||||
arch_syscalls(syscalls)
|
||||
// We choose a syscall that is unlikely to be called by Go runtime,
|
||||
// even with race or other instrumentation enabled.
|
||||
syscall := uintptr(unix.SYS_AFS_SYSCALL)
|
||||
// This test goes up to 11.
|
||||
syscallArg := uintptr(11)
|
||||
syscall := uintptr(unix.SYS_UMASK)
|
||||
|
||||
die := *dieFlag
|
||||
if !die {
|
||||
syscalls[syscall] = []seccomp.Rule{
|
||||
{
|
||||
seccomp.EqualTo(syscallArg),
|
||||
seccomp.EqualTo(0),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -117,9 +115,6 @@ func main() {
|
||||
}
|
||||
fmt.Printf("Filters installed\n")
|
||||
|
||||
if _, _, err := unix.RawSyscall(syscall, syscallArg, 0, 0); err != unix.Errno(0) {
|
||||
fmt.Printf("syscall error: %v\n", err)
|
||||
}
|
||||
|
||||
unix.RawSyscall(syscall, 0, 0, 0)
|
||||
fmt.Printf("Syscall was allowed!!!\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user