Skip to content

Commit 5087435

Browse files
committed
Add Architecture field to Seccomp configuration in Linux runtime
By default, Seccomp filters will only permit syscalls to be made using the native architecture of the kernel. This is fine for most use cases, but breaks others (such as running 32-bit code in a container on a host with a 64-bit kernel). This patch adds a field to specify additional architectures which may make syscalls. Signed-off-by: Matthew Heon <[email protected]>
1 parent 96bcd04 commit 5087435

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

runtime-config-linux.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,14 @@ For more information about Apparmor, see [Apparmor documentation](https://wiki.u
319319
Seccomp provides application sandboxing mechanism in the Linux kernel.
320320
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls.
321321
For more information about Seccomp, see [Seccomp kernel documentation](https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt)
322-
The actions and operators are strings that match the definitions in seccomp.h from [libseccomp](https://github.com/seccomp/libseccomp) and are translated to corresponding values.
322+
The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp](https://github.com/seccomp/libseccomp) and are translated to corresponding values.
323323

324324
```json
325325
"seccomp": {
326326
"defaultAction": "SCMP_ACT_ALLOW",
327+
"architectures": [
328+
"SCMP_ARCH_X86"
329+
],
327330
"syscalls": [
328331
{
329332
"name": "getcwd",

runtime_config_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,14 @@ type Device struct {
235235
// Seccomp represents syscall restrictions
236236
type Seccomp struct {
237237
DefaultAction Action `json:"defaultAction"`
238+
Architectures []Arch `json:"architectures"`
238239
Syscalls []*Syscall `json:"syscalls"`
239240
}
240241

242+
// Additional architectures permitted to be used for system calls
243+
// By default only the native architecture of the kernel is permitted
244+
type Arch string
245+
241246
// Action taken upon Seccomp rule match
242247
type Action string
243248

0 commit comments

Comments
 (0)