Skip to content
Closed
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
6 changes: 4 additions & 2 deletions libcontainer/seccomp/patchbpf/enosys_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,10 @@ func filterFlags(config *configs.Seccomp, filter *libseccomp.ScmpFilter) (flags
}
}
if apiLevel >= 7 {
if waitKill, err := filter.GetWaitKill(); err != nil && !errors.Is(err, unix.EINVAL) {
return 0, false, fmt.Errorf("unable to fetch SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV bit: %w", err)
if waitKill, err := filter.GetWaitKill(); err != nil {
if !errors.Is(err, unix.EINVAL) {
return 0, false, fmt.Errorf("unable to fetch SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV bit: %w", err)
}
} else if waitKill {
flags |= uint(C.C_FILTER_FLAG_WAIT_KILLABLE_RECV)
}
Comment on lines +676 to 682

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really want to switch it over, I think better describes what we are doing, but I don't really mind too much either way.

Suggested change
if waitKill, err := filter.GetWaitKill(); err != nil {
if !errors.Is(err, unix.EINVAL) {
return 0, false, fmt.Errorf("unable to fetch SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV bit: %w", err)
}
} else if waitKill {
flags |= uint(C.C_FILTER_FLAG_WAIT_KILLABLE_RECV)
}
waitKill, err := filter.GetWaitKill()
if errors.Is(err, unix.EINVAL) {
waitKill, err = false, nil
}
if err != nil {
return 0, false, fmt.Errorf("unable to fetch SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV bit: %w", err)
}
if waitKill {
flags |= uint(C.C_FILTER_FLAG_WAIT_KILLABLE_RECV)
}

Expand Down
Loading