Commit Graph

6961 Commits

Author SHA1 Message Date
Stéphane Graber
a55e2ad107
Merge pull request #2275 from brauner/2018-04-13/improve_seccomp
seccomp: handle all errors
2018-04-13 18:20:33 +02:00
Christian Brauner
adfee3a873
seccomp: handle all errors
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-13 18:00:23 +02:00
Serge Hallyn
2c80e9cf15
Merge pull request #2274 from brauner/2018-04-13/fix_seccomp_with_personality_and_64bit_kernel_32_bit_userspace
seccomp: handle arch inversion
2018-04-13 10:29:18 -05:00
Christian Brauner
b5ed021bbc
seccomp: handle arch inversion
This commit deals with different kernel and userspace layouts and nesting. Here
are three examples:
1. 64bit kernel and 64bit userspace running 32bit containers
2. 64bit kernel and 32bit userspace running 64bit containers
3. 64bit kernel and 64bit userspace running 32bit containers running 64bit containers
Two things to lookout for:
1. The compat arch that is detected might have already been present in the main
   context. So check that it actually hasn't been and only then add it.
2. The contexts don't need merging if the architectures are the same and also can't be.
With these changes I can run all crazy/weird combinations with proper seccomp
isolation.

Closes #654.

Link: https://bugs.chromium.org/p/chromium/issues/detail?id=832366
Reported-by: Chirantan Ekbote <chirantan@chromium.org>
Reported-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-13 14:11:09 +02:00
Christian Brauner
bf5afb0174
Merge pull request #2273 from aither64/master
conf: fix net type checks in run_script_argv()
2018-04-13 10:39:05 +02:00
Jakub Skokan
a81442634e conf: fix net type checks in run_script_argv()
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
2018-04-13 09:03:20 +02:00
Serge Hallyn
465c891a7b
Merge pull request #2272 from brauner/2018-04-12/bugfixes
conf: ret-try devpts mount without gid=5 on error
2018-04-12 11:31:05 -05:00
Christian Brauner
794248d09d
execute: fix app containers without root mapping
When starting application containers without a mapping for container root are
started, a dummy bind-mount target for lxc-init needs to be created. This will
not always work directly under "/" when e.g. permissions are missing due to the
ownership and/or mode of "/". We can try to work around this by using the
P_tmpdir as defined in POSIX which should usually land us in /tmp where
basically everyone can create files.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-12 17:37:53 +02:00
Christian Brauner
112930688b
conf: ret-try devpts mount without gid=5 on error
We should always default to mounting devpts with gid=5 but we should fallback
to mounting without gid=5. This let's us cover use-cases such as container
started with only a single mapping e.g.:

lxc.idmap = u 1000 1000 1
lxc.idmap = g 1000 1000 1

Closes #2257.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-12 12:48:58 +02:00
Serge Hallyn
855452aede
Merge pull request #2270 from brauner/2018-04-11/attach_try_dropping_supplementary_groups
attach: try to always drop supplementary groups
2018-04-11 18:00:35 -05:00
Serge Hallyn
33c7c7feb2
Merge pull request #2259 from gjaekel/patch-1
rootfs pinning: On NFS, make file hidden but don't delete it
2018-04-11 12:24:59 -05:00
Christian Brauner
96ec54acf8
attach: try to always drop supplementary groups
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-11 17:35:57 +02:00
Stéphane Graber
3d435963b7
Merge pull request #2266 from brauner/2018-04-09/attach_drop_suppl_groups
attach: always drop supplementary groups
2018-04-10 14:14:34 +02:00
Christian Brauner
9e320621fd
utils: define __NR_setns if missing on old glibcs
Closes #2248.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-10 12:27:39 +02:00
Christian Brauner
e456a1ef55
Merge pull request #2267 from brauner/QbitLogic-master
Mergeable branch for C0deAi fixes
2018-04-09 21:00:36 +02:00
Christian Brauner
d6d727aff1
lxc init: coding style
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 20:44:14 +02:00
C0deAi
74269047b4
tools/utils: free memory on error
Closes #2262.

Signed-off-by: C0deAi <techsupport@mycode.ai>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 20:40:13 +02:00
C0deAi
55d83a7c72
storage/rsync: free memory on error
Closes #2262.

Signed-off-by: C0deAi <techsupport@mycode.ai>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 20:40:09 +02:00
C0deAi
125a2e044c
lxc init: remove dead code
Value stored is never read.

Closes #2262.

Signed-off-by: C0deAi <techsupport@mycode.ai>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 20:40:02 +02:00
Christian Brauner
24927339bd
attach: always drop supplementary groups
Closes #1704.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-09 18:01:38 +02:00
Christian Brauner
4e256f6fe1
Merge pull request #2263 from ffontaine/master
Fix compilation with static libcap and shared gnutls
2018-04-09 10:15:09 +02:00
Fabrice Fontaine
49bc916b1d Fix compilation with static libcap and shared gnutls
Commit c06ed219c4 has broken
compilation with a static libcap and a shared gnutls.
This results in a build failure on init_lxc_static if gnutls is
a shared library as init_lxc_static is built with -all-static option
(see src/lxc/Makefile.am) and AC_CHECK_LIB adds gnutls to LIBS.

This commit fix the issue by removing default behavior of AC_CHECK_LIB
and handling manually GNUTLS_LIBS and HAVE_LIBGNUTLS

