Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
examples/ | 03-May-2024 | - | 92 | 57 | ||
linux-x86/ | 03-May-2024 | - | 2,208 | 2,202 | ||
test/ | 03-May-2024 | - | 177 | 126 | ||
tools/ | 03-May-2024 | - | 3,777 | 2,978 | ||
.clang-format | D | 03-May-2024 | 181 | 8 | 7 | |
.gitignore | D | 03-May-2024 | 550 | 40 | 31 | |
Android.bp | D | 03-May-2024 | 9.3 KiB | 375 | 327 | |
CPPLINT.cfg | D | 03-May-2024 | 17 | 2 | 1 | |
CleanSpec.mk | D | 03-May-2024 | 2.2 KiB | 52 | 1 | |
HACKING.md | D | 03-May-2024 | 2.3 KiB | 76 | 53 | |
LICENSE | D | 03-May-2024 | 1.5 KiB | 29 | 28 | |
MODULE_LICENSE_BSD | D | 03-May-2024 | 0 | |||
Makefile | D | 03-May-2024 | 7.2 KiB | 237 | 145 | |
NOTICE | D | 03-May-2024 | 1.5 KiB | 28 | 27 | |
OWNERS | D | 03-May-2024 | 108 | 7 | 6 | |
PRESUBMIT.cfg | D | 03-May-2024 | 195 | 9 | 6 | |
PREUPLOAD.cfg | D | 03-May-2024 | 133 | 6 | 4 | |
README.md | D | 03-May-2024 | 2.7 KiB | 89 | 61 | |
RELEASE.md | D | 03-May-2024 | 528 | 25 | 17 | |
arch.h | D | 03-May-2024 | 2 KiB | 84 | 66 | |
bpf.c | D | 03-May-2024 | 10.2 KiB | 393 | 303 | |
bpf.h | D | 03-May-2024 | 5.9 KiB | 216 | 149 | |
common.mk | D | 03-May-2024 | 32.3 KiB | 953 | 561 | |
dump_constants.cc | D | 03-May-2024 | 1.2 KiB | 48 | 37 | |
elfparse.c | D | 03-May-2024 | 4.7 KiB | 119 | 88 | |
elfparse.h | D | 03-May-2024 | 4 KiB | 100 | 70 | |
gen_constants-inl.h | D | 03-May-2024 | 737 | 27 | 22 | |
gen_constants.c | D | 03-May-2024 | 31 | 2 | 1 | |
gen_constants.sh | D | 03-May-2024 | 1.7 KiB | 62 | 33 | |
gen_syscalls.c | D | 03-May-2024 | 24 | 2 | 1 | |
gen_syscalls.sh | D | 03-May-2024 | 1.5 KiB | 58 | 30 | |
get_googletest.sh | D | 03-May-2024 | 208 | 7 | 3 | |
libconstants.h | D | 03-May-2024 | 401 | 16 | 8 | |
libminijail-private.h | D | 03-May-2024 | 2.6 KiB | 95 | 24 | |
libminijail.c | D | 03-May-2024 | 76.8 KiB | 3,114 | 2,240 | |
libminijail.h | D | 03-May-2024 | 15.6 KiB | 423 | 121 | |
libminijail.pc.in | D | 03-May-2024 | 157 | 9 | 7 | |
libminijail_unittest.cc | D | 03-May-2024 | 23.6 KiB | 876 | 675 | |
libminijailpreload.c | D | 03-May-2024 | 4.8 KiB | 148 | 75 | |
libsyscalls.h | D | 03-May-2024 | 409 | 17 | 9 | |
minijail0.1 | D | 03-May-2024 | 14.6 KiB | 347 | 324 | |
minijail0.5 | D | 03-May-2024 | 5.9 KiB | 167 | 126 | |
minijail0.c | D | 03-May-2024 | 2 KiB | 82 | 50 | |
minijail0_cli.c | D | 03-May-2024 | 26.4 KiB | 969 | 824 | |
minijail0_cli.h | D | 03-May-2024 | 630 | 28 | 14 | |
minijail0_cli_unittest.cc | D | 03-May-2024 | 13.7 KiB | 494 | 286 | |
navbar.md | D | 03-May-2024 | 348 | 12 | 9 | |
parse_seccomp_policy.cc | D | 03-May-2024 | 2.6 KiB | 104 | 80 | |
platform2_preinstall.sh | D | 03-May-2024 | 323 | 16 | 7 | |
scoped_minijail.h | D | 03-May-2024 | 639 | 33 | 18 | |
signal_handler.c | D | 03-May-2024 | 1.6 KiB | 83 | 55 | |
signal_handler.h | D | 03-May-2024 | 346 | 15 | 4 | |
syscall_filter.c | D | 03-May-2024 | 20.8 KiB | 822 | 553 | |
syscall_filter.h | D | 03-May-2024 | 1.4 KiB | 59 | 39 | |
syscall_filter_unittest.cc | D | 03-May-2024 | 52.8 KiB | 1,861 | 1,337 | |
syscall_filter_unittest_macros.h | D | 03-May-2024 | 3 KiB | 110 | 89 | |
syscall_wrapper.c | D | 03-May-2024 | 875 | 35 | 21 | |
syscall_wrapper.h | D | 03-May-2024 | 246 | 7 | 1 | |
system.c | D | 03-May-2024 | 11.8 KiB | 467 | 292 | |
system.h | D | 03-May-2024 | 1.6 KiB | 68 | 42 | |
system_unittest.cc | D | 03-May-2024 | 11.4 KiB | 365 | 240 | |
testrunner.cc | D | 03-May-2024 | 704 | 33 | 17 | |
util.c | D | 03-May-2024 | 11.3 KiB | 465 | 330 | |
util.h | D | 03-May-2024 | 5.3 KiB | 174 | 64 | |
util_unittest.cc | D | 03-May-2024 | 2.3 KiB | 84 | 60 |
README.md
1# Minijail 2 3The Minijail homepage and main repo is 4https://android.googlesource.com/platform/external/minijail/. 5 6There might be other copies floating around, but this is the official one! 7 8[TOC] 9 10## What is it? 11 12Minijail is a sandboxing and containment tool used in Chrome OS and Android. 13It provides an executable that can be used to launch and sandbox other programs, 14and a library that can be used by code to sandbox itself. 15 16## Getting the code 17 18You're one `git clone` away from happiness. 19 20``` 21$ git clone https://android.googlesource.com/platform/external/minijail 22$ cd minijail 23``` 24 25Releases are tagged as `linux-vXX`: 26https://android.googlesource.com/platform/external/minijail/+refs 27 28## Building 29 30See the [HACKING.md](./HACKING.md) document for more details. 31 32## Release process 33 34See the [RELEASE.md](./RELEASE.md) document for more details. 35 36## Contact 37 38We've got a couple of contact points. 39 40* [minijail@chromium.org]: Public user & developer mailing list. 41* [minijail-users@google.com]: Internal Google user mailing list. 42* [minijail-dev@google.com]: Internal Google developer mailing list. 43* [crbug.com/list]: Existing bug reports & feature requests. 44* [crbug.com/new]: File new bug reports & feature requests. 45* [AOSP Gerrit]: Code reviews. 46 47[minijail@chromium.org]: https://groups.google.com/a/chromium.org/forum/#!forum/minijail 48[minijail-users@google.com]: https://groups.google.com/a/google.com/forum/#!forum/minijail-users 49[minijail-dev@google.com]: https://groups.google.com/a/google.com/forum/#!forum/minijail-dev 50[crbug.com/list]: https://crbug.com/?q=component:OS>Systems>Minijail 51[crbug.com/new]: https://bugs.chromium.org/p/chromium/issues/entry?components=OS>Systems>Minijail 52[AOSP Gerrit]: https://android-review.googlesource.com/q/project:platform/external/minijail 53 54## Talks and presentations 55 56The following talk serves as a good introduction to Minijail and how it can be used. 57 58[Video](https://drive.google.com/file/d/0BwPS_JpKyELWZTFBcTVsa1hhYjA/preview), 59[slides](https://docs.google.com/presentation/d/1r6LpvDZtYrsl7ryOV4HtpUR-phfCLRL6PA-chcL1Kno/present). 60 61## Example usage 62 63The Chromium OS project has a comprehensive 64[sandboxing](https://chromium.googlesource.com/chromiumos/docs/+/master/sandboxing.md) 65document that is largely based on Minijail. 66 67After you play with the simple examples below, you should check that out. 68 69### Change root to any user 70 71``` 72# id 73uid=0(root) gid=0(root) groups=0(root),128(pkcs11) 74# minijail0 -u jorgelo -g 5000 /usr/bin/id 75uid=72178(jorgelo) gid=5000(eng) groups=5000(eng) 76``` 77 78### Drop root while keeping some capabilities 79 80``` 81# minijail0 -u jorgelo -c 3000 -- /bin/cat /proc/self/status 82Name: cat 83... 84CapInh: 0000000000003000 85CapPrm: 0000000000003000 86CapEff: 0000000000003000 87CapBnd: 0000000000003000 88``` 89