mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add nanosleep filter for Go 1.11 support
golang.org/cl/108538 replaces pselect6 with nanosleep in runtime.usleep. Update the filters accordingly. PiperOrigin-RevId: 200574612 Change-Id: Ifb2296fcb3781518fc047aabbbffedb9ae488cd7
This commit is contained in:
@@ -6,6 +6,8 @@ go_library(
|
||||
name = "filter",
|
||||
srcs = [
|
||||
"config.go",
|
||||
"config_go110.go",
|
||||
"config_go111.go",
|
||||
"extra_filters.go",
|
||||
"extra_filters_msan.go",
|
||||
"extra_filters_race.go",
|
||||
|
||||
@@ -61,7 +61,6 @@ var allowedSyscalls = seccomp.SyscallRules{
|
||||
syscall.SYS_NEWFSTATAT: {},
|
||||
syscall.SYS_POLL: {},
|
||||
syscall.SYS_PREAD64: {},
|
||||
syscall.SYS_PSELECT6: {},
|
||||
syscall.SYS_PWRITE64: {},
|
||||
syscall.SYS_READ: {},
|
||||
syscall.SYS_READLINKAT: {},
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// Copyright 2018 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !go1.11
|
||||
|
||||
package filter
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"gvisor.googlesource.com/gvisor/pkg/seccomp"
|
||||
)
|
||||
|
||||
// TODO: Remove this file and merge config_go111.go back into
|
||||
// config.go once we no longer build with Go 1.10.
|
||||
|
||||
func init() {
|
||||
allowedSyscalls[syscall.SYS_PSELECT6] = []seccomp.Rule{}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright 2018 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build go1.11
|
||||
|
||||
package filter
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"gvisor.googlesource.com/gvisor/pkg/seccomp"
|
||||
)
|
||||
|
||||
func init() {
|
||||
allowedSyscalls[syscall.SYS_NANOSLEEP] = []seccomp.Rule{}
|
||||
}
|
||||
Reference in New Issue
Block a user