History log of /external/minijail/minijail0.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e7a5908f5200e84259686fba8dc82fec9ac8f4f7 27-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "Compile 'minijail0' on Brillo/Android."
2b12ba490431f312099163c476d30fb39e9428d7 26-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Print an error when attempting to use bind mounts without chroot.

Bind mounts should be used with chroot or pivot_root. Print an error
and exit when that's not the case.

Clean up some comments and error messages while in there.

Bug: 26784268
Change-Id: I4e384a989e1aef5b2989c4f17e047a9ac7cadbc8
/external/minijail/minijail0.c
d99a40d2176032b783716007ff49ebdcbdfcb4fa 26-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Compile 'minijail0' on Brillo/Android.

We're not currently using the 'minijail0' executable on Brillo or
Android, but given that upstream Minijail is in AOSP, it's useful to
be able to build all Minijail targets in a Brillo or Android checkout.
Make it an "optional" target so that it doesn't get included on regular
builds.

This requires fixing one case of assigning 'const char*' to 'char*',
setting an invalid PRELOADPATH variable, and disabling
'missing-field-initializers' warnings.

Bug: 26798535
Change-Id: I1fe61f5ac2687d3a185d971a699fa4237a4b6a10
/external/minijail/minijail0.c
f794247e0413fe36759a2bdcaa5bdd75cf3163a2 19-Nov-2015 Dylan Reid <dgreid@chromium.org> minijail: Add option to enter a new IPC namespace

Export this feature through the '-l' option to minijail0.

TEST=run minijail0 with the -l option, check that the executed program
is in a different ipc namesspace with /proc/self/ns/ipc.
BUG=b/25770648

Change-Id: Ia8f72cc59160fc736c8a58cb68d9894f9c92281c
Signed-off-by: Dylan Reid <dgreid@chromium.org>
/external/minijail/minijail0.c
eac2894b0b59ba1e33c3f173c00c26bdb0268afb 12-Nov-2015 Andrew Bresticker <abrestic@chromium.org> minijail: Support setting syscall table with PR_ALT_SYSCALL

Add support for setting the syscall table for a jailed process using
prctl(PR_ALT_SYSCALL). This adds the option '-a <table>' which
changes the jailed process's syscall table to the alt_syscall
table named <table>. alt_syscall tables must be registerd in the
kernel (see crosreview.com/312137 for an example of how this is done).

Bug: 25649436
TEST=Create a test blacklist that blocks write(2) and observe that
'minijail0 -a test -- /bin/echo hello' prints nothing to stdout.

Change-Id: Idddafa1d0b81483a594e05d9d3390d4f9ad849c6
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
/external/minijail/minijail0.c
648b220346aaee74ffbab35be6129bdfa5aca3a5 23-Oct-2015 Dylan Reid <dgreid@chromium.org> minijail: Add ability to specify mounts

In addition to bind mounts, allow other mounts to be specified when
running minijail. Expose this as a -k option to minijail0.

This will allow for file systems such as proc, sysfs, and devpts to be
mounted before taking away the permisison to mount from the target
program.

For example "-k sysfs,/sys,sysfs,0xe" will mount /sys in the new vfs
namespace.

BUG=b/24976046
TEST=Mount sysfs, run a shell, check that sysfs is mounted.

Change-Id: I9862e42e00ce76b1fab9cbac59c381f5270470ce
Signed-off-by: Dylan Reid <dgreid@google.com>
/external/minijail/minijail0.c
a14e08dad428aaa934687e3636a84ca7a9711de2 23-Oct-2015 Dylan Reid <dgreid@chromium.org> minijail: Allow static binaries in a bind mount to run

A previous commit placed a restriction on running static binaries and
using bind mounts. Remove that restriction by checking if the binary
path is in a bind mount and rebasing the path on to the bind mount
source path so that the executable can be accessed from outside the
chroot. This is needed so bind mounts can be specified when running a
statically linked init program for Android.

BUG=b/25192613
TEST=security_Minijail0, run a static init with bind mounts.

