]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
7 years agoexecute: use execveat() syscall if supported 2341/head
Tycho Andersen [Tue, 22 May 2018 23:33:17 +0000 (23:33 +0000)] 
execute: use execveat() syscall if supported

The execveat allows us to exec stuff via a fd so we don't have to bind mount
stuff in. See the comment about why we're using the syscall directly.

Closes #2339.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
[christian.brauner@ubuntu.com: adapt error message and whitespace fixes]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2337 from brauner/2018-05-18/cgroup_rework
Serge Hallyn [Tue, 22 May 2018 19:48:39 +0000 (14:48 -0500)] 
Merge pull request #2337 from brauner/2018-05-18/cgroup_rework

cgroups: refactor cgroup handling

7 years agoconf: simplify write_id_mapping() 2337/head
Christian Brauner [Sat, 19 May 2018 20:51:29 +0000 (22:51 +0200)] 
conf: simplify write_id_mapping()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: #ifdef SCMP_ARCH_AARCH64
Christian Brauner [Sat, 19 May 2018 19:47:39 +0000 (21:47 +0200)] 
seccomp: #ifdef SCMP_ARCH_AARCH64

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocgroups: remove freezer_state()
Christian Brauner [Sat, 19 May 2018 19:28:12 +0000 (21:28 +0200)] 
cgroups: remove freezer_state()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocgroups: refactor cgroup handling
Christian Brauner [Fri, 18 May 2018 18:16:22 +0000 (20:16 +0200)] 
cgroups: refactor cgroup handling

This replaces the constructor implementation of cgroup handling with a simpler,
thread-safe on-demand model of cgroup driver initialization.
Making the cgroup initialization code run in a constructor means that each time
the shared library gets mapped the cgroup parsing code gets run. That's
unnecessary overhead.
It also feels to me that this is only accidently thread-safe because
constructors are only run once. But should threads actually end up manipulating
or freeing memory that is file-global to cgfsng.c we'd be screwed. Now, I might
be wrong here but the cleaner implementation is to allocate a cgroup driver on
demand whenever we need it.
Take the chance and rework the cgroup_ops interface to make the functions it
wants to have implemented a lot cleaner.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2328 from simos/fix-resource-leak-cid1425802
Christian Brauner [Thu, 17 May 2018 11:11:39 +0000 (13:11 +0200)] 
Merge pull request #2328 from simos/fix-resource-leak-cid1425802

coverity: #1425802

7 years agocoverity: #1425802 2328/head
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>
7 years agoMerge pull request #2324 from simos/fix-resource-leak-cid1248106
Christian Brauner [Wed, 16 May 2018 16:31:10 +0000 (18:31 +0200)] 
Merge pull request #2324 from simos/fix-resource-leak-cid1248106

Fixed resource leak in is_wlan() at network.c

7 years agoMerge pull request #2323 from simos/fix-resource-leak-cid1425836
Christian Brauner [Wed, 16 May 2018 16:15:29 +0000 (18:15 +0200)] 
Merge pull request #2323 from simos/fix-resource-leak-cid1425836

Fixed resource leak in userns_exec_full()

7 years agoMerge pull request #2332 from brauner/2018-05-16/use_ambient_capabilities
Serge Hallyn [Wed, 16 May 2018 14:46:54 +0000 (09:46 -0500)] 
Merge pull request #2332 from brauner/2018-05-16/use_ambient_capabilities

capabilities: raise ambient capabilities

7 years agocapabilities: raise ambient capabilities 2332/head
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>
7 years agoMerge pull request #2319 from brauner/2018-05-13/allow_sys_rw_for_unpriv_containers
Stéphane Graber [Tue, 15 May 2018 14:34:22 +0000 (10:34 -0400)] 
Merge pull request #2319 from brauner/2018-05-13/allow_sys_rw_for_unpriv_containers

config: allow read-write /sys in user namespace

7 years agoMerge pull request #2327 from brauner/2018-05-15/coverity
Stéphane Graber [Tue, 15 May 2018 14:34:05 +0000 (10:34 -0400)] 
Merge pull request #2327 from brauner/2018-05-15/coverity

coverity

7 years agoMerge pull request #2329 from simos/fix-resource-leak-cid1425844
Christian Brauner [Tue, 15 May 2018 14:11:04 +0000 (16:11 +0200)] 
Merge pull request #2329 from simos/fix-resource-leak-cid1425844

coverity: #1425844

7 years agoconfig: allow read-write /sys in user namespace 2319/head
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>
7 years agocoverity: #1425844 2329/head
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>
7 years agocoverity: #1248106 2324/head
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>
7 years agocoverity: #1425836 2323/head
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>
7 years agocoverity: #1435602 2327/head
Christian Brauner [Tue, 15 May 2018 10:35:34 +0000 (12:35 +0200)] 
coverity: #1435602

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 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>
7 years agoMerge pull request #2326 from tenforward/japanese
Christian Brauner [Tue, 15 May 2018 09:53:12 +0000 (11:53 +0200)] 
Merge pull request #2326 from tenforward/japanese

