Commit Graph

255 Commits

Author SHA1 Message Date
Lukas Waslowski 9a03967f0a Fix declarations of of execdriver/native.NewDriver to have the same signature.
This change is done so that driver_unsupported.go and driver_unsupported_nocgo.go
declare the same signature for NewDriver as driver.go.

Fixes #19032

Signed-off-by: Lukas Waslowski <cr7pt0gr4ph7@gmail.com>
2016-01-02 19:55:37 +01:00
Jess Frazelle abc695d9d5 Merge pull request #18974 from jfrazelle/remove-seccomp-from-seccomp-profile
remove seccomp from seccomp profile
2015-12-29 13:15:14 -08:00
Arnaud Porterie a81e438544 Merge pull request #18969 from justincormack/vm86
Block vm86 syscalls in default seccomp profile
2015-12-29 11:57:35 -08:00
Arnaud Porterie 2307f47fdd Merge pull request #18972 from justincormack/bpf
Block bpf syscall from default seccomp profile
2015-12-29 11:57:07 -08:00
Arnaud Porterie e01cab1cc5 Merge pull request #18971 from justincormack/ptrace
Block additional ptrace related syscalls in default seccomp profile
2015-12-29 11:56:51 -08:00
Jessica Frazelle b610fc226a
remove seccomp from seccomp profile
This can be allowed because it should only restrict more per the seccomp docs, and multiple apps use it today.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-29 11:21:33 -08:00
Arnaud Porterie 94e0760868 Merge pull request #18947 from jfrazelle/fix-seccomp-unsupported
fix default profile where unsupported
2015-12-29 10:21:07 -08:00
Arnaud Porterie afdc4747dc Merge pull request #18953 from justincormack/robust_list
Allow use of robust list syscalls in default seccomp policy
2015-12-29 10:19:41 -08:00
Arnaud Porterie a32b06b067 Merge pull request #18956 from justincormack/umount
Block original umount syscall in default seccomp filter
2015-12-29 10:19:04 -08:00
Justin Cormack a0a8ca0ae0 Block additional ptrace related syscalls in default seccomp profile
Block kcmp, procees_vm_readv, process_vm_writev.
All these require CAP_PTRACE, and are only used for ptrace related
actions, so are not useful as we block ptrace.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 18:17:28 +00:00
Arnaud Porterie ad8bce2ce4 Merge pull request #18959 from justincormack/finit_module
Deny finit_module in default seccomp profile
2015-12-29 10:12:50 -08:00
Arnaud Porterie 8ac3d083a8 Merge pull request #18961 from justincormack/clock_adjtime
Block clock_adjtime in default seccomp config
2015-12-29 10:08:45 -08:00
Justin Cormack 33568405f3 Block bpf syscall from default seccomp profile
The bpf syscall can load code into the kernel which may
persist beyond container lifecycle. Requires CAP_SYS_ADMIN
already.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 17:28:30 +00:00
Justin Cormack 6c3ea7a511 Block vm86 syscalls in default seccomp profile
These provide an in kernel virtual machine for x86 real mode on x86
used by one very early DOS emulator. Not required for any normal use.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 15:47:23 +00:00
Justin Cormack 6300a08be9 Block stime in default seccomp profile
The stime syscall is a legacy syscall on some architectures
to set the clock, should be blocked as time is not namespaced.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 15:28:05 +00:00
Justin Cormack 0e5c43cdda Block clock_adjtime in default seccomp config
clock_adjtime is the new posix style version of adjtime allowing
a specific clock to be specified. Time is not namespaced, so do
not allow.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 12:48:16 +00:00
Justin Cormack 0d5306a0b6 Deny finit_module in default seccomp profile
This is a new version of init_module that takes a file descriptor
rather than a file name.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 12:31:33 +00:00
Justin Cormack 9be0d93cf7 Block original umount syscall in default seccomp filter
The original umount syscall without flags argument needs to
be blocked too.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 11:57:16 +00:00
Justin Cormack 7b133e7235 Allow use of robust list syscalls
The set_robust_list syscall sets the list of futexes which are
cleaned up on thread exit, and are needed to avoid mutexes
being held forever on thread exit.

See for example in Musl libc mutex handling:
http://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_mutex_trylock.c#n22

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
2015-12-29 10:22:05 +00:00
Jessica Frazelle b4c14a0bb8
fix code comment
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 22:36:54 -08:00
Jessica Frazelle 94b45310f4
fix default profile where unsupported
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 20:42:15 -08:00
Jessica Frazelle 15674c5fb7
add docs and unconfined to run a container without the default seccomp profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 10:26:51 -08:00
Jessica Frazelle 947293a280
set default seccomp profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 10:18:47 -08:00
Qiang Huang 8799c4fc0f Implemet docker update command
It's used for updating properties of one or more containers, we only
support resource configs for now. It can be extended in the future.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-28 19:19:26 +08:00
Jess Frazelle ff69b23dc0 Merge pull request #18395 from LK4D4/default_cgroup_is_not_daemon
Use /docker as cgroup parent instead of docker
2015-12-17 13:59:00 -08:00
Brian Goff ce0b1841c8 Merge pull request #17034 from rhvgoyal/volume-propagation
Capability to specify per volume mount propagation mode
2015-12-15 12:14:41 -05:00
Alexander Morozov ecc3717cb1 Merge pull request #18612 from mrunalp/update_runc
Update runc/libcontainer to v0.0.6
2015-12-14 13:05:53 -08:00
Jess Frazelle c38aa60180 Merge pull request #18393 from qzio/apparmor/ptrace-ubuntu14
Enable ptrace in a container on apparmor below 2.9
2015-12-14 10:07:01 -08:00
Vivek Goyal d4b4ce2588 Check Propagation properties of source mount point
Whether a shared/slave volume propagation will work or not also depends on
where source directory is mounted on and what are the propagation properties
of that mount point. For example, for shared volume mount to work, source
mount point should be shared. For slave volume mount to work, source mount
point should be either shared/slave.