Change-Id: I801909df67c1bf18d48efcfd54c11aafe4c75e54
Signed-off-by: Dylan Reid <dgreid@google.com>
/external/minijail/minijail0.c
1102f5a58d539ed72defe40fcc1078840d1b3778 15-Sep-2015 Dylan Reid <dgreid@chromium.org> minijail: Support entering an existing net namespace.

When launching a full OS as the jailed process, it is useful to first be
able to configure a network namespace and start the new process in that
namespace.

This adds the "-e<net namespace file>" optional argument to -e. It
allows, for example, passing "-e/var/run/netns/newns" to minijail0.

Change-Id: I0613162072a1d14f10c58444c514f6d052c3d1e5
Signed-off-by: Dylan Reid <dgreid@chromium.org>
/external/minijail/minijail0.c
08946cc5dff65d4103268752f8fb2655119a826a 17-Sep-2015 Dylan Reid <dgreid@chromium.org> minijail: Check correct executable file

When the chroot and pivot_root options are used the path to the binary
to put in jail is given relative to the new root. However the checks
for the program existing and how it is linked were still done relative
the original rootfs. This "worked" as long as there was a similar file
outside of the chroot. Add the ability to get the full path of the
program from libminijail and use that path to check the file.

This allows chrooting to a system that has init in / instead of /sbin.

Don't try to check the binary if there are bind mounts specified. This
avoids having to parse the mounts and check if the binary is in a bind
mounted path.

Change-Id: I2e3af14f5e8fd478963bcb56a3a6ae5908e78524
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/300320
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
5471450610e34f115c4816d5e0e0f4da02def802 30-Sep-2015 Jorge Lucangeli Obes <jorgelo@google.com> minijail: Refactor dynamic and static code paths.

This CL uses the same code path for both dynamic and static binaries.
This way we avoid duplicating code, or forgetting to add functionality
to either of the paths.

BUG=chromium:537667
TEST=security_Minijail0 passes.

Change-Id: Ia484180a041dad3c302c3c8ce8bfd5b41d758ccb
Reviewed-on: https://chromium-review.googlesource.com/303380
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
/external/minijail/minijail0.c
791f577a32e80c819c01c1866c355aa74e833462 15-Sep-2015 Dylan Reid <dgreid@chromium.org> minijail: Don't unmount proc if not mounted

When switching in to a new mount and a new pid namespace, as well as
doing pivot_root, proc won't be mounted so leave it alone and let the
new init process handle mounting it. Rename the readonly flag to
remount_proc_ro which better reflects its meaning.

This will aid in starting complete, containerized systems with minijail.

Change-Id: Ice8f6d835b6417383c0cfb901ac737c3440dce55
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/300154
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
64d65a79d48186e1db532d227bc20123bf0d16cf 13-Aug-2015 Yu-Hsi Chiang <yuhsi@google.com> minijail: Support pivot_root

Add an option that allows user to use pivot_root(2) when one want to
jail process in a chrooted environment. This implies entering a new
mount namespace since pivot_root(2) will really move the root
filesystem.

BUG=chromium:517844
TEST=security_Minijail0 passes

Change-Id: Ie990670703b00e333fa4abc3804d6384d36fa7c9
Reviewed-on: https://chromium-review.googlesource.com/293128
Commit-Ready: Yu-hsi Chiang <yuhsi@google.com>
Tested-by: Yu-hsi Chiang <yuhsi@google.com>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
1912c5b5e88455e0a0c03fd375d232a498edd95d 31-Aug-2015 Yu-Hsi Chiang <yuhsi@google.com> minijail: Support multiple range uid/gid mappings.

Now minijail accept multiple ranges of contiguous uid/gid mappings that
is seperated by commas. The commas are replaced by newlines before
writing to map files.

BUG=chromium:517387
TEST=security_Minijail0 pass

Change-Id: I27d45480010b38e71b80837cc2299f180d77c4a1
Reviewed-on: https://chromium-review.googlesource.com/296270
Commit-Ready: Yu-hsi Chiang <yuhsi@google.com>
Tested-by: Yu-hsi Chiang <yuhsi@google.com>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
3cc05eab4d956e9bb919ebe7a2166c987ba1d5bf 11-Aug-2015 Yu-Hsi Chiang <yuhsi@google.com> minijail: Support writing child pid to file

