|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| .github/ | | 03-May-2024 | - | 47 | 31 |
| examples/ | | 03-May-2024 | - | 94 | 59 |
| linux-x86/ | | 03-May-2024 | - | 6,644 | 6,637 |
| rust/ | | 03-May-2024 | - | 1,653 | 1,366 |
| test/ | | 03-May-2024 | - | 177 | 126 |
| tools/ | | 03-May-2024 | - | 4,412 | 3,434 |
| .clang-format | D | 03-May-2024 | 181 | 8 | 7 |
| .gitignore | D | 03-May-2024 | 701 | 52 | 39 |
| Android.bp | D | 03-May-2024 | 14.2 KiB | 563 | 506 |
| 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.9 KiB | 87 | 62 |
| LICENSE | D | 03-May-2024 | 1.5 KiB | 29 | 28 |
| METADATA | D | 03-May-2024 | 39 | 4 | 3 |
| MODULE_LICENSE_BSD | D | 03-May-2024 | 0 | | |
| Makefile | D | 03-May-2024 | 7.8 KiB | 249 | 153 |
| NOTICE | D | 03-May-2024 | 1.5 KiB | 28 | 27 |
| OWNERS | D | 03-May-2024 | 88 | 6 | 5 |
| PRESUBMIT.cfg | D | 03-May-2024 | 195 | 9 | 6 |
| PREUPLOAD.cfg | D | 03-May-2024 | 133 | 6 | 4 |
| README.md | D | 03-May-2024 | 3.8 KiB | 117 | 80 |
| RELEASE.md | D | 03-May-2024 | 530 | 25 | 17 |
| TEST_MAPPING | D | 03-May-2024 | 245 | 17 | 16 |
| arch.h | D | 03-May-2024 | 2.4 KiB | 87 | 68 |
| bpf.c | D | 03-May-2024 | 10.2 KiB | 398 | 307 |
| bpf.h | D | 03-May-2024 | 6.4 KiB | 227 | 156 |
| common.mk | D | 03-May-2024 | 32.3 KiB | 953 | 561 |
| dump_constants.cc | D | 03-May-2024 | 1.5 KiB | 51 | 38 |
| 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 | 2.3 KiB | 76 | 54 |
| gen_constants.c | D | 03-May-2024 | 31 | 2 | 1 |
| gen_constants.sh | D | 03-May-2024 | 1.7 KiB | 62 | 33 |
| gen_syscalls-inl.h | D | 03-May-2024 | 1.7 KiB | 76 | 55 |
| gen_syscalls.c | D | 03-May-2024 | 24 | 2 | 1 |
| gen_syscalls.sh | D | 03-May-2024 | 1.6 KiB | 61 | 32 |
| get_googletest.sh | D | 03-May-2024 | 209 | 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 | 87.3 KiB | 3,477 | 2,493 |
| libminijail.h | D | 03-May-2024 | 19 KiB | 511 | 137 |
| libminijail.pc.in | D | 03-May-2024 | 157 | 9 | 7 |
| libminijail_unittest.cc | D | 03-May-2024 | 35.2 KiB | 1,253 | 937 |
| libminijailpreload.c | D | 03-May-2024 | 4.8 KiB | 149 | 76 |
| libsyscalls.h | D | 03-May-2024 | 448 | 18 | 10 |
| minijail0.1 | D | 03-May-2024 | 16.4 KiB | 386 | 357 |
| minijail0.5 | D | 03-May-2024 | 5.9 KiB | 167 | 126 |
| minijail0.c | D | 03-May-2024 | 2 KiB | 82 | 50 |
| minijail0.sh | D | 03-May-2024 | 332 | 10 | 2 |
| minijail0_cli.c | D | 03-May-2024 | 30.8 KiB | 1,108 | 903 |
| minijail0_cli.h | D | 03-May-2024 | 630 | 28 | 14 |
| minijail0_cli_unittest.cc | D | 03-May-2024 | 14.8 KiB | 529 | 309 |
| navbar.md | D | 03-May-2024 | 348 | 12 | 9 |
| parse_seccomp_policy.cc | D | 03-May-2024 | 2.8 KiB | 111 | 86 |
| platform2_preinstall.sh | D | 03-May-2024 | 323 | 16 | 7 |
| scoped_minijail.h | D | 03-May-2024 | 639 | 33 | 18 |
| setup.py | D | 03-May-2024 | 1.8 KiB | 52 | 31 |
| 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 | 24.8 KiB | 971 | 677 |
| syscall_filter.h | D | 03-May-2024 | 1.9 KiB | 87 | 62 |
| syscall_filter_unittest.cc | D | 03-May-2024 | 58.9 KiB | 2,064 | 1,471 |
| syscall_filter_unittest_macros.h | D | 03-May-2024 | 3.6 KiB | 126 | 101 |
| syscall_wrapper.c | D | 03-May-2024 | 875 | 35 | 21 |
| syscall_wrapper.h | D | 03-May-2024 | 991 | 45 | 28 |
| system.c | D | 03-May-2024 | 14 KiB | 546 | 342 |
| system.h | D | 03-May-2024 | 1.6 KiB | 69 | 43 |
| system_unittest.cc | D | 03-May-2024 | 10.5 KiB | 334 | 220 |
| testrunner.cc | D | 03-May-2024 | 704 | 33 | 17 |
| util.c | D | 03-May-2024 | 12.9 KiB | 559 | 403 |
| util.h | D | 03-May-2024 | 7.6 KiB | 250 | 92 |
| util_unittest.cc | D | 03-May-2024 | 10.3 KiB | 361 | 275 |
README.md
1# Minijail
2
3The Minijail homepage is
4https://google.github.io/minijail/.
5
6The main source repo is
7https://android.googlesource.com/platform/external/minijail/.
8
9There might be other copies floating around, but this is the official one!
10
11[TOC]
12
13## What is it?
14
15Minijail is a sandboxing and containment tool used in Chrome OS and Android.
16It provides an executable that can be used to launch and sandbox other programs,
17and a library that can be used by code to sandbox itself.
18
19## Getting the code
20
21You're one `git clone` away from happiness.
22
23```
24$ git clone https://android.googlesource.com/platform/external/minijail
25$ cd minijail
26```
27
28Releases are tagged as `linux-vXX`:
29https://android.googlesource.com/platform/external/minijail/+refs
30
31## Building
32
33See the [HACKING.md](./HACKING.md) document for more details.
34
35## Release process
36
37See the [RELEASE.md](./RELEASE.md) document for more details.
38
39## Additional tools
40
41See the [tools/README.md](./tools/README.md) document for more details.
42
43## Contact
44
45We've got a couple of contact points.
46
47* [minijail@chromium.org]: Public user & developer mailing list.
48* [minijail-users@google.com]: Internal Google user mailing list.
49* [minijail-dev@google.com]: Internal Google developer mailing list.
50* [crbug.com/list]: Existing bug reports & feature requests.
51* [crbug.com/new]: File new bug reports & feature requests.
52* [AOSP Gerrit]: Code reviews.
53
54[minijail@chromium.org]: https://groups.google.com/a/chromium.org/forum/#!forum/minijail
55[minijail-users@google.com]: https://groups.google.com/a/google.com/forum/#!forum/minijail-users
56[minijail-dev@google.com]: https://groups.google.com/a/google.com/forum/#!forum/minijail-dev
57[crbug.com/list]: https://crbug.com/?q=component:OS>Systems>Minijail
58[crbug.com/new]: https://bugs.chromium.org/p/chromium/issues/entry?components=OS>Systems>Minijail
59[AOSP Gerrit]: https://android-review.googlesource.com/q/project:platform/external/minijail
60
61## Talks and presentations
62
63The following talk serves as a good introduction to Minijail and how it can be used.
64
65[Video](https://drive.google.com/file/d/0BwPS_JpKyELWZTFBcTVsa1hhYjA/preview),
66[slides](https://docs.google.com/presentation/d/e/2PACX-1vRBqpin5xR9sng6lIBPjG0XQtu-uWWgr0ds-M3zW13XpDO-bTcMERLwoHUEB9078p1yqr9L-su9n5dk/pub).
67
68## Example usage
69
70The Chromium OS project has a comprehensive
71[sandboxing](https://chromium.googlesource.com/chromiumos/docs/+/master/sandboxing.md)
72document that is largely based on Minijail.
73
74After you play with the simple examples below, you should check that out.
75
76### Change root to any user
77
78```
79# id
80uid=0(root) gid=0(root) groups=0(root),128(pkcs11)
81# minijail0 -u jorgelo -g 5000 /usr/bin/id
82uid=72178(jorgelo) gid=5000(eng) groups=5000(eng)
83```
84
85### Drop root while keeping some capabilities
86
87```
88# minijail0 -u jorgelo -c 3000 -- /bin/cat /proc/self/status
89Name: cat
90...
91CapInh: 0000000000003000
92CapPrm: 0000000000003000
93CapEff: 0000000000003000
94CapBnd: 0000000000003000
95```
96
97## Historical notes
98
99Q. "Why is it called minijail0?"
100
101A. It is minijail0 because it was a rewrite of an earlier program named
102minijail, which was considerably less mini, and in particular had a dependency
103on libchrome (the Chrome OS packaged version of Chromium's //base). We needed a
104new name to not collide with the deprecated one.
105
106We didn't want to call it minijail2 or something that would make people
107start using it before we were ready, and it was also concretely _less_ since it
108dropped libbase, etc. Technically, we needed to be able to fork/preload with
109minimal extra syscall noise which was too hard with libbase at the time (onexit
110handlers, etc that called syscalls we didn't want to allow). Also, Elly made a
111strong case that C would be the right choice for this for linking and ease of
112controlled surprise system call use.
113
114https://crrev.com/c/4585/ added the original implementation.
115
116Source: Conversations with original authors, ellyjones@ and wad@.
117