seccomp: always include the host's native architecture when expanding archMap - #41
Open
bloodsportshooting wants to merge 1 commit into
Open
bloodsportshooting wants to merge 1 commit into
bloodsportshooting wants to merge 1 commit into
Conversation
… archMap When a profile is expanded from archMap, setupSeccomp only added the native architecture if an archMap entry matched it. For architectures that the default profile's archMap omits (e.g. ppc64le), the generated profile ended up with no entry for the host arch, so libseccomp had nothing to attach the -ENOSYS stub to and unknown syscalls returned -EPERM instead of -ENOSYS (moby/moby#48471). Mirror the fix already applied in opencontainers/runc#4219: always add the native seccomp architecture when expanding archMap. Profiles that explicitly list their own Architectures are left untouched. Add regression tests covering both the missing-arch and explicit-Architectures paths.
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.
What this PR does
Fixes moby/moby#48471.
When a seccomp profile is expanded from
archMap,setupSeccomponly added the host's native architecture if anarchMapentry matched it. For architectures the default profile'sarchMapomits (historically ppc64le), the generated profile had no entry for the host arch, so libseccomp had nothing to attach the-ENOSYSstub to. The result: unknown syscalls returned-EPERMinstead of-ENOSYS(e.g.fchmodat2failing on ppc64le before runc 1.2).This mirrors the fix already applied upstream in opencontainers/runc#4219: always add the native seccomp architecture when expanding
archMap.Why scoped to archMap only
Profiles that explicitly list their own
Architecturesare left untouched — injecting the native arch there would change existing, deliberate behavior (and breaks the existingLoadProfilefixture tests). The bug only affects thearchMap(default-profile) expansion path.How to verify
TestSetupSeccompIncludesNativeArch: archMap present but omits the native arch -> native arch is now in the generatedArchitectures.TestSetupSeccompDoesNotInjectNativeArchWithoutArchMap: explicitArchitectures, noarchMap-> native arch is NOT injected.Release note