Skip to content

Commit

Permalink
config: Add AllowSpeculation
Browse files Browse the repository at this point in the history
AllowSpeculation disables spectre mitigations for container.
For more information about that, please refer to:
opencontainers/runc#2430

Signed-off-by: Kenta Tada <[email protected]>
  • Loading branch information
Kenta Tada authored and Kenta Tada committed May 28, 2020
1 parent 44341cd commit b24d646
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ For Linux-based systems, the `process` object supports the following process-spe
For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2].
* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process.
For more information about SELinux, see [SELinux documentation][selinux].
* **`allowSpeculation`** (bool, OPTIONAL) setting `allowSpeculation` to true disable spectre mitigations to improve the performance.

### <a name="configUser" />User

Expand Down
3 changes: 3 additions & 0 deletions schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
}
}
}
},
"allowSpeculation": {
"type": "boolean"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion schema/test/config/good/spec-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
],
"apparmorProfile": "acme_secure_profile",
"selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675",
"noNewPrivileges": true
"noNewPrivileges": true,
"allowSpeculation": false
},
"root": {
"path": "rootfs",
Expand Down
2 changes: 2 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ type Process struct {
OOMScoreAdj *int `json:"oomScoreAdj,omitempty" platform:"linux"`
// SelinuxLabel specifies the selinux context that the container process is run as.
SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"`
// AllowSpeculation disables spectre mitigations
AllowSpeculation bool `json:"allowSpeculation,omitempty" platform:"linux"`
}

// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process.
Expand Down

0 comments on commit b24d646

Please sign in to comment.