BUG=chromium:519154
TEST=security_Minijail0 passes

Change-Id: Icedff5d86ef0c3dbf2933e763b0858cb79e5b08f
Reviewed-on: https://chromium-review.googlesource.com/292342
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
Trybot-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Yu-hsi Chiang <yuhsi@google.com>
/external/minijail/minijail0.c
10e91239e3cff46a10dfbe0d0960926d9ab19c57 05-Aug-2015 Yu-Hsi Chiang <yuhsi@google.com> minijail: add user namespace support

Since most of the operations can be done if we have |euid = 0| in the
new user namespace, we enter a new user namespace and become root
immediately after fork()/clone().
It is incompatible with -b and <writable> set to 0, since we are not
able to remount bind mounts as readonly in a user namespace.

BUG=chromium:517387
TEST=security_Minijail0 pass
TEST=`minijail0 -m "0 1000 1" -M "0 1000 1" -- /usr/bin/touch t`
TEST=file `t` has owner:group root:root in minijail
TEST=and chronos:chronos outside minijail

Change-Id: I48f888097be5211715c5a839eca6f8e43b9903dd
Reviewed-on: https://chromium-review.googlesource.com/291200
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Yu-hsi Chiang <yuhsi@google.com>
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
Trybot-Ready: Nicolas Boichat <drinkcat@chromium.org>
/external/minijail/minijail0.c
3e954eceba13f2e7547ada506a735f084108ea12 28-Jul-2015 Yu-Hsi Chiang <yuhsi@google.com> minijail: Add a new option to allow program run as pid 1.

Add a new flag that indicates whether to fork or not
when pid namespace is set, so that programs can be
run as pid 1 inside a new pid namespace.

BUG=chromium:350616
TEST=security_Minijail0 pass
TEST=`minijail -I /bin/bash` then `echo $$` and get pid 1

Change-Id: Icc959b775e5fe6368c15a834e23ce3f2c119af41
Reviewed-on: https://chromium-review.googlesource.com/289440
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Yu-hsi Chiang <yuhsi@google.com>
Tested-by: Yu-hsi Chiang <yuhsi@google.com>
/external/minijail/minijail0.c
3901da6e0bd4c709dda5506b5bb28177aca31abe 03-Mar-2015 Jorge Lucangeli Obes <jorgelo@chromium.org> minijail: Allow tmpfs /tmp mount without a chroot.

There's no need to require a chroot to mount a clean tmpfs /tmp.
Also, halve the size of the tmpfs to 64M.

BUG=brillo:439
TEST=Unit tests, security_Minijail pass.
TEST='minijail0 -u nobody -g nobody -t -- mount' shows tmpfs mount.

Change-Id: Iee84160cee0487a0e7e0807b64ba54f6b3980e83
Reviewed-on: https://chromium-review.googlesource.com/255650
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
Trybot-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Lee Campbell <leecam@chromium.org>
/external/minijail/minijail0.c
c2968ea22f95b7352299eb04747ed766fa20b87f 09-Jan-2015 Mike Frysinger <vapier@chromium.org> minijail: allow -i and -p to be used together

There's no reason to make these mutually exclusive since you can
daemonize in both cases fine (the minijail_run_pid_pipes launch
logic takes care of spawning an init inside the pid ns).

BUG=None
TEST=ran a process with -pi and saw it daemonize in its own pid ns

Change-Id: I72c67cc9049d4b44779b85b43339c120bb7399a4
Reviewed-on: https://chromium-review.googlesource.com/239861
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Trybot-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
/external/minijail/minijail0.c
03b2af22a2170e9130c8df9e5e92a4d79e91ac0e 19-Dec-2014 Kees Cook <keescook@chromium.org> minijail: improve debug and help text output

When reporting blocked syscalls, include the list of implicitly allowed
syscalls in the syslog report. This also improves the help text to
clarify where things are logged, and when -n is needed.

