Skip to content

Commit 5338e05

Browse files
Kenta TadaKenta Tada
Kenta Tada
authored and
Kenta Tada
committed
Add the specification of seccomp userspace notification
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
1 parent 2a06026 commit 5338e05

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

config-linux.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ The following parameters can be specified to set up seccomp:
598598
* `SECCOMP_FILTER_FLAG_TSYNC`
599599
* `SECCOMP_FILTER_FLAG_LOG`
600600
* `SECCOMP_FILTER_FLAG_SPEC_ALLOW`
601+
* `SECCOMP_FILTER_FLAG_NEW_LISTENER`
602+
603+
* **`listenerPath`** *(string, OPTIONAL)* - specifies the path of UNIX domain socket which the runtime will pass the file descriptor of seccomp notification using SCM_RIGHT to.
601604

602605
* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp.
603606
While this property is OPTIONAL, some values of `defaultAction` are not useful without `syscalls` entries.
@@ -607,14 +610,15 @@ The following parameters can be specified to set up seccomp:
607610
* **`names`** *(array of strings, REQUIRED)* - the names of the syscalls.
608611
`names` MUST contain at least one entry.
609612
* **`action`** *(string, REQUIRED)* - the action for seccomp rules.
610-
A valid list of constants as of libseccomp v2.4.0 is shown below.
613+
A valid list of constants is shown below.
611614

612615
* `SCMP_ACT_KILL`
613616
* `SCMP_ACT_TRAP`
614617
* `SCMP_ACT_ERRNO`
615618
* `SCMP_ACT_TRACE`
616619
* `SCMP_ACT_ALLOW`
617620
* `SCMP_ACT_LOG`
621+
* `SCMP_ACT_NOTIFY`
618622

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

schema/config-linux.json

+3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@
206206
"$ref": "defs-linux.json#/definitions/SeccompFlag"
207207
}
208208
},
209+
"listenerPath": {
210+
"type": "string"
211+
},
209212
"architectures": {
210213
"type": "array",
211214
"items": {

schema/defs-linux.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@
5858
"SCMP_ACT_ERRNO",
5959
"SCMP_ACT_TRACE",
6060
"SCMP_ACT_ALLOW",
61-
"SCMP_ACT_LOG"
61+
"SCMP_ACT_LOG",
62+
"SCMP_ACT_NOTIFY"
6263
]
6364
},
6465
"SeccompFlag": {
6566
"type": "string",
6667
"enum": [
6768
"SECCOMP_FILTER_FLAG_TSYNC",
6869
"SECCOMP_FILTER_FLAG_LOG",
69-
"SECCOMP_FILTER_FLAG_SPEC_ALLOW"
70+
"SECCOMP_FILTER_FLAG_SPEC_ALLOW",
71+
"SECCOMP_FILTER_FLAG_NEW_LISTENER"
7072
]
7173
},
7274
"SeccompOperators": {

specs-go/config.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ type LinuxSeccomp struct {
598598
DefaultAction LinuxSeccompAction `json:"defaultAction"`
599599
Architectures []Arch `json:"architectures,omitempty"`
600600
Flags []LinuxSeccompFlag `json:"flags,omitempty"`
601+
ListenerPath string `json:"listenerPath,omitempty"`
601602
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
602603
}
603604

@@ -635,12 +636,13 @@ type LinuxSeccompAction string
635636

636637
// Define actions for Seccomp rules
637638
const (
638-
ActKill LinuxSeccompAction = "SCMP_ACT_KILL"
639-
ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP"
640-
ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO"
641-
ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE"
642-
ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW"
643-
ActLog LinuxSeccompAction = "SCMP_ACT_LOG"
639+
ActKill LinuxSeccompAction = "SCMP_ACT_KILL"
640+
ActTrap LinuxSeccompAction = "SCMP_ACT_TRAP"
641+
ActErrno LinuxSeccompAction = "SCMP_ACT_ERRNO"
642+
ActTrace LinuxSeccompAction = "SCMP_ACT_TRACE"
643+
ActAllow LinuxSeccompAction = "SCMP_ACT_ALLOW"
644+
ActLog LinuxSeccompAction = "SCMP_ACT_LOG"
645+
ActNotify LinuxSeccompAction = "SCMP_ACT_NOTIFY"
644646
)
645647

646648
// LinuxSeccompOperator used to match syscall arguments in Seccomp

0 commit comments

Comments
 (0)