vhost_user_fs: Implement support for optional sandboxing

Implement support for setting up a sandbox for running the
service. The technique for this has been borrowed from virtiofsd, and
consists on switching to new PID, mount and network namespaces, and
then switching root to the directory to be shared.

Future patches will implement additional hardening features like
dropping capabilities and seccomp filters.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez
2020-04-24 13:43:36 +02:00
committed by Sebastien Boeuf
parent c4bf383fd7
commit 6aab0a5458
5 changed files with 323 additions and 4 deletions

1
Cargo.lock generated
View File

@@ -1414,6 +1414,7 @@ dependencies = [
"bitflags 1.2.1",
"libc",
"log 0.4.8",
"tempdir",
"vhost",
"vm-memory",
"vm-virtio",