commit | 677900fb3a5fcde716e0a07e15365acc46d7356f | [log] [tgz] |
---|---|---|
author | Luis Hector Chavez <lhchavez@google.com> | Mon Sep 24 09:13:26 2018 -0700 |
committer | Luis Hector Chavez <lhchavez@google.com> | Mon Sep 24 12:08:00 2018 -0700 |
tree | f2247050ff5efef914d2f979a839adb1b783d122 | |
parent | dabc4301f7432c852eec7b5ce0e1ab1af7c4016f [diff] |
minijail: Handle cap_get_flag(3) failing with EINVAL This change adds handling EINVAL on cap_get_flag(3). This is because libcap rejects setting / getting any capabilities that it wasn't compiled with, despite there being some wording on libcap(3)'s cap_from_text(3) manpage that would lead the readers to think that the library would allow doing so. Bug: None Test: # ./minijail0 -T static --ambient \ -c 'cap_dac_read_search,cap_dac_override+e' -- \ /bin/true # On Chrome OS. Change-Id: Iea9b6737b208a201868731d44724eb1caa165fc5
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.
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