-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: Add DisableSpeculationMitigations #1047
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,6 +208,23 @@ 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]. | ||
* **`disableSpeculationMitigations`** (object, OPTIONAL) specifies whether CPU speculative execution mitigations should be disabled for the process. Several mitigations are auto-enabled under Linux, and can cause a noticeable performance impact (depending on your workload). Note that enabling this option may reduce the security properties of containers created with this configuration. See [the kernel documentation][speculative-control] for more information. | ||
* **`defaultRule`** *(string, REQUIRED)* sets up the default rule to enable or disable the mitigations. | ||
* `enable` - The mitigation of speculations without `exceptions` is disabled. | ||
* `disable` - The mitigation of speculations without `exceptions` is enabled. | ||
* `force-disable` - Same as disable, but it cannot be undone. | ||
* `disable-noexec` - Same as disable, but the state will be cleared on execve(2). | ||
* **`exceptions`** *(array of objects, OPTIONAL)* - the configuration of specific mitigations. | ||
Each entry has the following structure: | ||
* **`mitigation`** *(string, REQUIRED)* - the name of specific mitigation. | ||
A valid list of mitigations. | ||
* `store-bypass` - Speculative Store Bypass | ||
* `indirect-branch` - Indirect Branch Speculation in User Processes | ||
* **`rule`** *(string, REQUIRED)* - enables or disables the specific mitigation. | ||
* `enable` - The mitigation of this particular speculation is disabled. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the |
||
* `disable` - The mitigation of this particular speculation is enabled. | ||
* `force-disable` - Same as disable, but it cannot be undone. | ||
* `disable-noexec` - Same as disable, but the state will be cleared on execve(2). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
### <a name="configUser" />User | ||
|
||
|
@@ -973,3 +990,4 @@ Here is a full example `config.json` for reference. | |
[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html | ||
[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html | ||
[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html | ||
[speculative-control]: https://www.kernel.org/doc/html/latest/userspace-api/spec_ctrl.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"` | ||
// DisableSpeculationMitigations disables speculative execution mitigations | ||
DisableSpeculationMitigations *LinuxDisableSpeculationMitigations `json:"disableSpeculationMitigations,omitempty" platform:"linux"` | ||
} | ||
|
||
// LinuxCapabilities specifies the whitelist of capabilities that are kept for a process. | ||
|
@@ -75,6 +77,18 @@ type LinuxCapabilities struct { | |
Ambient []string `json:"ambient,omitempty" platform:"linux"` | ||
} | ||
|
||
// LinuxDisableSpeculationMitigations sets up the rule of speculative execution mitigations. | ||
type LinuxDisableSpeculationMitigations struct { | ||
DefaultRule string `json:"defaultRule"` | ||
Exceptions []SpecExceptions `json:"exceptions,omitempty"` | ||
} | ||
|
||
// SpecExceptions is used to specify the setting of speculative execution mitigations. | ||
type SpecExceptions struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Mitigation string `json:"mitigation"` | ||
Rule string `json:"rule"` | ||
} | ||
|
||
// Box specifies dimensions of a rectangle. Used for specifying the size of a console. | ||
type Box struct { | ||
// Height is the vertical dimension of a box. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any possibility that we need multiple exceptions with the same
mitigation
type? If not, what about using dedicate structs with rules forstore-bypass
andindirect-branch
?