diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-04-19 11:04:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-14 17:44:20 +0200 |
commit | ee8f26180d01e3ddd4e5f20b03b81e5e737657ae (patch) | |
tree | a83771863a9671686e41abb7d4dd3828b5cece5f /units/systemd-networkd.service.in | |
parent | seccomp: explain why we use setuid rather than @setuid in @privileged (diff) | |
download | systemd-ee8f26180d01e3ddd4e5f20b03b81e5e737657ae.tar.xz systemd-ee8f26180d01e3ddd4e5f20b03b81e5e737657ae.zip |
units: switch from system call blacklist to whitelist
This is generally the safer approach, and is what container managers
(including nspawn) do, hence let's move to this too for our own
services. This is particularly useful as this this means the new
@system-service system call filter group will get serious real-life
testing quickly.
This also switches from firing SIGSYS on unexpected syscalls to
returning EPERM. This would have probably been a better default anyway,
but it's hard to change that these days. When whitelisting system calls
SIGSYS is highly problematic as system calls that are newly introduced
to Linux become minefields for services otherwise.
Note that this enables a system call filter for udev for the first time,
and will block @clock, @mount and @swap from it. Some downstream
distributions might want to revert this locally if they want to permit
unsafe operations on udev rules, but in general this shiuld be mostly
safe, as we already set MountFlags=shared for udevd, hence at least
@mount won't change anything.
Diffstat (limited to 'units/systemd-networkd.service.in')
-rw-r--r-- | units/systemd-networkd.service.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/units/systemd-networkd.service.in b/units/systemd-networkd.service.in index adb219a01d..371ab3a9cf 100644 --- a/units/systemd-networkd.service.in +++ b/units/systemd-networkd.service.in @@ -35,7 +35,8 @@ MemoryDenyWriteExecute=yes RestrictRealtime=yes RestrictNamespaces=yes RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 AF_PACKET -SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @reboot @swap +SystemCallFilter=@system-service +SystemCallErrorNumber=EPERM SystemCallArchitectures=native LockPersonality=yes RuntimeDirectory=systemd/netif |