nspawn: replace syscall blacklist by a whitelist
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Sep 2017 08:18:57 +0000 (10:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 14 Sep 2017 13:45:21 +0000 (15:45 +0200)
commit96bedbe2e5301fe0e93993de0e9a31baf2679168
tree09abce13c62fd1713fa22d60d0fb879b683f1496
parentcff7bff880b62faa8ee17edb0503449e639a2630
nspawn: replace syscall blacklist by a whitelist

Let's lock things down a bit, and maintain a list of what's permitted
rather than a list of what's prohibited in nspawn (also to make things a
bit more like Docker and friends).

Note that this slightly alters the effect of --system-call-filter=, as
now the negative list now takes precedence over the positive list.
However, given that the option is just a few days old and not included
in any released version it should be fine to change it at this point in
time.

Note that the whitelist is good chunk more restrictive thatn the
previous blacklist. Specifically:

- fanotify is not permitted (given the buffer size issues it's
  problematic in containers)
- nfsservctl is not permitted (NFS server support is not virtualized)
- pkey_xyz stuff is not permitted (really new stuff I don't grok)
- @cpu-emulation is prohibited (untested legacy stuff mostly, and if
  people really want to run dosemu in nspawn, they should use
  --system-call-filter=@cpu-emulation and all should be good)
man/systemd-nspawn.xml
src/nspawn/nspawn-seccomp.c