Skip to content

Commit a3645cc

Browse files
jcowgillmartinpitt
authored andcommitted
seccomp: add clone syscall definitions for mips (systemd#5880)
Also updates the documentation and adds a mention of ppc64 support which was enabled by systemd#5325. Tested on Debian mipsel and mips64el. The other 4 mips architectures should have an identical user <-> kernel ABI to one of the 2 tested systems.
1 parent 8251ee1 commit a3645cc

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

man/systemd.exec.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,8 @@
15971597
the specified flags parameters into account. Note that — if this option is used — in addition to restricting
15981598
creation and switching of the specified types of namespaces (or all of them, if true) access to the
15991599
<function>setns()</function> system call with a zero flags parameter is prohibited. This setting is only
1600-
supported on x86, x86-64, s390 and s390x, and enforces no restrictions on other architectures. If running in user
1600+
supported on x86, x86-64, mips, mips-le, mips64, mips64-le, mips64-n32, mips64-le-n32, ppc64, ppc64-le,
1601+
s390 and s390x, and enforces no restrictions on other architectures. If running in user
16011602
mode, or in system mode, but without the <constant>CAP_SYS_ADMIN</constant> capability (e.g. setting
16021603
<varname>User=</varname>), <varname>NoNewPrivileges=yes</varname> is implied. </para></listitem>
16031604
</varlistentry>

src/shared/seccomp-util.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,12 @@ int seccomp_restrict_namespaces(unsigned long retain) {
804804
case SCMP_ARCH_X32:
805805
case SCMP_ARCH_PPC64:
806806
case SCMP_ARCH_PPC64LE:
807+
case SCMP_ARCH_MIPS:
808+
case SCMP_ARCH_MIPSEL:
809+
case SCMP_ARCH_MIPS64:
810+
case SCMP_ARCH_MIPSEL64:
811+
case SCMP_ARCH_MIPS64N32:
812+
case SCMP_ARCH_MIPSEL64N32:
807813
clone_reversed_order = 0;
808814
break;
809815

src/shared/seccomp-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int seccomp_memory_deny_write_execute(void);
9292
#endif
9393

9494
/* we don't know the right order of the clone() parameters except for these archs, for now */
95-
#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) || defined(__s390__) || defined(__powerpc64__)
95+
#if defined(__x86_64__) || defined(__i386__) || defined(__s390x__) || defined(__s390__) || defined(__powerpc64__) || defined(__mips__)
9696
#define SECCOMP_RESTRICT_NAMESPACES_BROKEN 0
9797
#else
9898
#define SECCOMP_RESTRICT_NAMESPACES_BROKEN 1

0 commit comments

Comments
 (0)