]> git.ipfire.org Git - thirdparty/systemd.git/commit
virt: Detect proot virtualisation by ptrace metadata
authorChris Down <chris@chrisdown.name>
Tue, 14 Apr 2020 17:15:04 +0000 (18:15 +0100)
committerChris Down <chris@chrisdown.name>
Wed, 15 Apr 2020 17:36:35 +0000 (18:36 +0100)
commit80cc3e3eabd2cf4e31ae3f0d6e2ac7b61d0a1832
tree4382f7656e7d6d5b2f894406291207ef0d938eb5
parent6ab2e1178e1d98070a2574cea45cb4c0a089f9c0
virt: Detect proot virtualisation by ptrace metadata

proot provides userspace-powered emulation of chroot and mount --bind,
lending it to be used on environments without unprivileged user
namespaces, or in otherwise restricted environments like Android.

In order to achieve this, proot makes use of the kernel's ptrace()
facility, which we can use in order to detect its presence. Since it
doesn't use any kind of namespacing, including PID namespacing, we don't
need to do any tricks when trying to get the tracer's metadata.

For our purposes, proot is listed as a "container", since we mostly use
this also as the bucket for non-container-but-container-like
technologies like WSL. As such, it seems like a good fit for this
section as well.
man/systemd-detect-virt.xml
man/systemd.unit.xml
src/basic/virt.c
src/basic/virt.h