Skip to content

Commit 2086147

Browse files
authored
Merge pull request #1041 from giuseppe/seccomp-errno
seccomp: allow to override errno return code
2 parents 2a06026 + 3bfcde2 commit 2086147

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

config-linux.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,10 @@ The following parameters can be specified to set up seccomp:
616616
* `SCMP_ACT_ALLOW`
617617
* `SCMP_ACT_LOG`
618618

619+
* **`errnoRet`** *(uint, OPTIONAL)* - the errno return code to use.
620+
Some actions like `SCMP_ACT_ERRNO` and `SCMP_ACT_TRACE` allow to specify the errno
621+
code to return. If not specified its default value is `EPERM`.
622+
619623
* **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp.
620624
Each entry has the following structure:
621625

schema/defs-linux.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
"action": {
117117
"$ref": "#/definitions/SeccompAction"
118118
},
119+
"errnoRet": {
120+
"$ref": "defs.json#/definitions/uint32"
121+
},
119122
"args": {
120123
"type": "array",
121124
"items": {

specs-go/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,10 @@ type LinuxSeccompArg struct {
667667

668668
// LinuxSyscall is used to match a syscall in Seccomp
669669
type LinuxSyscall struct {
670-
Names []string `json:"names"`
671-
Action LinuxSeccompAction `json:"action"`
672-
Args []LinuxSeccompArg `json:"args,omitempty"`
670+
Names []string `json:"names"`
671+
Action LinuxSeccompAction `json:"action"`
672+
ErrnoRet uint `json:"errno"`
673+
Args []LinuxSeccompArg `json:"args,omitempty"`
673674
}
674675

675676
// LinuxIntelRdt has container runtime resource constraints for Intel RDT

0 commit comments

Comments
 (0)