Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV #3862

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libcontainer/seccomp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ var flags = []string{
flagTsync,
string(specs.LinuxSeccompFlagSpecAllow),
string(specs.LinuxSeccompFlagLog),
string(specs.LinuxSeccompFlagWaitKillableRecv),
}

// KnownFlags returns the list of the known filter flags.
Expand Down
10 changes: 10 additions & 0 deletions libcontainer/seccomp/patchbpf/enosys_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ const uintptr_t C_FILTER_FLAG_SPEC_ALLOW = SECCOMP_FILTER_FLAG_SPEC_ALLOW;
#endif
const uintptr_t C_FILTER_FLAG_NEW_LISTENER = SECCOMP_FILTER_FLAG_NEW_LISTENER;

#ifndef SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV
# define SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV (1UL << 5)
#endif
const uintptr_t C_FILTER_FLAG_WAIT_KILLABLE_RECV = SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV;

#ifndef AUDIT_ARCH_RISCV64
#ifndef EM_RISCV
#define EM_RISCV 243
Expand Down Expand Up @@ -643,6 +648,11 @@ func filterFlags(config *configs.Seccomp, filter *libseccomp.ScmpFilter) (flags
flags |= uint(C.C_FILTER_FLAG_SPEC_ALLOW)
}
}
// TODO: Check if the version is the right API level for SECCOMP_FILTER_FLAG_TSYNC
// Unfortunately, there is no way to check API levels above 7 in libseccomp-golang.
// if apiLevel >= 7 {
// }

// XXX: add newly supported filter flags above this line.

for _, call := range config.Syscalls {
Expand Down
1 change: 1 addition & 0 deletions tests/integration/seccomp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function flags_value() {
['"SECCOMP_FILTER_FLAG_TSYNC"']=0 # Supported but ignored by runc, thus 0.
['"SECCOMP_FILTER_FLAG_LOG"']=2
['"SECCOMP_FILTER_FLAG_SPEC_ALLOW"']=4
['"SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV"']=7
# XXX: add new values above this line.
)
# Split the flags.
Expand Down