-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
profiles/seccomp: use conditional (hard-coded) errNoRet for MIPS/non-…
…MIPS The value of ENOSYS differs between MIPS and non-MIPS architectures. While this is not problematic for the embedded seccomp profile, it prevents the profile from being saved as a portable JSON file that can be used for both architectures. To work around this situation, we include conditional rules for both arches. and hard-code the value for ENOSYS in both. For more details, refer to moby#42836 (comment) and opencontainers/runtime-spec#1087 (comment) A test was added, which can be run with: go test --tags=seccomp -run TestLoadConditionalClone3 -v ./profiles/seccomp/ === RUN TestLoadConditionalClone3 === RUN TestLoadConditionalClone3/clone3_default_amd64 === RUN TestLoadConditionalClone3/clone3_default_mips === RUN TestLoadConditionalClone3/clone3_cap_sys_admin_amd64 === RUN TestLoadConditionalClone3/clone3_cap_sys_admin_mips --- PASS: TestLoadConditionalClone3 (0.01s) --- PASS: TestLoadConditionalClone3/clone3_default_amd64 (0.00s) --- PASS: TestLoadConditionalClone3/clone3_default_mips (0.00s) --- PASS: TestLoadConditionalClone3/clone3_cap_sys_admin_amd64 (0.00s) --- PASS: TestLoadConditionalClone3/clone3_cap_sys_admin_mips (0.00s) PASS ok github.com/docker/docker/profiles/seccomp 0.015s Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Loading branch information
Showing
5 changed files
with
178 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"defaultAction": "SCMP_ACT_ERRNO", | ||
"syscalls": [ | ||
{ | ||
"names": ["clone3"], | ||
"action": "SCMP_ACT_ALLOW", | ||
"includes": { | ||
"caps": ["CAP_SYS_ADMIN"] | ||
} | ||
}, | ||
{ | ||
"names": ["clone3"], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 38, | ||
"comment": "ENOSYS for clone3 on non-mips architectures", | ||
"excludes": { | ||
"caps": ["CAP_SYS_ADMIN"], | ||
"arches": ["mips3l64n32", "mips64", "mips64n32", "mipsel", "mipsel64"] | ||
} | ||
}, | ||
{ | ||
"names": ["clone3"], | ||
"action": "SCMP_ACT_ERRNO", | ||
"errnoRet": 89, | ||
"comment": "ENOSYS for clone3 on mips architectures", | ||
"includes": { | ||
"arches": ["mips3l64n32", "mips64", "mips64n32", "mipsel", "mipsel64"] | ||
}, | ||
"excludes": { | ||
"caps": ["CAP_SYS_ADMIN"] | ||
} | ||
} | ||
] | ||
} |
This file contains 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
This file contains 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