Fixes:
 - http://autobuild.buildroot.net/results/b655d6853c25a195df28d91512b3ffb6c654fc90

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-04-07 18:12:12 +02:00
Christian Brauner
5eda487c1c
Merge pull request #2261 from brauner/2018-04-06/thmo_patch_1
Fix temp file creation
2018-04-06 16:24:25 +02:00
Christian Brauner
709384a02e
ringbuf: fix temporary file creation
lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
template to contain 'XXXXXX' and be writable.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-06 10:54:41 +02:00
Christian Brauner
a324e7eba0
conf: fix temporary file creation
lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
template to contain 'XXXXXX' and be writable.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-06 10:54:02 +02:00
Guido Jäkel
63fc76c3e0
rootfs pinning: On NFS, make file hidden but don't delete it
On NFS, avoid random names of the root pin file due to "NFS silly renaming" but use a fixed hidden name instead.
2018-04-06 09:35:21 +02:00
Serge Hallyn
83ffaa1d39
Merge pull request #2258 from tych0/fix-signal-sending-to-lxc-init
fix signal sending in lxc.init
2018-04-05 16:03:44 -05:00
Tycho Andersen
9cb943843a fix signal sending in lxc.init
The problem here is that these two clauses were ordered backwards: we first
check if the signal came from not the init pid, and if it did, then we give
a notice and return. The comment notes that this is intended to protect
against SIGCHLD, but we don't in fact know if the signal is a SIGCHLD yet,
because that's tested in the next hunk.

The symptom is that if I e.g. send SIGTERM from the outside world to the
container init, it ignores it and gives this notice. If we re-order these
clauses, it forwards non SIGCHLD signals, and ignores SIGCHLD signals from
things that aren't the real container process.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-04-04 17:50:50 -06:00
Christian Brauner
22b2b9c87c
Merge pull request #2256 from tenforward/japanese
doc: Tweak Japanese translation in lxc.container.conf(5)
2018-04-03 15:00:08 +02:00
KATOH Yasufumi
09dd49ab20 doc: Tweak Japanese translation in lxc.container.conf(5)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2018-04-03 21:29:09 +09:00
Christian Brauner
94b437d17d
Merge branch 'FengtuWang-make_rslave' into lxc/master 2018-04-02 15:58:06 +02:00
Fengtu Wang
e599717bc5
conf: ensure umounts don't propagate to host
Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-04-02 15:56:40 +02:00
Stéphane Graber
0474e8a8e5
Merge pull request #2247 from brauner/2018-03-31/expand_lxc_environment
confile: expand lxc.environment
2018-04-02 01:08:39 -04:00
Christian Brauner
5eab47bce5
confile: expand lxc.environment
When a bare environment variable is specified then retrieve the value from the
current environment. For example, setting

lxc.environment = PATH

will cause LXC to inherit the value of PATH from the current environment.

Suggested-by: Jonathan Calmels <jcalmels@nvidia.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-31 17:57:00 +02:00
Stéphane Graber
dae29309e3
Merge pull request #2244 from brauner/2018-03-29/fixup
bugfixes
2018-03-30 11:29:56 -04:00
Christian Brauner
59ecb672d0
locktests: fix test suite
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-30 07:53:02 +02:00
Christian Brauner
b19aabf5be
lxclock: use thread-safe *_OFD_* fcntl() locks
If they aren't available fallback to BSD flock()s.

Closes #2245.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-30 07:30:00 +02:00
Christian Brauner
68c084cbd9
Merge pull request #2246 from flx42/lxc-oci-cmd-parsing-and-umoci
lxc-oci: cmd parsing and less verbose umoci
2018-03-29 12:31:54 -07:00
Felix Abecassis
845ba283d6 lxc-oci: make umoci less verbose
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:21:22 -07:00
Felix Abecassis
d99e3b2ea7 lxc-oci: fix Cmd/Entrypoint parsing
Don't use the -r option of jq, since it will strip the double quotes.

Fixes: #2195
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-29 10:20:31 -07:00
Christian Brauner
16c92537a5
storage: fix lvm fs uuid generation
Closes #2241.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-29 18:29:49 +02:00
Christian Brauner
9104c79a1d
tools: fix unitialized variable
Closes #2242.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-29 18:20:35 +02:00
Stéphane Graber
5b66b6ee3e
Release LXC 3.0.0
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 21:49:16 -04:00
Stéphane Graber
21773a9522
Merge pull request #2239 from brauner/2018-03-27/fixup_action_script
Allow passing action scripts to CRIU
2018-03-27 16:49:34 -04:00
Eytan Heidingsfeld
590197542e
Allow passing action scripts to CRIU
Closes #2236.

Signed-off-by: Eytan Heidingsfeld <eytanh@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-27 22:33:48 +02:00
Christian Brauner
808108a949
Merge pull request #2238 from stgraber/master
configure.ac: Support redhatenterpriseserver
2018-03-27 13:02:33 -07:00
Stéphane Graber
b195038dfc
configure.ac: Support redhatenterpriseserver
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 15:21:51 -04:00
Stéphane Graber
769cf3c1cc
Release LXC 3.0.0.beta4
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-26 23:38:01 -04:00
Stéphane Graber
f4ffd9f873
Merge pull request #2237 from brauner/2018-03-26/always_make_dumpable
start: always make us dumpable
2018-03-26 18:11:31 -04:00
Christian Brauner
d788372535
start: always make us dumpable
Otherwise lxc.hook.mount hooks that try to inspect /proc/<pid>/*
will fail.

Cc: Jonathan Calmels <jcalmels@nvidia.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-26 23:04:12 +02:00