Skip to content

Commit 68f17f5

Browse files
authored
Merge pull request #1012 from justincormack/personality
Add Linux personality support
2 parents 8b180f3 + 5cc25d0 commit 68f17f5

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

config-linux.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,23 @@ The following parameters can be specified to set up seccomp:
702702
"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811"
703703
```
704704

705+
## <a name="configLinuxPersonality" />Personality
706+
707+
**`personality`** (object, OPTIONAL) sets the Linux execution personality. For more information
708+
see the [personality](personality.2) syscall documentation. As most of the options are
709+
obsolete and rarely used, and some reduce security, the currently supported set is a small
710+
subset of the available options.
711+
712+
* **`domain`** *(string, REQUIRED)* - the execution domain.
713+
The valid list of constants is shown below. `LINUX32` will set the `uname` system call to show
714+
a 32 bit CPU type, such as `i686`.
715+
716+
* `LINUX`
717+
* `LINUX32`
718+
719+
* **`flags`** *(array of strings, OPTIONAL)* - the additional flags to apply.
720+
Currently no flag values are supported.
721+
705722

706723
[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
707724
[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt
@@ -729,6 +746,7 @@ The following parameters can be specified to set up seccomp:
729746
[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html
730747
[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html
731748
[null.4]: http://man7.org/linux/man-pages/man4/null.4.html
749+
[personality.2]: http://man7.org/linux/man-pages/man2/personality.2.html
732750
[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html
733751
[random.4]: http://man7.org/linux/man-pages/man4/random.4.html
734752
[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html

specs-go/config.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ type Linux struct {
167167
// IntelRdt contains Intel Resource Director Technology (RDT) information for
168168
// handling resource constraints (e.g., L3 cache, memory bandwidth) for the container
169169
IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"`
170+
// Personality contains configuration for the Linux personality syscall
171+
Personality *LinuxPersonality `json:"personality,omitempty"`
170172
}
171173

172174
// LinuxNamespace is the configuration for a Linux namespace
@@ -391,6 +393,28 @@ type LinuxDeviceCgroup struct {
391393
Access string `json:"access,omitempty"`
392394
}
393395

396+
// LinuxPersonalityDomain refers to a personality domain.
397+
type LinuxPersonalityDomain string
398+
399+
// LinuxPersonalityFlag refers to an additional personality flag. None are currently defined.
400+
type LinuxPersonalityFlag string
401+
402+
// Define domain and flags for Personality
403+
const (
404+
// PerLinux is the standard Linux personality
405+
PerLinux LinuxPersonalityDomain = "LINUX"
406+
// PerLinux32 sets personality to 32 bit
407+
PerLinux32 LinuxPersonalityDomain = "LINUX32"
408+
)
409+
410+
// LinuxPersonality represents the Linux personality syscall input
411+
type LinuxPersonality struct {
412+
// Domain for the personality
413+
Domain LinuxPersonalityDomain `json:"domain"`
414+
// Additional flags
415+
Flags []LinuxPersonalityFlag `json:"flags,omitempty"`
416+
}
417+
394418
// Solaris contains platform-specific configuration for Solaris application containers.
395419
type Solaris struct {
396420
// SMF FMRI which should go "online" before we start the container process.

0 commit comments

Comments
 (0)