]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
6 years agoconf: va_end was not called.
Donghwa Jeong [Tue, 29 May 2018 13:01:27 +0000 (22:01 +0900)] 
conf: va_end was not called.

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agonetwork: fix socket handle leak
Donghwa Jeong [Mon, 28 May 2018 04:42:45 +0000 (13:42 +0900)] 
network: fix socket handle leak

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agoutils: fix task_blocking_signal()
Christian Brauner [Sat, 26 May 2018 12:22:51 +0000 (14:22 +0200)] 
utils: fix task_blocking_signal()

Closes #2342.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435803
Christian Brauner [Sat, 26 May 2018 01:22:58 +0000 (03:22 +0200)] 
coverity: #1435803

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435805
Christian Brauner [Sat, 26 May 2018 01:21:05 +0000 (03:21 +0200)] 
coverity: #1435805

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: fix lxc-create with global config value II
Christian Brauner [Fri, 25 May 2018 17:35:00 +0000 (19:35 +0200)] 
tools: fix lxc-create with global config value II

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: fix lxc-create with global config value
Christian Brauner [Fri, 25 May 2018 13:43:59 +0000 (15:43 +0200)] 
tools: fix lxc-create with global config value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: order architectures
Christian Brauner [Thu, 24 May 2018 22:12:46 +0000 (00:12 +0200)] 
confile: order architectures

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: fix fd leaks when sending signals
Christian Brauner [Thu, 24 May 2018 22:00:50 +0000 (00:00 +0200)] 
lxccontainer: fix fd leaks when sending signals

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: fix task_blocking_signal()
Christian Brauner [Thu, 24 May 2018 18:45:29 +0000 (20:45 +0200)] 
utils: fix task_blocking_signal()

sscanf() skips whitespace anyway so don't account for tabs in case the file
layout changes.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: s/sigprocmask/pthread_sigmask()/g
Christian Brauner [Thu, 24 May 2018 18:29:48 +0000 (20:29 +0200)] 
tree-wide: s/sigprocmask/pthread_sigmask()/g

The behavior of sigprocmask() is unspecified in multi-threaded programs. Let's
use pthread_sigmask() instead.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-init: skip signals that can't be caught
Christian Brauner [Tue, 22 May 2018 21:26:03 +0000 (23:26 +0200)] 
lxc-init: skip signals that can't be caught

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425802
Simos Xenitellis [Tue, 15 May 2018 11:34:38 +0000 (11:34 +0000)] 
coverity: #1425802

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocapabilities: raise ambient capabilities
Christian Brauner [Tue, 15 May 2018 19:33:48 +0000 (21:33 +0200)] 
capabilities: raise ambient capabilities

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Jonathan Calmels <jcalmels@nvidia.com>
6 years agoconfig: allow read-write /sys in user namespace
Christian Brauner [Sun, 13 May 2018 13:02:09 +0000 (15:02 +0200)] 
config: allow read-write /sys in user namespace

Unprivileged containers can safely mount /sys as read-write. This also allows
systemd-udevd to be started in unprivileged containers.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425844
Simos Xenitellis [Tue, 15 May 2018 11:37:14 +0000 (11:37 +0000)] 
coverity: #1425844

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1248106
Simos Xenitellis [Tue, 15 May 2018 00:05:13 +0000 (00:05 +0000)] 
coverity: #1248106

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1425836
Simos Xenitellis [Tue, 15 May 2018 00:19:12 +0000 (00:19 +0000)] 
coverity: #1425836

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1435603
Christian Brauner [Tue, 15 May 2018 10:34:24 +0000 (12:34 +0200)] 
coverity: #1435603

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435604
Christian Brauner [Tue, 15 May 2018 10:33:22 +0000 (12:33 +0200)] 
coverity: #1435604

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoRevert "tools: s/strncpy()/strlcpy()/g"
Christian Brauner [Fri, 11 May 2018 13:56:58 +0000 (15:56 +0200)] 
Revert "tools: s/strncpy()/strlcpy()/g"

This reverts commit 2ec47d5149e73db97f7877d06d67cb11421097bb.