Update Japanese man pages

7 years agodoc: Fix size unit style in Japanese lxc.container.conf(5) 2326/head
KATOH Yasufumi [Tue, 15 May 2018 09:07:27 +0000 (18:07 +0900)] 
doc: Fix size unit style in Japanese lxc.container.conf(5)

fix "kB" to "KB", and tweak description. Update for commit 6d276ed and
6d276ed .

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agodoc: Add "-d/--daemon" option to Japanese lxc-execute(1)
KATOH Yasufumi [Tue, 15 May 2018 08:52:46 +0000 (17:52 +0900)] 
doc: Add "-d/--daemon" option to Japanese lxc-execute(1)

Update for commit 4160ef0

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
7 years agoMerge pull request #2318 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 14:12:32 +0000 (10:12 -0400)] 
Merge pull request #2318 from brauner/2018-05-11/compiler_fixes

tools: s/strncpy()/memcpy()/g

7 years agotools: s/strncpy()/memcpy()/ 2318/head
Christian Brauner [Fri, 11 May 2018 13:58:33 +0000 (15:58 +0200)] 
tools: s/strncpy()/memcpy()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 years agoMerge pull request #2317 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 13:43:34 +0000 (09:43 -0400)] 
Merge pull request #2317 from brauner/2018-05-11/compiler_fixes

tools: s/strncpy()/strlcpy()/g

7 years agotools: s/strncpy()/strlcpy()/g 2317/head
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>
7 years agoMerge pull request #2316 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 13:07:41 +0000 (09:07 -0400)] 
Merge pull request #2316 from brauner/2018-05-11/compiler_fixes

tree-wide: s/strncpy()/strlcpy()/g

7 years agoCODING_STYLE: add section about using strlcpy() 2316/head
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>
7 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>
7 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>
7 years agoMerge pull request #2315 from duguhaotian/master
Christian Brauner [Fri, 11 May 2018 11:22:16 +0000 (13:22 +0200)] 
Merge pull request #2315 from duguhaotian/master

support case ignored suffix for sizes

7 years agoutils: fix parse_byte_size_string() coding style 2315/head
Christian Brauner [Fri, 11 May 2018 11:08:20 +0000 (13:08 +0200)] 
utils: fix parse_byte_size_string() coding style

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosupport case ignored suffix for sizes
l00355512 [Fri, 11 May 2018 01:47:49 +0000 (09:47 +0800)] 
support case ignored suffix for sizes

suffix of console max size and console buffer max size

Signed-off-by: l00355512 <liuhao27@huawei.com>
7 years agoMerge pull request #2314 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Thu, 10 May 2018 23:44:44 +0000 (19:44 -0400)] 
Merge pull request #2314 from brauner/2018-05-11/compiler_fixes

gcc-8: silence

7 years agonetwork: adhere to IFNAMSIZ limit 2314/head
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>
7 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>
7 years agoMerge pull request #2313 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Thu, 10 May 2018 22:38:54 +0000 (18:38 -0400)] 
Merge pull request #2313 from brauner/2018-05-11/compiler_fixes

confile: satisfy gcc-8

7 years agoconfile: satisfy gcc-8 2313/head
Christian Brauner [Thu, 10 May 2018 22:16:41 +0000 (00:16 +0200)] 
confile: satisfy gcc-8

Apparently -Werror=stringop-overflow will trigger an error here even though
this is completely valid since we now that we're definitely copying a \0-byte.
Work around this gcc-8 quirk by using memcpy(). This shouldn't trigger the
warning.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2299 from brauner/2018-05-01/bugfixes
Stéphane Graber [Thu, 10 May 2018 21:51:15 +0000 (17:51 -0400)] 
Merge pull request #2299 from brauner/2018-05-01/bugfixes

coverity + code removal

7 years agoutils: account for terminating \0 byte 2299/head
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>
7 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>
7 years agocoverity: #1248105
Christian Brauner [Tue, 1 May 2018 15:18:26 +0000 (17:18 +0200)] 
coverity: #1248105

Time of check time of use

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

Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 years agoMerge pull request #2308 from tych0/add-logging
Serge Hallyn [Wed, 9 May 2018 14:50:31 +0000 (09:50 -0500)] 
Merge pull request #2308 from tych0/add-logging

fix execute when init in the container already exists

7 years agoexecute: set init_path when existing init is found 2308/head
Tycho Andersen [Wed, 9 May 2018 01:48:31 +0000 (01:48 +0000)] 
execute: set init_path when existing init is found

