commit | f0f2025690102d014edef1bd7977dce522f104eb | [log] [tgz] |
---|---|---|
author | Alistair Delva <[email protected]> | Mon Aug 24 13:54:16 2020 -0700 |
committer | Alistair Delva <[email protected]> | Sun Aug 21 17:46:13 2022 +0000 |
tree | a1f26c814b2477ca5757bdb3ef01c8d3e12a2b63 | |
parent | a5b3488a00dbf466ef96f65fd958aa54bd0ddaca [diff] |
Workarounds for Android host glibc toolchain When minijail is built against the Android host glibc toolchain, its syscall and ioctl coverage becomes limited by the very old Linux C headers the toolchain is using. Because crosvm jails subprocesses that can load e.g. GL libraries or FUSE which may be built with much newer glibc versions, we need support for some newer syscalls and ioctls added to Linux. Minijail will throw parse errors for any syscall or ioctl in .policy files that it doesn't understand; and anyway, it wouldn't be meaningful to strip these, as .policy files are inclusion (not exclusion) based. This change isn't very nice, but it does unblock us from running crosvm built by the Android host toolchain with sandboxing enabled. Change-Id: Iab7f2e7abac0f5e154e300833b8d91d7b8500aff (cherry picked from commit 3b58ccb3072c5908c79d65339e886b344f49c5d1)
The Minijail homepage and main repo is https://android.googlesource.com/platform/external/minijail/.
There might be other copies floating around, but this is the official one!
Minijail is a sandboxing and containment tool used in Chrome OS and Android. It provides an executable that can be used to launch and sandbox other programs, and a library that can be used by code to sandbox itself.
You're one git clone
away from happiness.
$ git clone https://android.googlesource.com/platform/external/minijail $ cd minijail
Releases are tagged as linux-vXX
: https://android.googlesource.com/platform/external/minijail/+refs
See the HACKING.md document for more details.
See the RELEASE.md document for more details.
See the tools/README.md document for more details.
We've got a couple of contact points.
The following talk serves as a good introduction to Minijail and how it can be used.
The Chromium OS project has a comprehensive sandboxing document that is largely based on Minijail.
After you play with the simple examples below, you should check that out.
# id uid=0(root) gid=0(root) groups=0(root),128(pkcs11) # minijail0 -u jorgelo -g 5000 /usr/bin/id uid=72178(jorgelo) gid=5000(eng) groups=5000(eng)
# minijail0 -u jorgelo -c 3000 -- /bin/cat /proc/self/status Name: cat ... CapInh: 0000000000003000 CapPrm: 0000000000003000 CapEff: 0000000000003000 CapBnd: 0000000000003000