First, I forgot to actually replace strncpy() with strlcpy(). Second, we don't
want to \0-terminate since this is an abstract unix socket and this is not
required. Instead, let's simply use memcpy() which is more correct and also
silences gcc-8.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: s/strncpy()/strlcpy()/g
Christian Brauner [Fri, 11 May 2018 13:19:45 +0000 (15:19 +0200)] 
tools: s/strncpy()/strlcpy()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: add section about using strlcpy()
Christian Brauner [Fri, 11 May 2018 11:02:41 +0000 (13:02 +0200)] 
CODING_STYLE: add section about using strlcpy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: s/strncpy()/strlcpy()/g
Christian Brauner [Fri, 11 May 2018 10:58:11 +0000 (12:58 +0200)] 
tree-wide: s/strncpy()/strlcpy()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostrlcpy: add strlcpy() implementation
Christian Brauner [Fri, 11 May 2018 10:57:51 +0000 (12:57 +0200)] 
strlcpy: add strlcpy() implementation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoautodev: adapt to changes in Linux 4.18
Christian Brauner [Sun, 14 Oct 2018 09:42:29 +0000 (11:42 +0200)] 
autodev: adapt to changes in Linux 4.18

Starting with commit
55956b59df33 ("vfs: Allow userns root to call mknod on owned filesystems.")
Linux will allow mknod() in user namespaces for userns root if CAP_MKNOD is
available.
However, these device nodes are useless since

static struct super_block *alloc_super(struct file_system_type *type, int flags,
                                       struct user_namespace *user_ns)
{
    /* <snip> */

    if (s->s_user_ns != &init_user_ns)
            s->s_iflags |= SB_I_NODEV;

    /* <snip> */
}

will set the SB_I_NODEV flag on the filesystem. When a device node created in
non-init userns is open()ed the call chain will hit:

bool may_open_dev(const struct path *path)
{
    return !(path->mnt->mnt_flags & MNT_NODEV) &&
            !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV);
}

which will cause an EPERM because the device node is located on an fs
owned by non-init-userns and thus doesn't grant access to device nodes due to
SB_I_NODEV.

This commit enables LXC to deal with such kernels.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: adhere to IFNAMSIZ limit
Christian Brauner [Thu, 10 May 2018 22:54:47 +0000 (00:54 +0200)] 
network: adhere to IFNAMSIZ limit

The additional \0-byte space added is not needed since IFNAMSIZ needs to
include the \0-byte.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: silence gcc-8
Christian Brauner [Thu, 10 May 2018 22:52:33 +0000 (00:52 +0200)] 
network: silence gcc-8

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: account for terminating \0 byte
Christian Brauner [Thu, 10 May 2018 18:25:08 +0000 (20:25 +0200)] 
utils: account for terminating \0 byte

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425744
Christian Brauner [Tue, 1 May 2018 15:27:51 +0000 (17:27 +0200)] 
coverity: #1425744

Dereference after null check

userns_exec_{1,full} are called from functions that might not have a conf.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agogenl: remove
Christian Brauner [Tue, 1 May 2018 14:59:19 +0000 (16:59 +0200)] 
genl: remove

These files have never been used and as such have no dependencies in the
codebase whatsoever. So remove them. If we need them we can simply pull them
out of the git history.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoexecute: account for -o path option count
Tycho Andersen [Wed, 9 May 2018 01:29:06 +0000 (01:29 +0000)] 
execute: account for -o path option count

This always works fine... until your exec() fails and you try to go and
free it, you've overwritten the allocator's metadata (and potentially other
stuff) and it fails.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agolxc-unshare: add missing declaration
Christian Brauner [Thu, 23 Aug 2018 21:11:13 +0000 (23:11 +0200)] 
lxc-unshare: add missing declaration

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoexecute: do not check inherited fds again
Christian Brauner [Tue, 8 May 2018 15:58:36 +0000 (17:58 +0200)] 
execute: do not check inherited fds again

This is already done in do_lxcapi_start{l}() so a) no need to do it again here
and b) this would close the state socket pair sockets, corrup the fd, and lead
to EBADF.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoexecute: use static buffer
Christian Brauner [Fri, 4 May 2018 09:59:27 +0000 (11:59 +0200)] 
execute: use static buffer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofix logic for execute log file
Tycho Andersen [Thu, 3 May 2018 18:32:19 +0000 (18:32 +0000)] 
fix logic for execute log file

The problem here is that lxc-init runs *inside* the container. So if a
person has the log file set to /home/$USER/foo, lxc-init ends up making a
directory /home/$USER/foo inside the container to put the log file in. What
we really want are the logs to be propagated from inside the container to
the outside. We accomplish this by passing an fd without O_CLOEXEC, and
telling lxc-init to log to that file.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agocoverity: #1435263
Christian Brauner [Mon, 30 Apr 2018 10:18:23 +0000 (12:18 +0200)] 
coverity: #1435263

