seccomp: always include runtime arch in resulting profile#27
Open
takumi12311123 wants to merge 1 commit into
Open
seccomp: always include runtime arch in resulting profile#27takumi12311123 wants to merge 1 commit into
takumi12311123 wants to merge 1 commit into
Conversation
Profiles whose `architectures` list omits the runtime architecture (and default profiles on architectures not listed in arches()) cause syscalls unknown to libseccomp to return -EPERM instead of the -ENOSYS stub that libcontainer expects. glibc relies on -ENOSYS to fall back to older syscalls; without it, simple operations like `chmod -R` fail on ppc64le containers (e.g. fchmodat2 -> EPERM on Debian sid; moby/moby#48471). Mirror opencontainers/runc#4219: - default_linux.go: add the PPC family (PPC64LE, PPC64, PPC) to the architectures bundled into the default profile. - seccomp_linux.go: append the runtime arch to the resolved profile when it is not already present, so custom profiles which set "architectures" explicitly still get the ENOSYS stub for the host. - default.json: regenerated. Tests cover: an empty "architectures" list, a foreign-arch list, an already-present runtime arch (de-dup), and an archMap that supplied the runtime arch (de-dup via slices.Contains). A host-agnostic test asserts PPC entries in arches() so amd64 CI catches regressions too. Signed-off-by: Takumi Akasaka <takumiakasaka1231@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Profiles whose
architectureslist omits the runtime architecture (and default profiles on architectures not listed inarches()— most notably the PPC family) cause syscalls unknown to libseccomp to return-EPERMinstead of the-ENOSYSstub libcontainer expects. glibc relies on-ENOSYSto fall back to older syscalls; without it, simple operations likechmod -Rfail on ppc64le containers (e.g.fchmodat2-> EPERM on Debian sid; reported in moby/moby#48471 by @grooverdan viadh_installdocson a MariaDB build).Mirrors the analogous runc fix in opencontainers/runc#4219:
seccomp/default_linux.go: add the PPC family (PPC64LE, PPC64, PPC) to the architectures bundled into the default profile.seccomp/seccomp_linux.go: append the runtime arch to the resolved profile when it is not already present, so user-supplied profiles which set"architectures"explicitly still get the ENOSYS stub for the host.seccomp/default.json: regenerated viago generate ./seccomp/.Tests cover: an empty
"architectures"list, a foreign-arch list, an already-present runtime arch (de-dup), and an archMap that supplied the runtime arch (de-dup viaslices.Contains). A host-agnostic test asserts the PPC entries inarches()so amd64 CI catches regressions too.Locally verified via
docker run --platform=linux/{amd64,arm64,ppc64le,s390x} golang:1.23 go test ./seccomp/...— all pass.Created with: Claude Code (Opus 4.7)