This patch determines the mount point on which directory is mounted and
checks for desired minimum propagation properties of that mount point. It
errors out of configuration does not seem right.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-12-14 10:39:53 -05:00
Vivek Goyal a2dc4f79f2 Add capability to specify mount propagation per volume
Allow passing mount propagation option shared, slave, or private as volume
property.

For example.
docker run -ti -v /root/mnt-source:/root/mnt-dest:slave fedora bash

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-12-14 10:39:53 -05:00
Justas Brazauskas 927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
Mrunal Patel e8f7d5885d Update runc/libcontainer to v0.0.6
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-12-11 15:24:32 -05:00
Joel Hansson 6480feb766 Enable ptrace in a container on apparmor below 2.9
Ubuntu 14.04 LTS is on apparmor 2.8.95.
This enables `ps` inside a container without causing
audit log entries on the host.

Signed-off-by: Joel Hansson <joel.hansson@ecraft.com>
2015-12-07 11:08:49 +01:00
Jessica Frazelle 6707f4b9b6
inital seccomp support
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-03 16:30:44 -08:00
Alexander Morozov 4b55765c11 Use /docker as cgroup parent instead of docker
It means that containers will be created under root cgroup and not under
daemon cgroup.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-03 08:42:45 -08:00
Arnaud Porterie 8f1f53f735 Merge pull request #16277 from runcom/add-oom-score-adj
Add OomScoreAdj
2015-12-02 11:49:51 -08:00
Dan Walsh b3e527dfd2 This patch adds --tmpfs as a option for mounting tmpfs on directories
It will Tar up contents of child directory onto tmpfs if mounted over

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-12-02 10:06:59 -05:00
Jess Frazelle e852959fad Merge pull request #18178 from jfrazelle/apparmor-we-meet-again
Fix docker-default profile handing signals
2015-11-30 11:34:34 -08:00
Jessica Frazelle f8db9a09e0
check version for docker-default aa profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-11-30 10:18:12 -08:00
Jess Frazelle 360a106511 Merge pull request #18303 from runcom/lxc-leftover
daemon: remove sysInitPath, lxc leftover
2015-11-30 09:37:05 -08:00
Antonio Murdaca d3af7f283d Add OomScoreAdj to configure container oom killer preferences
libcontainer v0.0.4 introduces setting `/proc/self/oom_score_adj` to
better tune oom killing preferences for container process. This patch
simply integrates OomScoreAdj libcontainer's config option and adjust
the cli with this new option.

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-30 11:19:04 +01:00
Antonio Murdaca 1b726b29b2 daemon: remove sysInitPath, lxc leftover
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-30 10:04:13 +01:00
Jessica Frazelle c0f7fdc025
Fix parsing of apparmor pcre syntax
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-11-25 10:38:18 -08:00
Stefan Berger 5cd6b3eca2
Adjust docker-default profile when docker daemon is confined
Adjust the docker-default profile for when the docker daemon is running in
AppArmor confinement. To enable 'docker kill' we need to allow the container
to receive kill signals from the daemon.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-23 15:20:01 -08:00
Vincent Demeester c32f8bb36a Merge pull request #17704 from LK4D4/default_cgroupfs
Use fs cgroups by default
2015-11-19 14:01:13 +01:00
Alexander Morozov 419fd7449f Use fs cgroups by default
Our implementation of systemd cgroups is mixture of systemd api and
plain filesystem api. It's hard to keep it up to date with systemd and
it already contains some nasty bugs with new versions. Ideally it should
be replaced with some daemon flag which will allow to set parent systemd
slice.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-18 16:16:13 -08:00
Alexander Morozov 9187656305 Merge pull request #16639 from mrunalp/skip_dev_setup
Skip /dev setup in container when it is bind mounted in
2015-11-17 11:36:00 -08:00
John Howard be2f53ece8 Windows: Fix native exec template
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-31 11:39:19 -07:00
Dan Walsh 0c518b6ab2 Docker is calling cont.Destroy twice on success
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-10-19 14:53:55 -04:00
Antonio Murdaca cfcddefacd daemon: execdriver: lxc: fix cgroup paths
When running LXC dind (outer docker is started with native driver)
cgroup paths point to `/docker/CID` inside `/proc/self/mountinfo` but
these paths aren't mounted (root is wrong). This fix just discard the
cgroup dir from mountinfo and set it to root `/`.
This patch fixes/skip OOM LXC tests that were failing.
Fix #16520

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
2015-10-13 14:46:59 -07:00