I'm not really sure we should be looking in the rootfs for an existing
init, but I'll send a much more invasive patch to correct that. For now,
let's just make sure we set init_path when we find one, so that later in
execute_start() we don't bail.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
7 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>
7 years agoadd some TRACE/ERROR reporting
Tycho Andersen [Tue, 8 May 2018 15:43:19 +0000 (09:43 -0600)] 
add some TRACE/ERROR reporting

The errors in execute_start are important because nothing actually prints
out what error if any there was in these cases, so you're left with an
empty log.

The TRACE logs are simply to tell you which version of start lxc chose to
invoke: exec or start.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
7 years agoMerge pull request #2309 from brauner/2018-05-08/fix_execute
Serge Hallyn [Wed, 9 May 2018 13:49:07 +0000 (08:49 -0500)] 
Merge pull request #2309 from brauner/2018-05-08/fix_execute

execute: do not check inherited fds again

7 years agoexecute: do not check inherited fds again 2309/head
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>
7 years agoMerge pull request #2305 from brauner/2018-05-04/fix_execute_logging
Christian Brauner [Fri, 4 May 2018 10:35:23 +0000 (12:35 +0200)] 
Merge pull request #2305 from brauner/2018-05-04/fix_execute_logging

fix logic for execute log file

7 years agoexecute: use static buffer 2305/head
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>
7 years agoutils: add LXC_PROC_PID_FD_LEN
Christian Brauner [Fri, 4 May 2018 09:59:11 +0000 (11:59 +0200)] 
utils: add LXC_PROC_PID_FD_LEN

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agofix logic for execute log file 2303/head
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>
7 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>
7 years agoMerge pull request #2297 from brauner/2018-04-29/bugfixes
Stéphane Graber [Mon, 30 Apr 2018 09:29:41 +0000 (05:29 -0400)] 
Merge pull request #2297 from brauner/2018-04-29/bugfixes

coverity

7 years agolxccontainer: non-functional changes 2297/head
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>
7 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>
7 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:45:43 +0000 (16:45 +0200)] 
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxccontainer: use thread-safe open() + write()
Christian Brauner [Sun, 29 Apr 2018 14:42:44 +0000 (16:42 +0200)] 
lxccontainer: use thread-safe open() + write()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 11:32:42 +0000 (13:32 +0200)] 
lxccontainer: non-functional changes

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

Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 years agocoverity: #1435200
Christian Brauner [Sat, 28 Apr 2018 22:49:30 +0000 (00:49 +0200)] 
coverity: #1435200

Resource leak

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

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 years agocoverity: #1435206
Christian Brauner [Sat, 28 Apr 2018 22:32:42 +0000 (00:32 +0200)] 
coverity: #1435206

Time of check time of use

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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>
7 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>
7 years agocoverity: #1435210
Christian Brauner [Sat, 28 Apr 2018 22:16:05 +0000 (00:16 +0200)] 
coverity: #1435210

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2279 from kunkku/create-umask
Christian Brauner [Sat, 28 Apr 2018 21:23:27 +0000 (23:23 +0200)] 
Merge pull request #2279 from kunkku/create-umask

do_lxcapi_create: set umask

7 years agoMerge pull request #2293 from pkun/master
Christian Brauner [Thu, 26 Apr 2018 16:36:46 +0000 (18:36 +0200)] 
Merge pull request #2293 from pkun/master

Fix tool_utils.c build when HAVE_SETNS is unset

7 years agoFix tool_utils.c build when HAVE_SETNS is unset 2293/head
Serj Kalichev [Thu, 26 Apr 2018 13:20:30 +0000 (16:20 +0300)] 
Fix tool_utils.c build when HAVE_SETNS is unset

Add inline setns() function to tool_utils.h. Without it
tool_utils.c can't be build when HAVE_SETNS is unset.

Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com>
7 years agoMerge pull request #2289 from lifeng68/Fix_mem_leak_list_active_containers
Christian Brauner [Tue, 24 Apr 2018 13:14:25 +0000 (15:14 +0200)] 
Merge pull request #2289 from lifeng68/Fix_mem_leak_list_active_containers

Fix memory leak in list_active_containers

7 years agoFix memory leak in list_active_containers 2289/head
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>
7 years agoFix the memory leak in cgfsng_attach 2288/head
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>
7 years agoMerge pull request #2288 from lifeng68/Fix_mem_leak_cgfsng_attach
Christian Brauner [Tue, 24 Apr 2018 08:40:22 +0000 (10:40 +0200)] 
Merge pull request #2288 from lifeng68/Fix_mem_leak_cgfsng_attach

Fix the memory leak in cgfsng_attach