BUG=None
TEST=`minijail0 -L -S /dev/null /bin/ls` reports expected syscalls to syslog

Change-Id: I9c1104f34f55d807339106470f0b1611988ea0a5
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236741
Reviewed-by: Peter Qiu <zqiu@chromium.org>
/external/minijail/minijail0.c
482cb9d1d78cfdac7149a6dfc135e059458d93dc 24-Jul-2014 Jorge Lucangeli Obes <jorgelo@chromium.org> minijail: Read all cmdline options before setting up seccomp filters.

BUG=chromium:396832
TEST=security_Minijail_seccomp on daisy_spring.

Change-Id: Ic310059a4fd000fd5132ad9b1e864ab35db891a3
Reviewed-on: https://chromium-review.googlesource.com/209680
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Nam Nguyen <namnguyen@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
1563b5b904547ab89dc3193f463c57002b7a28f2 10-Jul-2014 Jorge Lucangeli Obes <jorgelo@chromium.org> minijail: Add support for entering an existing VFS namespace.

Also, fix the Makefile while in there.

BUG=chromium:376987
TEST=security_Minijail0
CQ-DEPEND=CL:209242

Change-Id: I18877211549500cbb720805a2480b1cb3244c1e9
Reviewed-on: https://chromium-review.googlesource.com/209240
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
2f61ee42b3c305ed99bf495af41b05ff5aa93213 16-Jun-2014 Jorge Lucangeli Obes <jorgelo@chromium.org> Fix more style issues.

BUG=None
TEST=unit

Change-Id: I89f7288e9b3226273232d99f1c0176b69ce3b300
Reviewed-on: https://chromium-review.googlesource.com/203971
Reviewed-by: Lee Campbell <leecam@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
c8b21e1a37d1c81f4331011999c30f6e5aef4dca 13-Jun-2014 Jorge Lucangeli Obes <jorgelo@chromium.org> Fix coding style issues.

BUG=None
TEST=Compile

Change-Id: Ic4515367a4b05be8410596c5159e4c6ddab8e798
Reviewed-on: https://chromium-review.googlesource.com/203719
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Lee Campbell <leecam@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
1e4fc6aa398673096ed202fccee8be977f9e3c2b 07-Jun-2014 Lee Campbell <leecam@chromium.org> Allow minijail to run statically linked targets

minijail will now detect static targets and sandbox them

BUG:chromium:355109
TEST=Tested with autotest security_Minijail0 on arm and x64

Change-Id: I4c38f652207c5c50158449f952b14e9402e17751
Reviewed-on: https://chromium-review.googlesource.com/203013
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Lee Campbell <leecam@chromium.org>
Commit-Queue: Lee Campbell <leecam@chromium.org>
/external/minijail/minijail0.c
11af0628754be91d2db5bbc3619dcd717559a85c 22-May-2014 Lee Campbell <leecam@chromium.org> Allow mounting of a tmpfs /tmp in the chroot

Added the -t option to minijail so a tmpfs can be used
in the chroot

BUG=chromium:356246
TEST=Tested with autotest security_Minijail0
CQ-DEPEND=CL:201147

Change-Id: I660629a8b8fa1c2bf4fc59d2499ff806aa280449
Reviewed-on: https://chromium-review.googlesource.com/201133
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Lee Campbell <leecam@chromium.org>
Commit-Queue: Lee Campbell <leecam@chromium.org>
/external/minijail/minijail0.c
4b2d5ee95f01fc971c35ff903132e11d55048461 10-Jan-2014 Jorge Lucangeli Obes <jorgelo@chromium.org> Exit if unable to dlopen() libminijailpreload.so.

BUG=chromium:204504
TEST=Unit tests, Minijail autotests.
TEST=Rename libminijailpreload.so, run 'minijail0 -- /usr/bin/id', see error.

Change-Id: I3978775662a7710b89f274e7ed7c265d9b923ca2
Reviewed-on: https://chromium-review.googlesource.com/182103
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
88f76a7746083aaeff0d714571945306f6f06c2d 01-Nov-2013 Christopher Wiley <wiley@chromium.org> Permit minijail0 callers to act as init to jailed processes

In particular, sometimes we jail processes in init scripts. In those
cases, it is logical to have the init process act as the init process
for the jailed process. This is accomplished by having minijail0 exit
immediately after forking.

BUG=chromium:298341
TEST=After this change, observed that minijail exits immediately,
leaving its child process in the hands of the parent.

Change-Id: I66a5fb35bfabc37d6bf2d03b79daa11b10b29ad5
Reviewed-on: https://chromium-review.googlesource.com/175600
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
/external/minijail/minijail0.c
6c0863036842df03a681307d2da84d2b0f7f908f 20-Mar-2013 Elly Fong-Jones <ellyjones@chromium.org> [minijail] support network namespacing

Add a -e argument to minijail0 to network-namespace the target program.

BUG=None
TEST=adhoc
$ minijail0 -e `which ping` 4.2.2.1
connect: Network is unreachable
$ minijail0 `which ping` 4.2.2.1
<ordinary output...>

Change-Id: Ie58ff1ec1e1ec21987734b86cbabb1118c7e0bf0
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/46035
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
6d71785b5e0b690a84fe0ff1f084e2b415eaaea4 19-Mar-2013 Elly Fong-Jones <ellyjones@chromium.org> [minijail] check permissions on target

Check that the target a) exists and b) is executable before trying to run it. If
it isn't, give an error message. This is more user friendly than the previous
behavior of 'exit with a failing error code'.

BUG=chromium:208335
TEST=adhoc
run 'minijail0 /nonexistent', note error
run 'minijail0 /usr/bin/id', note lack of error

Change-Id: Icf9641a35e7b97bda747d9e73eae2d311bb77be8
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45877
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
f65c9fed1a54659d309775b5eeee6800569b0547 22-Jan-2013 Elly Fong-Jones <ellyjones@chromium.org> [minijail] stop parsing at first non-opt arg

BUG=chromium-os:35122
TEST=security_Minijail0,adhoc
Running minijail with different stop arguments should work:
$ /sbin/minijail0 /bin/ls -u INVALID_USER
/bin/ls: cannot access INVALID_USER: No such file or directory
$ /sbin/minijail0 -u bin /bin/ls -g INVALID_GROUP
/bin/ls: cannot access INVALID_GROUP: No such file or directory
$ /sbin/minijail0 -u bin -g bin /bin/echo -x
-x

Change-Id: I2d7ced270ddecd7a5ee3b99c5416e3982f5dc112
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41767
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
/external/minijail/minijail0.c
bda833cbcee330eab91561a9b50b6bc24c47f2e9 01-Aug-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Minijail: add logging for seccomp filter failures.

BUG=chromium-os:33361
TEST=unit tests
TEST=security_Minijail0, security_Minijail_seccomp, platform_CrosDisksArchive

Change-Id: I16cdb8fbcf1cb13f2dee5521f97fb8d0bdbdf93b
Reviewed-on: https://gerrit.chromium.org/gerrit/29053
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
2625bba5c348bbd6d4854387e825196adc06caee 01-Aug-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Fix Minijail's getopt string.

"-F" option does not exist.

BUG=None
TEST=security_Minijail0

Change-Id: I7463288d0555636d1c96373e61494082738111bd
Reviewed-on: https://gerrit.chromium.org/gerrit/28876
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
0341d6c28e9c8a1ae2c29f3b8bc13d40c5cb0f9d 17-Jul-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Fix "-n" option in Minijail.

BUG=None
TEST="minijail -n" does not call prctl() after setting seccomp mode 2.

Change-Id: I0147457d31019d1a70e37cf712141979f4262461
Reviewed-on: https://gerrit.chromium.org/gerrit/27554
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
474ee71b9a15c50877b87affc7d857681c29e7eb 02-May-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Re-enable setting seccomp filters in Minijail.

Now that all the bits have landed, re-enable setting seccomp filters
in Minijail.

BUG=chromium-os:27878
TEST=security_Minijail0
TEST=security_Minijail_seccomp
TEST=platform_CrosDisksArchive

Change-Id: I13aae50a4d172443170e7fbf4bfc84812a424b65
Reviewed-on: https://gerrit.chromium.org/gerrit/21655
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
c2c9bccd546e44aac8919352261fd6ac59f3855b 01-May-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Add API for PR_SET_NO_NEW_PRIVS and set seccomp filter before dropping root.

BUG=chromium-os:27878
TEST=minijail_unittest, syscall_filter_unittest
TEST=security_Minijail0
TEST=security_Minijail_seccomp

Change-Id: I78495fda8c14ca5b4f398806eb564b0756876735
Reviewed-on: https://gerrit.chromium.org/gerrit/21545
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
/external/minijail/minijail0.c
2343d8319c9f9816e495f9359ba4420ef8b93de0 26-Apr-2012 Jorge Lucangeli Obes <jorgelo@chromium.org> Temporarily disable setting seccomp filters in Minijail.

To make merging the BPF-based seccomp filter implementation easier,
turn off setting seccomp filters in Minijail. Add a flag ("-F") to
force setting seccomp filters.

BUG=chromium-os:27878
TEST=security_Minijail0 still passes.

Change-Id: I1948223f2292cf5c059bf50f69fd0b4e42ec39a2
Reviewed-on: https://gerrit.chromium.org/gerrit/21170
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c
fdd5f2d063f4bbe8e1efd30df43f57c5efe9d5c9 23-Jan-2012 Elly Jones <ellyjones@chromium.org> [minijail] fix usage docs

Explicitly state that -r only remounts /proc right now.

BUG=None
TEST=build

Change-Id: I5faf34cd9971120885c118e2ebb7be09ad9ddcbf
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14624
/external/minijail/minijail0.c
e58176c07895532d49b4cb9a660a4eeb644d4e2f 23-Jan-2012 Elly Jones <ellyjones@chromium.org> [minijail] pid namespace implies vfs namespace

Make a pid namespace imply both a new vfs namespace and a /proc remount, since
if we don't remount /proc, the old pid namespace is still reachable through the
old mount there.

BUG=chromium-os:25303
TEST=security_Minijail0

Change-Id: I91887d3ed6bc0e958e249c3c158735bc04f20fcd
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14617
Reviewed-by: Kees Cook <keescook@chromium.org>
/external/minijail/minijail0.c
5ba42b5a35bc79ac455107008f2189fa26228789 07-Dec-2011 Elly Jones <ellyjones@chromium.org> minijail0: parse *all* the arguments!

Using strtok the way we did causes src == dest == writeable - oops.

BUG=none
TEST=security_Minijail0

Change-Id: Ifc8e6e528e93549b64b23e6ac46dbee4e54ddad7
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/12555
Reviewed-by: Jim Hebert <jimhebert@chromium.org>
/external/minijail/minijail0.c
a8d1e1b685840bce77d4d32cb4cd52e25e5e1763 21-Oct-2011 Elly Jones <ellyjones@chromium.org> minijail0: unbreak chroot and marshalling

1) Parse opts for chroot and bind
2) Serialize/deserialize chroot properly

BUG=chromium-os:21665
TEST=security_Minijail0

Change-Id: Ic99a40718a9c3ff72561f518179155fb502eef96
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/10507
Reviewed-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c
51a5b6c7f464100cea4c79f737fab2e582904135 13-Oct-2011 Elly Jones <ellyjones@chromium.org> minijail0: add chroot support.

Support a -C commandline option to chroot(), and a -b commandline option to
bind-mount paths into the chroot from outside.

BUG=chromium-os:21165
TESTED_ON=kaen
TEST=None yet

Change-Id: Ia6a7a4498968a4bc6a12f8274fdb8c4be9d23ca4
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8661
Reviewed-by: Kees Cook <keescook@chromium.org>
/external/minijail/minijail0.c
e1749eb93a119bf03b5b033d74c541dbb45be00e 07-Oct-2011 Elly Jones <ellyjones@chromium.org> minijail0: convert to linux style

Used indent(1) with --linux-style, then manual cleanup.

BUG=None
TEST=None

Checkpatch: ok
Change-Id: I52dbd329215680e9d42ce4f11df110cf2f341e90
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8732
Reviewed-by: Kees Cook <keescook@chromium.org>
/external/minijail/minijail0.c
fe4a372685f30fe7d0f30da2a46cc096f418c359 16-Sep-2011 Will Drewry <wad@chromium.org> libminijail: move over to using marshalled binary for preload

Move libminijail and libminijailpreload over to using the marshalling
helper functions and add to/from_fd. The format itself is not terribly
robust, but we can change it underneath the functions in the future
(or move struct minijail to a protobuf :).

These changes lay the groundwork for sending seccomp_filter policy. A
subsequent change will implement that and disable use in the parent.

BUG=chromium-os:19459
TEST=tested as per previous commits:
minijail0 -[pvrcuGg] -- /bin/cat /proc/self/status
.. /bin/ps aux
.. /bin/bash -c 'env'

Change-Id: I565816611b31ce49f85fee2241c55a3328d7b770
Reviewed-on: http://gerrit.chromium.org/gerrit/7892
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c
32ac9f5392525576dcd7bf2e18fb4c230649a3da 19-Aug-2011 Will Drewry <wad@chromium.org> libminijail,minijail0: add seccomp filter support

This change adds support for installing seccomp filters via libminijail
or by using minijail0 with an arch-specific filters file.

Support for LD_PRELOAD marshalling is still missing and will come in a new change.

BUG=chromium-os:19459
TEST=minijail0 -r -S dash-cat.policy -u chronos -- /bin/dash -c '/bin/cat /proc/self/seccomp_filter'
dash-cat.policy can be found in the bug.
built for arm-generic, tegra2_seaboard, and x86-alex. Tested on x86-alex as above and with -H.

Change-Id: I3cac97d1df62f70cd546763aeca8f52dd0aea09d
Reviewed-on: http://gerrit.chromium.org/gerrit/7773
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c
f0ef52e0bb54e6ea28e3abf96b95ed1bb9225cb4 14-Sep-2011 Thieu Le <thieule@chromium.org> Revert "libminijail,minijail0: add seccomp filter support"

This reverts commit adf64c0814e16cb43ce81e6b3e3660a16f564cc7

Change-Id: Ib24f2ad26dfe14ddd4e6b38e204630577db5a4cc
Reviewed-on: http://gerrit.chromium.org/gerrit/7735
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/external/minijail/minijail0.c
13dcc70bf9fec5d9c13dc47738f2852d88262ce9 19-Aug-2011 Will Drewry <wad@chromium.org> libminijail,minijail0: add seccomp filter support

This change adds support for installing seccomp filters via libminijail
or by using minijail0 with an arch-specific filters file.

Support for LD_PRELOAD marshalling is still missing and will come in a new change.

BUG=chromium-os:19459
TEST=minijail0 -r -S dash-cat.policy -u chronos -- /bin/dash -c '/bin/cat /proc/self/seccomp_filter'
dash-cat.policy can be found in the bug.

Change-Id: Id3f52ae9ce7bf49c257b2cfb9ba66b38b8be8094
Reviewed-on: http://gerrit.chromium.org/gerrit/6789
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c
cd7a9046e61e243fca916a286e49d58e2331eaa7 22-Jul-2011 Elly Jones <ellyjones@chromium.org> RFC: minijail: add libminijail.

Drewry requested an implementation of minijail that:

1) Would be linkable against C programs
2) Not depend on libbase
3) Supply the necessary LD_PRELOAD hacks to use his syscall-filtering framework
without the apply-after-exec hack and to use ptrace-disable.

Thoughts?

BUG=chromium-os:17937
TEST=Adhoc (extremely ;)). Proper test suite to be written; crosbug.com/18834

Change-Id: I8b34557a9a231dad75827c1a3d11f235f712648d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/4585
Reviewed-by: Will Drewry <wad@chromium.org>
/external/minijail/minijail0.c