Skip to content

seccomp: ignore unsupported wait-kill flag probe#5347

Merged
rata merged 1 commit into
opencontainers:mainfrom
pacoxu:patch-1
Jun 29, 2026
Merged

seccomp: ignore unsupported wait-kill flag probe#5347
rata merged 1 commit into
opencontainers:mainfrom
pacoxu:patch-1

Conversation

@pacoxu

@pacoxu pacoxu commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

See kubernetes/kubernetes#140039.

The logic here was added in #5172.

@rata

rata commented Jun 26, 2026

Copy link
Copy Markdown
Member

@pacoxu did you also verify this solves the issue on CI somehow?

@rata rata left a comment

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.

Thanks for the PR! This almost LGTM. If this fixes the issue, I'm fine using this as a quick-fix to release 1.5.1

However, I'd also like to understand how runc is being built in kubernetes CI (not blocking the merge). I guess it is being compiled with an old seccomp headers (< 2.6.0), but run with new headers (>= 2.6.0). Can you confirm this is true?

Comment thread libcontainer/seccomp/patchbpf/enosys_linux.go Outdated
Signed-off-by: Paco Xu <roollingstone@gmail.com>
@lifubang

Copy link
Copy Markdown
Member

I guess it is being compiled with an old seccomp headers (< 2.6.0), but run with new headers (>= 2.6.0).

This is precisely the situation I aimed to prevent for libpathrs. A similar version check might also be necessary for libseccomp, as proposed in #5344. However, implementing it there would constitute a break change. If you'd like to discuss this further, let's continue the conversation in #5344.

@pacoxu
pacoxu requested a review from rata June 29, 2026 02:52

@rata rata left a comment

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.

LGTM, @pacoxu thanks a lot! @lifubang thanks too!

@rata
rata merged commit d3e8242 into opencontainers:main Jun 29, 2026
55 checks passed
@rata rata added the backport/1.5-todo A PR in main branch which needs to be backported to release-1.5 label Jun 29, 2026
@lifubang lifubang added backport/1.5-done A PR in main branch which has been backported to release-1.5 and removed backport/1.5-todo A PR in main branch which needs to be backported to release-1.5 labels Jun 29, 2026
@kolyshkin

Copy link
Copy Markdown
Contributor

I guess it is being compiled with an old seccomp headers (< 2.6.0), but run with new headers (>= 2.6.0). Can you confirm this is true?

This has nothing to do with the headers (libseccomp-golang provides missing defines). Also, the call is guarded by if apiLevel >= 7. I can't wrap my head around it just yet but it looks like this is an issue with libseccomp-golang.

@kolyshkin

Copy link
Copy Markdown
Contributor

I guess it is being compiled with an old seccomp headers (< 2.6.0), but run with new headers (>= 2.6.0). Can you confirm this is true?

This has nothing to do with the headers (libseccomp-golang provides missing defines). Also, the call is guarded by if apiLevel >= 7. I can't wrap my head around it just yet but it looks like this is an issue with libseccomp-golang.

OK this is about headers; the proposed fix is in seccomp/libseccomp-golang#127

kolyshkin added a commit to kolyshkin/libseccomp-golang that referenced this pull request Jul 17, 2026
This was initially reported to kubernetes[1] and fixed in runc[2] by
ignoring EINVAL.

The original underlying issue though is when libseccomp-golang is
compiled against an older version of libseccomp headers, the new
flag attributes (such as WAITKILL) are set to 0 instead of a proper
value, because for some reason _SCMP_FLTATR_MIN was used (starting from
commit 4b17538).

As a result, seccomp_attr_set(3) returns EINVAL, as 0 is not a valid
attribute value.

The fix is to provide the real values of the attributes so even when
older headers are used we still have the correct values. NOTE we can't
use #ifndef and instead rely on a headers version check because those
values are part of an enum.

This bug eluded our tests because we always use the same libseccomp for
compilation and testing.

[1]: kubernetes/kubernetes#140039
[2]: opencontainers/runc#5347
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/libseccomp-golang that referenced this pull request Jul 20, 2026
For some reason, since commit 4b17538 the filter attributes missed from
includes were defined to _SCMP_FLTATR_MIN (which is an invalid value)
and so, when used, resulted in EINVAL (see [1], [2]).

From the first sight it looks like those are to be never used in
practice as we have the API level check. Yet, when the libseccomp
version used during runtime is newer than the one used during build
time, it is quite possible (since GetAPI returned the runtime version).
The GetAPI behavior is fixed, but still it makes little sense to have
those defines set to an invalid value.

Fix to use the correct numbers.

[1]: kubernetes/kubernetes#140039
[2]: opencontainers/runc#5347
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/libseccomp-golang that referenced this pull request Jul 20, 2026
For some reason, since commit 4b17538 the filter attributes missed from
includes were defined to _SCMP_FLTATR_MIN (which is an invalid value)
and so, when used, resulted in EINVAL (see [1], [2]).

From the first sight it looks like those are to be never used in
practice as we have the API level check. Yet, when the libseccomp
version used during runtime is newer than the one used during build
time, it is quite possible (since GetAPI returned the runtime version).

Fix to use the correct numbers.

[1]: kubernetes/kubernetes#140039
[2]: opencontainers/runc#5347
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/libseccomp-golang that referenced this pull request Jul 21, 2026
For some reason, since commit 4b17538 the filter attributes missed from
includes were defined to _SCMP_FLTATR_MIN (which is an invalid value)
and so, when used, resulted in EINVAL (see [1], [2]).

From the first sight it looks like those are to be never used in
practice as we have the API level check. Yet, when the libseccomp
version used during runtime is newer than the one used during build
time, it is quite possible (since GetAPI returned the runtime version).

Fix to use the correct numbers.

[1]: kubernetes/kubernetes#140039
[2]: opencontainers/runc#5347
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.5-done A PR in main branch which has been backported to release-1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants