Commit Graph

285 Commits

Author SHA1 Message Date
dad375d1d2 /dev/mqueue should never be mounted readonly
If user specifies --read-only flag it should not effect /dev/mqueue.
This is causing SELinux issues in docker-1.10.  --read-only blows up
on SELinux enabled machines.  Mounting /dev/mqueue read/only would also
blow up any tool that was going to use /dev/mqueue.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: adb2e3fedc76fbaecce0d75a29aa0d419be5c4c2
Component: engine
2016-02-15 14:56:07 -05:00
1a4e7d1b20 Make mqueue container specific
mqueue can not be mounted on the host os and then shared into the container.
There is only one mqueue per mount namespace, so current code ends up leaking
the /dev/mqueue from the host into ALL containers.  Since SELinux changes the
label of the mqueue, only the last container is able to use the mqueue, all
other containers will get a permission denied.  If you don't have SELinux protections
sharing of the /dev/mqueue allows one container to interact in potentially hostile
ways with other containers.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: ba38d58659cc155aebf89a2ea4cfc3cd7ba04a64
Component: engine
2016-02-05 16:50:35 +01:00
dce9d7fda4 remove the unused Info interface in daemon/execdriver/driver.go and related code
Signed-off-by: Fangyuan Gao <21551127@zju.edu.cn>
Upstream-commit: 5d07d83ee0802391ff2ed5e10838376a9b817bba
Component: engine
2016-02-02 09:04:52 +08:00
025414686c Fix typos in create.go
There were a few spelling issues that I noticed when reading about shared mounts.

Signed-off-by: jgeiger <joey.geiger@irco.com>
Upstream-commit: 318b4f0b5f0639149f5e88aba805cdd454d4d9ee
Component: engine
2016-01-28 14:08:11 -07:00
25f186f583 Merge pull request #19688 from crosbymichael/tmpfs-tar
Remove tar copy-up for tmpfs mounts
Upstream-commit: 3a70ab3a2c78ab40a5fdfe55be5745753eb41139
Component: engine
2016-01-26 17:03:07 -08:00
0bed041a45 Move tar copy-up for tmpfs mounts
We cannot rely on the tar command for this type of operation because tar
versions, flags, and functionality can very from distro to distro.
Since this is in the container execution path it is not safe to have
this as a dependency from dockers POV where the user cannot change the
fact that docker is adding these pre and post mount commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: ae8ec4860e68e945cf6b2c157fa4e243c35c54a5
Component: engine
2016-01-26 14:00:39 -08:00
7187db20a2 move default seccomp profile into package
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: bed0bb7d017bb4a8400ac2c031dc74cd74240bfb
Component: engine
2016-01-21 16:55:29 -08:00
190d8fab36 move default apparmor policy into package
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 35e50119fc2a2a6d9bcdc95c000df8b66d6cb9d3
Component: engine
2016-01-21 16:55:27 -08:00
7141a04b13 Merge pull request #19263 from jfrazelle/update-aa-parser
refactor aaparser pkg, add unit tests
Upstream-commit: 3233f4560912fee87857f653a8bb32050dc04927
Component: engine
2016-01-21 19:40:53 -05:00
6541731269 add send, recv, and x32 so we can install i386 pkgs on amd64
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 308eff99e8468be4e92951de0ac69b27042a833b
Component: engine
2016-01-18 19:24:01 -08:00
a0c04482f7 refactor aaparser pkg, add unit tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 446f498ebac56d4ed396b6c20252d152926dc30e
Component: engine
2016-01-13 08:43:12 -08:00
fb652937c3 read seccomp profile locally then pass to daemon
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 062d0b3921316bc348c7930ce6599e1f8f297090
Component: engine
2016-01-12 13:12:29 -08:00
622bd04e41 Merge pull request #19217 from justincormack/arm_syscalls
Add arm specific syscalls to default seccomp profile
Upstream-commit: a96a0b37818e26bea173aa718df92f50b21093c3
Component: engine
2016-01-11 15:26:09 -08:00
8e7c65a2dd Merge pull request #19069 from jfrazelle/apparmor-regex-proc
fix proc regex
Upstream-commit: 9c9a1d1b4bc2122548a38b233a2f26ab5304de4c
Component: engine
2016-01-11 13:50:25 -08:00
ddd50b3705 Merge pull request #18512 from euank/18510-fixOomKilled
Set OOMKilled state on any OOM event
Upstream-commit: 967acd56c175b7c0f3ad4236c664730338a94bb8
Component: engine
2016-01-11 00:09:26 +01:00
1567cd421d Add arm specific syscalls to default seccomp profile
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: 37d35f3c280dc27a00f2baa16431d807b24f8b92
Component: engine
2016-01-10 19:55:24 +00:00
fd32c5b230 Add i386 specific modify_ldt syscall to default seccomp filter
This syscall is used by Go on i386 binaries, although not by libc.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: 13a9d4e8993997b2bf9be7e96a8d7978a73d0b9b
Component: engine
2016-01-10 12:00:11 +00:00
d9a92e1dc3 Choose default-cgroup parent by cgroup driver
It's "/docker" for cgroupfs and "system.slice" for systemd.