Use after free

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:58:06 +0000 (16:58 +0200)] 
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:56:58 +0000 (16:56 +0200)] 
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 13:08:46 +0000 (15:08 +0200)] 
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_unfreeze()
Christian Brauner [Sun, 29 Apr 2018 12:53:12 +0000 (14:53 +0200)] 
lxccontainer: do_lxcapi_unfreeze()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_freeze()
Christian Brauner [Sun, 29 Apr 2018 12:52:40 +0000 (14:52 +0200)] 
lxccontainer: do_lxcapi_freeze()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_is_running()
Christian Brauner [Sun, 29 Apr 2018 12:49:36 +0000 (14:49 +0200)] 
lxccontainer: do_lxcapi_is_running()

There's no need to do string comparisons.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 12:48:08 +0000 (14:48 +0200)] 
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: use thread-safe *_OFD_* locks
Christian Brauner [Sun, 29 Apr 2018 11:39:28 +0000 (13:39 +0200)] 
lxccontainer: use thread-safe *_OFD_* locks

If they aren't available fallback to BSD flock()s.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435198
Christian Brauner [Sat, 28 Apr 2018 22:50:50 +0000 (00:50 +0200)] 
coverity: #1435198

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435205
Christian Brauner [Sat, 28 Apr 2018 22:38:29 +0000 (00:38 +0200)] 
coverity: #1435205

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435207
Christian Brauner [Sat, 28 Apr 2018 22:22:54 +0000 (00:22 +0200)] 
coverity: #1435207

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435208
Christian Brauner [Sat, 28 Apr 2018 22:21:33 +0000 (00:21 +0200)] 
coverity: #1435208

Unused value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoFix memory leak in list_active_containers
LiFeng [Tue, 24 Apr 2018 19:10:15 +0000 (15:10 -0400)] 
Fix memory leak in list_active_containers

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agoFix the memory leak in cgfsng_attach
LiFeng [Tue, 24 Apr 2018 16:53:57 +0000 (12:53 -0400)] 
Fix the memory leak in cgfsng_attach

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agodo_lxcapi_create: set umask
Kaarle Ritvanen [Sun, 15 Apr 2018 11:50:28 +0000 (14:50 +0300)] 
do_lxcapi_create: set umask

Always use 022 as the umask when creating the rootfs directory and
executing the template. A too loose umask may cause security issues.
A too strict umask may cause programs to fail inside the container.

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
6 years agoconf: ret-try devpts mount without gid=5 on error
Christian Brauner [Thu, 12 Apr 2018 09:12:06 +0000 (11:12 +0200)] 
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>
6 years agoutils: define __NR_setns if missing on old glibcs
Christian Brauner [Tue, 10 Apr 2018 10:27:39 +0000 (12:27 +0200)] 
utils: define __NR_setns if missing on old glibcs

Closes #2248.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc init: coding style
Christian Brauner [Mon, 9 Apr 2018 18:44:14 +0000 (20:44 +0200)] 
lxc init: coding style

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc init: remove dead code
C0deAi [Fri, 6 Apr 2018 15:30:06 +0000 (11:30 -0400)] 
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>
6 years agofix signal sending in lxc.init
Tycho Andersen [Wed, 4 Apr 2018 23:45:29 +0000 (17:45 -0600)] 
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>
6 years agolocktests: fix test suite
Christian Brauner [Fri, 30 Mar 2018 05:53:02 +0000 (07:53 +0200)] 
locktests: fix test suite

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxclock: use thread-safe *_OFD_* fcntl() locks
Christian Brauner [Fri, 30 Mar 2018 04:54:40 +0000 (06:54 +0200)] 
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>
6 years agostart: always make us dumpable
Christian Brauner [Mon, 26 Mar 2018 21:03:28 +0000 (23:03 +0200)] 
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>
6 years agoconf: simplify lxc_fill_autodev()
Christian Brauner [Sun, 25 Mar 2018 12:33:44 +0000 (14:33 +0200)] 
conf: simplify lxc_fill_autodev()

This function was way more syscall heavy than it needed to be.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoRename ifup/down and remove usless parameter passing
fliiiix [Thu, 22 Mar 2018 15:18:59 +0000 (16:18 +0100)] 
Rename ifup/down and remove usless parameter passing

Signed-off-by: Felix <de-ch@hotmail.de>
6 years agofix handler use-after-free
Tycho Andersen [Thu, 15 Mar 2018 15:29:27 +0000 (15:29 +0000)] 
fix handler use-after-free

The problem here is that __lxc_start frees the handler, so any use
afterwards is invalid. Since we don't have access to the actual struct
lxc_container object in __lxc_start, let's pass a pointer to error_num in
so it can be returned.

Unfortunately, I'm a little too paranoid to change the return type of
lxc_start, since it returns failure if some of the cleanup fails, which
may be useful in some cases. So let's keep this out of band.

