Skip to content

seccomp: patchbpf: always include native architecture in stub#4219

Merged
cyphar merged 2 commits intoopencontainers:mainfrom
cyphar:seccomp-patchbpf-ppc64le
Mar 29, 2024
Merged

seccomp: patchbpf: always include native architecture in stub#4219
cyphar merged 2 commits intoopencontainers:mainfrom
cyphar:seccomp-patchbpf-ppc64le

Conversation

@cyphar
Copy link
Copy Markdown
Member

@cyphar cyphar commented Mar 13, 2024

It turns out that on ppc64le (at least), Docker doesn't include any
architectures in the list of allowed architectures. libseccomp
interprets this as "just include the default architecture" but patchbpf
would return a no-op ENOSYS stub, which would lead to the exact issues
that commit 7a8d716 ("seccomp: prepend -ENOSYS stub to all
filters") fixed for other architectures.

So, just always include the running architecture in the list. There's
no real downside.

Ref: https://bugzilla.suse.com/show_bug.cgi?id=1192051#c6
Reported-by: Fabian Vogt fvogt@suse.com
Signed-off-by: Aleksa Sarai cyphar@cyphar.com

@cyphar cyphar added this to the 1.2.0 milestone Mar 13, 2024
@cyphar
Copy link
Copy Markdown
Member Author

cyphar commented Mar 21, 2024

We'Ve confirmed this fixes the issue on ppc64le. For background, this issue means that our ENOSYS stub has never worked on ppc64le with Docker's default profile 😰.

@cyphar cyphar requested review from AkihiroSuda and kolyshkin March 21, 2024 03:38
Comment thread libcontainer/seccomp/patchbpf/enosys_linux_test.go Outdated
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@cyphar cyphar force-pushed the seccomp-patchbpf-ppc64le branch from 376417b to 4f4f093 Compare March 29, 2024 01:01
cyphar added 2 commits March 29, 2024 12:01
Calling the Linux AUDIT_* architecture constants "native" leads to
confusing code when we are getting the actual native architecture of the
running system.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
It turns out that on ppc64le (at least), Docker doesn't include any
architectures in the list of allowed architectures. libseccomp
interprets this as "just include the default architecture" but patchbpf
would return a no-op ENOSYS stub, which would lead to the exact issues
that commit 7a8d716 ("seccomp: prepend -ENOSYS stub to all
filters") fixed for other architectures.

So, just always include the running architecture in the list. There's
no real downside.

Ref: https://bugzilla.suse.com/show_bug.cgi?id=1192051#c6
Reported-by: Fabian Vogt <fvogt@suse.com>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/seccomp backport/1.1-done A PR in main branch which has been backported to release-1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants