Skip to content

Commit

Permalink
Merge pull request #1041 from giuseppe/seccomp-errno
Browse files Browse the repository at this point in the history
seccomp: allow to override errno return code
  • Loading branch information
vbatts authored May 11, 2020
2 parents 2a06026 + 3bfcde2 commit 2086147
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ The following parameters can be specified to set up seccomp:
* `SCMP_ACT_ALLOW`
* `SCMP_ACT_LOG`

* **`errnoRet`** *(uint, OPTIONAL)* - the errno return code to use.
Some actions like `SCMP_ACT_ERRNO` and `SCMP_ACT_TRACE` allow to specify the errno
code to return. If not specified its default value is `EPERM`.

* **`args`** *(array of objects, OPTIONAL)* - the specific syscall in seccomp.
Each entry has the following structure:

Expand Down
3 changes: 3 additions & 0 deletions schema/defs-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
"action": {
"$ref": "#/definitions/SeccompAction"
},
"errnoRet": {
"$ref": "defs.json#/definitions/uint32"
},
"args": {
"type": "array",
"items": {
Expand Down
7 changes: 4 additions & 3 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,10 @@ type LinuxSeccompArg struct {

// LinuxSyscall is used to match a syscall in Seccomp
type LinuxSyscall struct {
Names []string `json:"names"`
Action LinuxSeccompAction `json:"action"`
Args []LinuxSeccompArg `json:"args,omitempty"`
Names []string `json:"names"`
Action LinuxSeccompAction `json:"action"`
ErrnoRet uint `json:"errno"`
Args []LinuxSeccompArg `json:"args,omitempty"`
}

// LinuxIntelRdt has container runtime resource constraints for Intel RDT
Expand Down

0 comments on commit 2086147

Please sign in to comment.