Closes #2218
Closes #2219

Reported-by: Felix Abecassis <fabecassis@nvidia.com>
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoconf: fix clang warning when building w/o libcap
Igor Galić [Wed, 14 Mar 2018 15:53:24 +0000 (16:53 +0100)] 
conf: fix clang warning when building w/o libcap

when compiling lxc with clang-5.0 parse_cap()'s main loop will produce a
warning about a tautological comparision (#2215).

By moving the result of computation into a variable (end) this is no
longer a constant expression. clang-5.0 does not do dataflow analysis at
this point, so it is, to quote someone from #llvm, "morally equivalent"
to casting `(int)i`.

in addition, we also clean up the #if HAVE_LIBCAP to no longer need
its #else branch!

Signed-off-by: Igor Galić <igor.galic@automatic-server.com>
6 years agoRevert "cgroups: don't escape if we're not real root"
Serge Hallyn [Tue, 13 Mar 2018 17:55:02 +0000 (12:55 -0500)] 
Revert "cgroups: don't escape if we're not real root"

This reverts commit 8d961e28f1d759669b477a659cbb694aaa2af915.

Unfortunately I don't believe the check is correct in the general case.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
6 years agocgroups: don't escape if we're not real root
Tycho Andersen [Tue, 13 Mar 2018 15:57:10 +0000 (15:57 +0000)] 
cgroups: don't escape if we're not real root

If we're host unpriv but root in our userns, we can't really escape
cgroups. Let's switch the cgroup escape test to reflect this.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agousernsexec: init log fd
Tycho Andersen [Mon, 12 Mar 2018 15:39:37 +0000 (09:39 -0600)] 
usernsexec: init log fd

lxc-usernsexec uses some functions (e.g. lxc_map_ids()), which are part of
the lxc library and thus use the WARN etc. macros to emit log messages.
However, it doesn't initialize the log in any way, so these messages go
into the ether.

lxc-usernsexec currently has no log parameters, so let's just log these to
stderr. Someone can do something fancier later if they want.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoAdd a workaround for a build issue with old versions of libcap
Felix Abecassis [Sat, 3 Mar 2018 06:01:56 +0000 (22:01 -0800)] 
Add a workaround for a build issue with old versions of libcap

Fixes: #2178
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoCODING_STYLE: add languages to highlight
Christian Brauner [Fri, 2 Mar 2018 11:57:18 +0000 (12:57 +0100)] 
CODING_STYLE: add languages to highlight

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: arrays of structs
Christian Brauner [Fri, 2 Mar 2018 11:50:55 +0000 (12:50 +0100)] 
CODING_STYLE: arrays of structs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: clang-format
Christian Brauner [Fri, 2 Mar 2018 11:29:30 +0000 (12:29 +0100)] 
CODING_STYLE: clang-format

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: remove duplicate _exit() entry
Christian Brauner [Fri, 2 Mar 2018 11:18:38 +0000 (12:18 +0100)] 
CODING_STYLE: remove duplicate _exit() entry

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfig: start with a full capability set
Christian Brauner [Thu, 1 Mar 2018 16:09:44 +0000 (17:09 +0100)] 
config: start with a full capability set

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agomainloop: add LXC_MAINLOOP_ERROR
Christian Brauner [Wed, 28 Feb 2018 10:50:12 +0000 (11:50 +0100)] 
mainloop: add LXC_MAINLOOP_ERROR

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: non-functional changes
Christian Brauner [Tue, 27 Feb 2018 14:57:16 +0000 (15:57 +0100)] 
cgfsng: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc_init: don't mount filesystems
Serge Hallyn [Tue, 27 Feb 2018 18:05:30 +0000 (12:05 -0600)] 
lxc_init: don't mount filesystems

We have an extensive set of container config options to do this
for us, and doing this unconditionally breaks several use cases.
For instance, if we want to bind mount a /dev/shm using the
container configuration, then lxc-execute, then lxc-init will
rudely unmount the /dev/shm and remount it as a private tmpfs.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
6 years agolxc-snapshot: fix segfault
Christian Brauner [Mon, 26 Feb 2018 14:30:56 +0000 (15:30 +0100)] 
lxc-snapshot: fix segfault

https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1751780

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocommands: remove mutex from state client list
Christian Brauner [Mon, 26 Feb 2018 10:43:42 +0000 (11:43 +0100)] 
commands: remove mutex from state client list

I was thinking about the locking here yesterday and it dawned on me that we
actually don't need this at all:
- possible contention between traversing list to send states to state clients
  and adding new state clients to the list:
  It is the command handler that adds new state clients to the state client
  list. The command handler and the code that actually sends out the container
  states run in the same process so there's not contention and thus no locking
  needed.
- adding state clients to the list from multiple threads:
  The command handler itself is single-threaded so only one thread's request can
  be served at the same time so no locking is needed.
- sending out the state to state clients via the command handler itself:
  The state client also adds and removes state clients from the state client
  list so there's no locking needed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: add section about _exit()
Christian Brauner [Mon, 26 Feb 2018 10:21:51 +0000 (11:21 +0100)] 
CODING_STYLE: add section about _exit()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofix download template for /tmp as tmpfs or noexec
Stuart Cardall [Sun, 25 Feb 2018 11:50:13 +0000 (11:50 +0000)] 
fix download template for /tmp as tmpfs or noexec

* prepend $LXC_PATH to $DOWNLOAD_TEMP on systems with /tmp mounted
  securely as a small tmpfs / noexec

* gpg_setup() creates $DOWNLOAD_TEMP so remove superflous mkdir

* fixes https://github.com/lxc/lxc/issues/516

Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
6 years agocgfsng: fix get_hierarchy() for unified hierarchy
Christian Brauner [Sat, 24 Feb 2018 20:36:20 +0000 (21:36 +0100)] 
cgfsng: fix get_hierarchy() for unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: du_dump()
Christian Brauner [Sat, 24 Feb 2018 19:12:51 +0000 (20:12 +0100)] 
criu: du_dump()

thread-safety: s/exit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: do_restore()
Christian Brauner [Sat, 24 Feb 2018 19:12:16 +0000 (20:12 +0100)] 
criu: do_restore()

thread-safety: s/exit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: criu_version_ok()
Christian Brauner [Sat, 24 Feb 2018 19:11:45 +0000 (20:11 +0100)] 
criu: criu_version_ok()

thread-safety: s/exit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: create_container_dir()
Christian Brauner [Sat, 24 Feb 2018 14:30:56 +0000 (15:30 +0100)] 
lxccontainer: create_container_dir()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_create_container_dir()
Christian Brauner [Sat, 24 Feb 2018 14:29:33 +0000 (15:29 +0100)] 
lxccontainer: do_create_container_dir()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: lxcapi_startl()
Christian Brauner [Sat, 24 Feb 2018 14:26:35 +0000 (15:26 +0100)] 
lxccontainer: lxcapi_startl()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: lxcapi_start()
Christian Brauner [Sat, 24 Feb 2018 14:25:44 +0000 (15:25 +0100)] 
lxccontainer: lxcapi_start()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: free_init_cmd()
Christian Brauner [Sat, 24 Feb 2018 14:24:47 +0000 (15:24 +0100)] 
lxccontainer: free_init_cmd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: split_init_cmd()
Christian Brauner [Sat, 24 Feb 2018 14:24:29 +0000 (15:24 +0100)] 
lxccontainer: split_init_cmd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: push_arg()
Christian Brauner [Sat, 24 Feb 2018 14:23:03 +0000 (15:23 +0100)] 
lxccontainer: push_arg()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: am_single_threaded()
Christian Brauner [Sat, 24 Feb 2018 14:22:38 +0000 (15:22 +0100)] 
lxccontainer: am_single_threaded()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_wait()
Christian Brauner [Sat, 24 Feb 2018 14:22:04 +0000 (15:22 +0100)] 
lxccontainer: do_lxcapi_wait()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_want_close_all_fds()
Christian Brauner [Sat, 24 Feb 2018 14:21:38 +0000 (15:21 +0100)] 
lxccontainer: do_lxcapi_want_close_all_fds()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_want_daemonize()
Christian Brauner [Sat, 24 Feb 2018 14:21:16 +0000 (15:21 +0100)] 
lxccontainer: do_lxcapi_want_daemonize()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_load_config()
Christian Brauner [Sat, 24 Feb 2018 14:20:50 +0000 (15:20 +0100)] 
lxccontainer: do_lxcapi_load_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: load_config_locked()
Christian Brauner [Sat, 24 Feb 2018 14:19:59 +0000 (15:19 +0100)] 
lxccontainer: load_config_locked()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: lxcapi_console()
Christian Brauner [Sat, 24 Feb 2018 14:19:19 +0000 (15:19 +0100)] 
lxccontainer: lxcapi_console()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_console_getfd()
Christian Brauner [Sat, 24 Feb 2018 14:18:55 +0000 (15:18 +0100)] 
lxccontainer: do_lxcapi_console_getfd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_unfreeze()
Christian Brauner [Sat, 24 Feb 2018 14:18:30 +0000 (15:18 +0100)] 
lxccontainer: do_lxcapi_unfreeze()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>