Skip to content

Commit e44bee1

Browse files
committed
libct/seccomp: warn about unknown syscalls
Rather than silently ignoring unknown syscalls, print a warning. While at it, fix imports ordering (stdlib, others, ours). [v2: demote Warn to Debug] Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 073e085 commit e44bee1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

libcontainer/seccomp/seccomp_linux.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import (
66
"errors"
77
"fmt"
88

9-
"github.com/opencontainers/runc/libcontainer/configs"
10-
"github.com/opencontainers/runc/libcontainer/seccomp/patchbpf"
11-
129
libseccomp "github.com/seccomp/libseccomp-golang"
10+
"github.com/sirupsen/logrus"
1311
"golang.org/x/sys/unix"
12+
13+
"github.com/opencontainers/runc/libcontainer/configs"
14+
"github.com/opencontainers/runc/libcontainer/seccomp/patchbpf"
1415
)
1516

1617
var (
@@ -151,10 +152,11 @@ func matchCall(filter *libseccomp.ScmpFilter, call *configs.Syscall) error {
151152
return errors.New("empty string is not a valid syscall")
152153
}
153154

154-
// If we can't resolve the syscall, assume it's not supported on this kernel
155-
// Ignore it, don't error out
155+
// If we can't resolve the syscall, assume it is not supported
156+
// by this kernel. Warn about it, don't error out.
156157
callNum, err := libseccomp.GetSyscallFromName(call.Name)
157158
if err != nil {
159+
logrus.Debugf("unknown seccomp syscall %q ignored", call.Name)
158160
return nil
159161
}
160162

0 commit comments

Comments
 (0)