Commit Graph

333 Commits

Author SHA1 Message Date
8c106c9224 Revert "Add support for sharing /dev/shm/ and /dev/mqueue between containers"
This reverts commit d88fe447df0e87b3a57f9d08b108b141dd72678c.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 688dd8477e907ca1899c6c2863775b3af2c30174
Component: engine
2015-08-26 05:23:00 -04:00
322a07231d Merge pull request #12159 from mrunalp/feature/ipc_share_dev
ipc: Share /dev/shm and /dev/mqueue when --ipc container:<id/name> is used
Upstream-commit: 903cd2b9e3e2cea8b5ee7c0b74d52ff4a3beafb5
Component: engine
2015-08-24 17:55:03 -07:00
7143030753 Merge pull request #15571 from ewindisch/apparmor_denywproc
AppArmor: Deny w to /proc/* files
Upstream-commit: 9bac520c129c9fd5c9415b5170a66567d85247b4
Component: engine
2015-08-24 11:03:41 +02:00
58ef88608a Add support for sharing /dev/shm/ and /dev/mqueue between containers
This changeset creates /dev/shm and /dev/mqueue mounts for each container under
/var/lib/containers/<id>/ and bind mounts them into the container. When --ipc:container<id/name>
is used, then the /dev/shm and /dev/mqueue of the ipc container are used instead of creating
new ones for the container.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: d88fe447df0e87b3a57f9d08b108b141dd72678c
Component: engine
2015-08-19 12:36:52 -04:00
3004521c7f Add support for kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: b6f1b4ad350cbf1f540797eee44520694237d47c
Component: engine
2015-08-19 23:56:55 +08:00
d9d9dff9a7 Merge pull request #15579 from Microsoft/10662-graph
Windows: Graph remove custom interface, add central store
Upstream-commit: 2e7b088164960b7981a058f34336c05dc52f2c53
Component: engine
2015-08-17 10:45:48 -07:00
f2f5327a6e Merge pull request #14113 from dit4c/10348-exec-privileged
Remerge of `docker exec --privileged` with better tests
Upstream-commit: e1f3a5ad0aade527c1b00385652aec21d1cf09ac
Component: engine
2015-08-16 00:20:41 +02:00
73f39654a9 Windows: Graph remove custom interface and add central store
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>

Windows: add support for images stored in alternate location.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: dfbb5520e3b35030f3eef38d5a2d86ad20ea0a2f
Component: engine
2015-08-14 23:45:53 -07:00
84c4707817 Windows: new hcsshim stdin/out/err handling
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ec5a73d18eb6a5241cdaa0b5d473abb085d6f491
Component: engine
2015-08-13 13:09:42 -07:00
9aef8f471d AppArmor: Deny w to /proc/* files
Introduce a write denial for files at the root of /proc.

This prohibits root users from performing a chmod of those
files. The rules for denials in proc are also cleaned up,
making the rules better match their targets.

Locally tested on:
- Ubuntu precise (12.04) with AppArmor 2.7
- Ubuntu trusty (14.04) with AppArmor 2.8.95

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 7342d59114fe443ae8d59474abb59280f014c493
Component: engine
2015-08-13 15:39:25 -04:00
337be087f4 Revert "Revert "Add docker exec run a command in privileged mode""
This reverts commit 40b71adee390e9c06471b89ed845132b4ec80177.

Original commit (for which this is effectively a rebased version) is
72a500e9e5929b038816d8bd18d462a19e571c99 and was provided by Lei Jitang
<leijitang@huawei.com>.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
Upstream-commit: 03f65b3d0d66ccdc8b69a447b75508d594007600
Component: engine
2015-08-13 16:36:44 +10:00
6bdf36a6da Merge pull request #15399 from Microsoft/10662-portmapping
Windows: [TP3] Enable NAT port mapping
Upstream-commit: 72e55cb0eca82017cd696e0a0d41e40be43086a1
Component: engine
2015-08-12 19:07:14 -07:00
3c87acb006 Windows: Enable NAT port mapping
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4393be71005e63ab305f4d87481dbd23b7594d18
Component: engine
2015-08-12 13:17:27 -07:00
761dc54167 fix typo mistake
Signed-off-by: Yibai Zhang <xm1994@gmail.com>
Upstream-commit: fa9e54fbf112c44de05a66330fc22303b1681d05
Component: engine
2015-08-10 16:30:48 +08:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
59f2aefefe remove docker-unconfined profile we were not using it and it breaks apparmor on wheezy
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: e542238f2a4ba9d77bf8ebc77e319dd6b321925f
Component: engine
2015-08-06 16:51:01 -07:00
e46c794117 revert apparmor changes back to how it was in 1.7.1, but keep tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: ed248207d74ac59fb190be31dee96c6a8cef68da
Component: engine
2015-08-06 12:49:25 -07:00
e94fbdc264 Windows: Daemon compile was broken
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: fe8cfc5b39ffca9f15bc5f005164aa31754ee991
Component: engine
2015-08-04 12:42:41 -07:00
3700154a99 Merge pull request #15114 from hqhq/hq_exedriver_win_lint
Fix golint warnings for daemon/execdriver/windows
Upstream-commit: ff3adb135deef895e4726a720b8f72d631eb0177
Component: engine
2015-08-03 16:28:47 -07:00
2bffc18a77 Add LXC built in support deprecation notice
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 06f6c0c7e50ea0df588d1d873783f326c23f195a
Component: engine
2015-08-03 14:54:42 -07:00
0711faa61b Fix golint warnings for daemon/execdriver/windows
Addresses: #14756

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: f9b5eb0cacf87b9e1c5b2aaea30c9774cf60897a
Component: engine
2015-08-03 09:54:02 +08:00
f32fe35a14 Merge pull request #15148 from hqhq/hq_golint_native
Add back golint for daemon/execdriver/native
Upstream-commit: 2d730c93b4010b314f5365b22810823201ea1d58
Component: engine
2015-07-30 15:51:06 -04:00
76f950f781 Merge pull request #15163 from crosbymichael/proc-ro
Don't mount /proc as ro
Upstream-commit: a687448c4dec200336ed28c5ef26c8198cc0505b
Component: engine
2015-07-30 15:12:29 -04:00
114011a355 Only explicitly deny ptrace for container-originated procs
The 'deny ptrace' statement was supposed to only ignore
ptrace failures in the AUDIT log. However, ptrace was implicitly
allowed from unconfined processes (such as the docker daemon and
its integration tests) due to the abstractions/base include.

This rule narrows the definition such that it will only ignore
the failures originating inside of the container and will not
cause denials when the daemon or its tests ptrace inside processes.

Introduces positive and negative tests for ptrace /w apparmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: f5c388b35a9ddd699b3dbbe85b80fa02234f8355
Component: engine
2015-07-30 14:40:28 -04:00
8461105dc9 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: bfc51cf6605ebcf7a4ec791fb0f3b5ae7b05c6fd
Component: engine
2015-07-30 10:57:50 -07:00
639fd1d44b Add back golint for daemon/execdriver/native
It's broken by #15099 Fix it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: e34f562a77276516b81756e9ea620a1625c49093
Component: engine
2015-07-30 08:58:54 +08:00
c5fec26f40 Merge pull request #15138 from ewindisch/apparmor-fix-test-plus-unconfined
Fix the proc integration test & include missing AA profile
Upstream-commit: 2ae174e491a366c4663b4f6ecee83cd6f64bcc3f
Component: engine
2015-07-29 15:32:13 -07:00
36993f8dbd Fix the proc integration test & include missing AA profile
Integration tests were failing due to proc filter behavior
changes with new apparmor policies.

Also include the missing docker-unconfined policy resolving
potential startup errors. This policy is complain-only so
it should behave identically to the standard unconfined policy,
but will not apply system path-based policies within containers.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 5832715052e9e165cc40a5ac8178fa62685985aa
Component: engine
2015-07-29 17:08:51 -04:00
59df5a01ec make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 26c03d561ab126287bb3034cc23477d18869a888
Component: engine
2015-07-29 21:25:56 +03:00
7b7157591c Merge pull request #15099 from ewindisch/apparmor-restore-en
Restore AppArmor generation + fixes
Upstream-commit: d7661cb48b93978b4b30d2c60f3201d685af7f95
Component: engine
2015-07-29 09:36:59 -07:00
67bf5ba305 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6bca8ec3c9ccc169c53b3d7060fe5c8ba8670aac
Component: engine
2015-07-28 22:31:01 -07:00
e9b83a5a26 Restore AppArmor profile generation
Will attempt to load profiles automatically. If loading fails
but the profiles are already loaded, execution will continue.

A hard failure will only occur if Docker cannot load
the profiles *and* they have not already been loaded via
some other means.

Also introduces documentation for AppArmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 3edc88f76df6a3bc9d887de8157ec71730c9057a
Component: engine
2015-07-28 17:45:51 -04:00
f2ac9ec822 Fix golint warnings for daemon/execdriver/*
Addresses: #14756

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 3d17c3bb663a5d7a65bd39a5ef32cb4668b48c53
Component: engine
2015-07-28 08:43:22 +08:00
d3667a22b6 Merge pull request #14976 from calavera/revert_unconfined_aa_policy
Revert "Introduce a dedicated unconfined AA policy"
Upstream-commit: 542685d856cad45b602e018baf36d7b268cbdfdc
Component: engine
2015-07-24 17:31:28 -07:00
61a71388a8 Revert "Introduce a dedicated unconfined AA policy"
This reverts commit 87376c3add7dcd48830060652554e7ae43d11881.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 94ab0d312fedaf063a6487c6b1b8b7b97221d24a
Component: engine
2015-07-24 16:35:51 -07:00
11ea6871f4 fix memory swappiness lxc
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: a38b544ef082bcea76c4ea13e19d935ac09d3498
Component: engine
2015-07-24 15:46:51 -07:00
7b98273c2e Merge pull request #14887 from Microsoft/10662-stupidtypo
Windows: Stupid copy/paste error
Upstream-commit: 9dcd0cc1ee442ca262491b7738890793be641abc
Component: engine
2015-07-23 14:49:17 -04:00
f26842120f Merge pull request #14855 from ewindisch/apparmor-unconfined
Introduce a dedicated unconfined AA policy
Upstream-commit: ac9fc03c74e65a6a18bc0854d4a2841637fe1acf
Component: engine
2015-07-23 10:21:51 -07:00
c8167142d1 Windows: Stupid copy/paste error
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: cef5cb2dcbe1089f5fde6478a9c0f2ed93ce3c80
Component: engine
2015-07-22 19:30:47 -07:00
9f8e7b5fed Introduce a dedicated unconfined AA policy
By using the 'unconfined' policy for privileged
containers, we have inherited the host's apparmor
policies, which really make no sense in the
context of the container's filesystem.

For instance, policies written against
the paths of binaries such as '/usr/sbin/tcpdump'
can be easily circumvented by moving the binary
within the container filesystem.

Fixes GH#5490

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 87376c3add7dcd48830060652554e7ae43d11881
Component: engine
2015-07-22 11:28:32 -04:00
e5400db724 Remove unused parameter in NewTtyConsole
It's introduced in
68ba5f0b69c9f38 (Execdriver implementation on new libcontainer API)

But I don't see reson why we need it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: af3059855c0b59c08b115a70d3f61b0fab3270de
Component: engine
2015-07-22 10:32:31 +08:00
58f999ca51 Windows: Remove erroneous comment
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bd30d27636718b3ea576caa52807507d57283580
Component: engine
2015-07-21 14:25:08 -07:00
b6a0d280f9 Remove unused TtyTerminal interface
It was used only by integration tests, which now gone.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6ae377ffa0c106749db1bcd6cf158f8b0056dea8
Component: engine
2015-07-21 09:56:28 -07:00
74cf202b4f Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 80d99236c1ef9d389dbaca73c1a949da16b56b42
Component: engine
2015-07-21 11:05:53 -04:00
d9e652a366 Update libcontainer
Replaced github.com/docker/libcontainer with
github.com/opencontainers/runc/libcontaier.
Also I moved AppArmor profile generation to docker.

Main idea of this update is to fix mounting cgroups inside containers.
After updating docker on CI we can even remove dind.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c86189d554ba14aa04b6314970d3699e5ddbf4de
Component: engine
2015-07-16 16:02:26 -07:00
d192eb2289 Merge pull request #14620 from hqhq/hq_cgroup_ro_optional
Remove cgroup read-only flag when privileged
Upstream-commit: 8801906cedb73f171a8556294e78d649fee3db32
Component: engine
2015-07-16 16:00:02 -07:00
c4cef0431e Merge pull request #14604 from Microsoft/10662-addbridge
Windows: Plumb through -b on daemon
Upstream-commit: 97515a35ca4c91f1a1444f73f5fe9385a94f1dd1
Component: engine
2015-07-16 08:44:40 -07:00
ca53cad1a3 Remove cgroup read-only flag when privileged
Fixes: #14543

It needs libcontainer fix from:
https://github.com/opencontainers/runc/pull/91

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: a7f5e1c4c3559127758131123242bb54f26da8ce
Component: engine
2015-07-14 15:00:41 +08:00
43c3fe4dbf Windows: Plumb through -b on daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e0ec0cc115a7b271defc7ab5680eb6836ef71c7a
Component: engine
2015-07-13 12:41:48 -07:00
b0da7fa04d Adds support for specifying additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: e0d96fb3ef562103690529c34140d04604599497
Component: engine
2015-07-13 14:47:28 -04:00