Fix #19140

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c1cd45d547ef26cf988dc72d456430361dafcf08
Component: engine
2016-01-07 08:56:26 -08:00
f720f8755b Merge pull request #19110 from brahmaroutu/update_openc
update runc to the latest code base to fix gccgo builds
Upstream-commit: 4ee3048fa8382f9e9af2418029b8e53885bb906a
Component: engine
2016-01-06 15:09:11 -08:00
4d9fdc3032 fix proc regex
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 2b4f64e59018c21aacbf311d5c774dd5521b5352
Component: engine
2016-01-06 10:08:35 -08:00
4da63ae80d update runc to the latest code base to fix gccgo build
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 998263170750ee5504bc4fe23f9a3d1f797e2a41
Component: engine
2016-01-06 00:02:56 +00:00
f1e6f39a8c Allow the waitpid syscall
This version is sometimes used eg by glibc on x86

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: 822c4f79ab5c84d48bbdd5534cdfd98990cdcee7
Component: engine
2016-01-05 09:29:16 -08:00
92f421f9e7 Support compatible architectures with default seccomp rules
In the default seccomp rule, allow use of 32 bit syscalls on
64 bit architectures, so you can run x86 Linux images on x86_64
without disabling seccomp or using a custom rule.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: ca3ae72e43a0e6ad2f4f548586110c2e296ae1e9
Component: engine
2016-01-05 09:28:42 -08:00
cd434f010f Allow sigreturn syscall
This is used on some 32 bit architectures, eg x86

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: d8e06d54cf3f6478ba85f60cca4a9b03bbc68f10
Component: engine
2016-01-04 16:11:59 -08:00
31f24aba30 Add _llseek syscall
This is the newer verion of lseek on many 32 bit platforms

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: 923609179b18fb5fc9d4ad7820646af7e09786a2
Component: engine
2016-01-04 11:55:28 -08:00
2c12c040cd Do not allow obsolete syscalls
sysfs and ustat syscalls are marked obsolete.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: d6a9c5abed7370d9ef20b488e315b9730f22ed44
Component: engine
2016-01-04 11:55:28 -08:00
c09b757a5f Do not allow name_to_handle_at, as we have already blocked open_by_handle_at
Being able to obtain a file handle is no use as we cannot perform
any operation in it, and it may leak kernel state.

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
Upstream-commit: c1b57fc1c9e230b95c2c76d1eaca0e3622fc72d5
Component: engine
2016-01-04 11:55:27 -08:00
93a585808e add 32bit syscalls to whitelist
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: a1747b3cc861c00803a67e5a61dce73db6ac8eee
Component: engine
2016-01-04 11:55:26 -08:00
f435c7102a change seccomp blacklist to whitelist
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 17735c3c98056006b40834d7426d8d90afae5a2c
Component: engine
2016-01-04 11:55:21 -08:00
da10444c78 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>
Upstream-commit: 9a03967f0abae4cc1dca00f339c58c31579c45b5
Component: engine
2016-01-02 19:55:37 +01:00
80207e0951 Merge pull request #18974 from jfrazelle/remove-seccomp-from-seccomp-profile
remove seccomp from seccomp profile
Upstream-commit: abc695d9d540610546e860ed5a9e432685b924b3
Component: engine
2015-12-29 13:15:14 -08:00
1149d92821 Merge pull request #18969 from justincormack/vm86
Block vm86 syscalls in default seccomp profile
Upstream-commit: a81e438544500a121298c82f340db490efda8a86
Component: engine
2015-12-29 11:57:35 -08:00
44a3b715ef Merge pull request #18972 from justincormack/bpf
Block bpf syscall from default seccomp profile
Upstream-commit: 2307f47fdd2b3079cb623a69b0fa0a0ef502c624
Component: engine
2015-12-29 11:57:07 -08:00
ed8f5303d0 Merge pull request #18971 from justincormack/ptrace
Block additional ptrace related syscalls in default seccomp profile
Upstream-commit: e01cab1cc5c7f92747a479b5480ca78f7fc37101
Component: engine
2015-12-29 11:56:51 -08:00
ba9125a4e7 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>
Upstream-commit: b610fc226afdf663b0ad46ad982c27fdee61f671
Component: engine
2015-12-29 11:21:33 -08:00
9e1ed3e829 Merge pull request #18947 from jfrazelle/fix-seccomp-unsupported
fix default profile where unsupported
Upstream-commit: 94e076086820aa34e6fc4fadb18714cd8b9263df
Component: engine
2015-12-29 10:21:07 -08:00
0adeca917f Merge pull request #18953 from justincormack/robust_list
Allow use of robust list syscalls in default seccomp policy
Upstream-commit: afdc4747dc16d4302ffd4f5dcb0fc537108862b7
Component: engine
2015-12-29 10:19:41 -08:00
f88929edd0 Merge pull request #18956 from justincormack/umount
Block original umount syscall in default seccomp filter
Upstream-commit: a32b06b067f847ee2cefe104430499c425c8fc2c
Component: engine
2015-12-29 10:19:04 -08:00
c726c9026e 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>
Upstream-commit: a0a8ca0ae0bc9dc7faa0b8bacf4ca376c7257348
Component: engine
2015-12-29 18:17:28 +00:00
42db75c945 Merge pull request #18959 from justincormack/finit_module
Deny finit_module in default seccomp profile
Upstream-commit: ad8bce2ce4e27f7484fc65a3e6b9bf111793a263
Component: engine
2015-12-29 10:12:50 -08:00
00259400b7 Merge pull request #18961 from justincormack/clock_adjtime
Block clock_adjtime in default seccomp config
Upstream-commit: 8ac3d083a856729bc78adad3924e85d73d07173f
Component: engine
2015-12-29 10:08:45 -08:00
cb797e315a 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>
Upstream-commit: 33568405f34f363de49b1146119cc53bcb9e5f16
Component: engine
2015-12-29 17:28:30 +00:00
e76b5dd895 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>
Upstream-commit: 6c3ea7a511ca641cdf4fa4da1d775d5b6f4bef3e
Component: engine
2015-12-29 15:47:23 +00:00
d33f2d3ddd 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>
Upstream-commit: 6300a08be905969b16197f6a82a3d0d99a3f99cd
Component: engine
2015-12-29 15:28:05 +00:00
55ebb7bfa4 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>
Upstream-commit: 0e5c43cddad304301ca8a82f652e15f75ee68cfe
Component: engine
2015-12-29 12:48:16 +00:00
40aa142ae9 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>
Upstream-commit: 0d5306a0b69c912a981f3a4bd41b80beb1207851
Component: engine
2015-12-29 12:31:33 +00:00
e02645b0cd 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>
Upstream-commit: 9be0d93cf74d1bb31c401f1154abc773af31cbd6
Component: engine
2015-12-29 11:57:16 +00:00
b5183e0bab 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>
Upstream-commit: 7b133e7235593f8d46832045da339395e71e8148
Component: engine
2015-12-29 10:22:05 +00:00
bc484831ec fix code comment
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: b4c14a0bb846343c6d6d5dde6d9259c2c62a0b1e
Component: engine
2015-12-28 22:36:54 -08:00
8002590c16 fix default profile where unsupported
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 94b45310f400310af908a71f63ffcdaa504266de
Component: engine
2015-12-28 20:42:15 -08:00