7 years agoMerge pull request #2287 from thyth/master
Christian Brauner [Tue, 24 Apr 2018 08:16:04 +0000 (10:16 +0200)] 
Merge pull request #2287 from thyth/master

Also pass action scripts to CRIU on checkpointing

7 years agoAlso pass action scripts to CRIU on checkpointing 2287/head
Daniel Selifonov [Sun, 15 Apr 2018 06:26:00 +0000 (23:26 -0700)] 
Also pass action scripts to CRIU on checkpointing

Signed-off-by: Daniel Selifonov <ds@thyth.com>
7 years agoMerge pull request #2284 from 3XX0/pamcgfs-ignore-umask
Christian Brauner [Mon, 23 Apr 2018 21:09:39 +0000 (23:09 +0200)] 
Merge pull request #2284 from 3XX0/pamcgfs-ignore-umask

pam-cgfs: ignore the system umask when creating the cgroup hierarchy

7 years agopam-cgfs: ignore the system umask when creating the cgroup hierarchy 2284/head
Jonathan Calmels [Mon, 16 Apr 2018 19:30:33 +0000 (12:30 -0700)] 
pam-cgfs: ignore the system umask when creating the cgroup hierarchy

Fixes: #2277
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
7 years agoMerge pull request #2285 from tpetazzoni/offsetof-stddef-fix
Christian Brauner [Fri, 20 Apr 2018 11:00:07 +0000 (13:00 +0200)] 
Merge pull request #2285 from tpetazzoni/offsetof-stddef-fix

lxc/tools/lxc_monitor: include missing <stddef.h>

7 years agolxc/tools/lxc_monitor: include missing <stddef.h> 2285/head
Thomas Petazzoni [Fri, 20 Apr 2018 10:26:33 +0000 (12:26 +0200)] 
lxc/tools/lxc_monitor: include missing <stddef.h>

lxc_monitor.c uses offsetof(), so it should include
<stddef.h>. Otherwise the build fails with the musl C library:

tools/lxc_monitor.c: In function ‘lxc_abstract_unix_connect’:
tools/lxc_monitor.c:324:9: warning: implicit declaration of function ‘offsetof’ [-Wimplicit-function-declaration]
         offsetof(struct sockaddr_un, sun_path) + len + 1);
         ^~~~~~~~
tools/lxc_monitor.c:324:18: error: expected expression before ‘struct’
         offsetof(struct sockaddr_un, sun_path) + len + 1);
                  ^~~~~~

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
7 years agoMerge pull request #2283 from flx42/lxc-oci-mkdir-download-directory
Christian Brauner [Thu, 19 Apr 2018 13:07:05 +0000 (15:07 +0200)] 
Merge pull request #2283 from flx42/lxc-oci-mkdir-download-directory

lxc-oci: mkdir the download directory

7 years agolxc-oci: mkdir the download directory 2283/head
Felix Abecassis [Wed, 18 Apr 2018 21:12:55 +0000 (14:12 -0700)] 
lxc-oci: mkdir the download directory

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
7 years agoMerge pull request #2281 from brauner/2018-04-15/seccomp_fixes
Serge Hallyn [Wed, 18 Apr 2018 16:35:11 +0000 (11:35 -0500)] 
Merge pull request #2281 from brauner/2018-04-15/seccomp_fixes

seccomp: handle arch inversion - The Architecture Strikes Back

7 years agoseccomp: handle arch inversion II 2281/head
Christian Brauner [Wed, 18 Apr 2018 13:20:21 +0000 (15:20 +0200)] 
seccomp: handle arch inversion II

LXC generates and loads the seccomp-bpf filter in the host/container which
spawn the new container. In other words, userspace N is responsible for
generating and loading the seccomp-bpf filter which restricts userspace N + 1.
Assume 64bit kernel and 32bit userspace running a 64bit container. In this case
the 32-bit x86 userspace is used to create a seccomp-bpf filter for a 64-bit
userspace. Unless one explicitly adds the 64-bit ABI to the libseccomp filter,
or adjusts the default behavior for "BAD_ARCH", *all* 64-bit x86 syscalls will
be blocked.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Paul Moore <paul@paul-moore.com>
7 years agoseccomp: non-functional changes
Christian Brauner [Wed, 18 Apr 2018 12:40:49 +0000 (14:40 +0200)] 
seccomp: non-functional changes

Rename "compat_ctx" to "contexts" and "compat_arch" to "architectures".

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotools: document -d/--daemonize for lxc-execute
Christian Brauner [Sun, 15 Apr 2018 20:42:43 +0000 (22:42 +0200)] 
tools: document -d/--daemonize for lxc-execute

Closes #2280.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: improve logging
Christian Brauner [Sun, 15 Apr 2018 20:39:07 +0000 (22:39 +0200)] 
seccomp: improve logging

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