]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
6 years agotools/lxc_stop: use correct check
Christian Brauner [Sat, 20 Oct 2018 09:48:06 +0000 (11:48 +0200)] 
tools/lxc_stop: use correct check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: prevent values smaller 0
Christian Brauner [Sat, 20 Oct 2018 09:39:28 +0000 (11:39 +0200)] 
start: prevent values smaller 0

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: remove check from goto target
Christian Brauner [Sat, 20 Oct 2018 09:37:39 +0000 (11:37 +0200)] 
lxccontainer: remove check from goto target

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: remove tautological check
Christian Brauner [Sat, 20 Oct 2018 09:36:26 +0000 (11:36 +0200)] 
conf: remove tautological check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: use O_CLOEXEC in lxc_pivot_root()
Christian Brauner [Sat, 20 Oct 2018 09:35:41 +0000 (11:35 +0200)] 
conf: use O_CLOEXEC in lxc_pivot_root()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: remove tautological check
Christian Brauner [Sat, 20 Oct 2018 09:34:35 +0000 (11:34 +0200)] 
conf: remove tautological check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostate: remove tautological check
Christian Brauner [Sat, 20 Oct 2018 09:32:04 +0000 (11:32 +0200)] 
state: remove tautological check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools/lxc_info: do not hide global variable
Christian Brauner [Sat, 20 Oct 2018 09:30:12 +0000 (11:30 +0200)] 
tools/lxc_info: do not hide global variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools/lxc_top: do not hide global variable
Christian Brauner [Sat, 20 Oct 2018 09:28:11 +0000 (11:28 +0200)] 
tools/lxc_top: do not hide global variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools/lxc_copy: do not hide global variable
Christian Brauner [Sat, 20 Oct 2018 09:23:55 +0000 (11:23 +0200)] 
tools/lxc_copy: do not hide global variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agomonitord: do not hide global variable
Christian Brauner [Sat, 20 Oct 2018 09:22:02 +0000 (11:22 +0200)] 
monitord: do not hide global variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: move increment out of branch
Christian Brauner [Sat, 20 Oct 2018 09:13:59 +0000 (11:13 +0200)] 
cgfsng: move increment out of branch

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocommands: simplify
Christian Brauner [Sat, 20 Oct 2018 09:09:54 +0000 (11:09 +0200)] 
commands: simplify

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: do not overwrite global variable
Christian Brauner [Sat, 20 Oct 2018 09:03:41 +0000 (11:03 +0200)] 
confile: do not overwrite global variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: update .travis.yml
Christian Brauner [Fri, 19 Oct 2018 23:57:40 +0000 (01:57 +0200)] 
coverity: update .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: update .travis.yml
Christian Brauner [Fri, 19 Oct 2018 23:54:55 +0000 (01:54 +0200)] 
coverity: update .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: update .travis.yml
Christian Brauner [Fri, 19 Oct 2018 23:48:39 +0000 (01:48 +0200)] 
coverity: update .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: update .travis.yml
Christian Brauner [Fri, 19 Oct 2018 23:42:56 +0000 (01:42 +0200)] 
coverity: update .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: update .travis.yml
Christian Brauner [Fri, 19 Oct 2018 23:34:15 +0000 (01:34 +0200)] 
coverity: update .travis.yml

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoautotools: compiler based hardening
Christian Brauner [Fri, 19 Oct 2018 22:22:18 +0000 (00:22 +0200)] 
autotools: compiler based hardening

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: simplify
Christian Brauner [Fri, 19 Oct 2018 22:06:32 +0000 (00:06 +0200)] 
start: simplify

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotree-wide: coding style fixes
2xsec [Fri, 19 Oct 2018 05:34:13 +0000 (14:34 +0900)] 
tree-wide: coding style fixes

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
[christian.brauner@ubuntu.com: cleanup if-branches in confile.c]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoparse: fix uninitialized value
2xsec [Fri, 19 Oct 2018 02:51:51 +0000 (11:51 +0900)] 
parse: fix uninitialized value

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoparse: protect against config updates during parse
Christian Brauner [Wed, 17 Oct 2018 16:36:28 +0000 (18:36 +0200)] 
parse: protect against config updates during parse

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: fix append_unexp_config_line()
Christian Brauner [Wed, 17 Oct 2018 13:16:27 +0000 (15:16 +0200)] 
confile: fix append_unexp_config_line()

Reported-by: 2xsec dh48.jeong@samsung.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoraw_syscalls: ensure function always returns value
Christian Brauner [Thu, 18 Oct 2018 12:38:09 +0000 (14:38 +0200)] 
raw_syscalls: ensure function always returns value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoinclude: simplify strlcpy()
Christian Brauner [Thu, 18 Oct 2018 10:50:13 +0000 (12:50 +0200)] 
include: simplify strlcpy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostring_utils: fix global buffer overflow issue
2xsec [Thu, 18 Oct 2018 06:16:54 +0000 (15:16 +0900)] 
string_utils: fix global buffer overflow issue

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoautotools: fix --disable-commands builds
Christian Brauner [Wed, 17 Oct 2018 13:23:41 +0000 (15:23 +0200)] 
autotools: fix --disable-commands builds

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-init: log to /dev/console
Christian Brauner [Sun, 14 Oct 2018 20:22:21 +0000 (22:22 +0200)] 
lxc-init: log to /dev/console

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocheckconfig: Handle missing kernel version
Stéphane Graber [Sat, 13 Oct 2018 02:32:08 +0000 (22:32 -0400)] 
checkconfig: Handle missing kernel version

https://github.com/lxc/lxd/issues/5151

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoautools: use -fno-strict-aliasing
Christian Brauner [Fri, 12 Oct 2018 19:23:07 +0000 (21:23 +0200)] 
autools: use -fno-strict-aliasing

The gcc implementation and the C standard are not to be considered sane
in this respect. We don't want to risk reordering of writes when the
compiler incorrectly *thinks* two types do not alias each other.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomonitor: fix coding standard
2xsec [Fri, 12 Oct 2018 07:05:31 +0000 (16:05 +0900)] 
monitor: fix coding standard

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agocommands_utils: improve code redundancy to make abstract unix socket name
2xsec [Fri, 12 Oct 2018 06:05:43 +0000 (15:05 +0900)] 
commands_utils: improve code redundancy to make abstract unix socket name

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agomonitor: checking name too long to make monitor sock name
2xsec [Fri, 12 Oct 2018 02:19:04 +0000 (11:19 +0900)] 
monitor: checking name too long to make monitor sock name

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agomonitor: log cleanups
2xsec [Fri, 12 Oct 2018 01:36:42 +0000 (10:36 +0900)] 
monitor: log cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agocheckpoint: fix running do_dump()
Adrian Reber [Thu, 11 Oct 2018 13:10:12 +0000 (13:10 +0000)] 
checkpoint: fix running do_dump()

Testing 'lxc <container> stop --stateful' crashed LXD:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x7f3198ff0592]

runtime stack:
runtime.throw(0x117fe4a, 0x2a)
/opt/rh/go-toolset-1.10/root/usr/lib/go-toolset-1.10-golang/src/runtime/panic.go:616 +0x81
runtime.sigpanic()
/opt/rh/go-toolset-1.10/root/usr/lib/go-toolset-1.10-golang/src/runtime/signal_unix.go:372 +0x28e

goroutine 375 [syscall]:
runtime.cgocall(0xef38e3, 0xc420731630, 0x29)
/opt/rh/go-toolset-1.10/root/usr/lib/go-toolset-1.10-golang/src/runtime/cgocall.go:128 +0x64 fp=0xc4207315f0 sp=0xc4207315b8 pc=0x410fc4
gopkg.in/lxc/go-lxc%2ev2._Cfunc_go_lxc_migrate(0x7f316c001220, 0xc400000001, 0xc420302460, 0xc4205d6080, 0x0)
_cgo_gotypes.go:752 +0x4d fp=0xc420731630 sp=0xc4207315f0 pc=0x909d7d
gopkg.in/lxc/go-lxc%2ev2.(*Container).Migrate.func4(0x7f316c001220, 0xc400000001, 0xc420302460, 0xc4205d6080, 0x0)
/share/go/src/gopkg.in/lxc/go-lxc.v2/container.go:1798 +0x160 fp=0xc420731668 sp=0xc420731630 pc=0x91b970
gopkg.in/lxc/go-lxc%2ev2.(*Container).Migrate(0xc4207a52f0, 0x1, 0xc42051ec00, 0x20, 0x0, 0x0, 0x0, 0x0, 0x101, 0x10000000, ...)
/share/go/src/gopkg.in/lxc/go-lxc.v2/container.go:1798 +0x29f fp=0xc420731760 sp=0xc420731668 pc=0x9160ef

The commit 5a087e056f94 introduced a second parameter (conf) to the
cgroup escape() function which was never set in do_dump(). Instead of
taking it from opts->handler->conf it is now used from c->lxc_conf.

Fixes: 5a087e056f94 ("cgroups: don't escape if lxc.cgroup.keep is true")
Suggested-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
7 years agoconf: verify_start_hooks() after lxc.mount.entry
Christian Brauner [Wed, 10 Oct 2018 11:06:21 +0000 (13:06 +0200)] 
conf: verify_start_hooks() after lxc.mount.entry

Fixes: https://discuss.linuxcontainers.org/t/are-lxc-mount-entry-available-when-lxc-hook-start-is-validated/2906/3
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconf: log prlimit setup
Christian Brauner [Wed, 10 Oct 2018 11:53:00 +0000 (13:53 +0200)] 
conf: log prlimit setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agofix post section script error for rpm install
2xsec [Wed, 10 Oct 2018 09:51:26 +0000 (18:51 +0900)] 
fix post section script error for rpm install

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agofix rpm packaging error for static library
2xsec [Wed, 10 Oct 2018 09:21:41 +0000 (18:21 +0900)] 
fix rpm packaging error for static library

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoparse: fix uninitialized pointer access
2xsec [Wed, 10 Oct 2018 06:00:45 +0000 (15:00 +0900)] 
parse: fix uninitialized pointer access

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoconfile: remove unused variable
2xsec [Wed, 10 Oct 2018 05:50:32 +0000 (14:50 +0900)] 
confile: remove unused variable

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agotest: test invalid config keys
Christian Brauner [Mon, 8 Oct 2018 20:53:16 +0000 (22:53 +0200)] 
test: test invalid config keys

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoparse: do not mask failed parse
Christian Brauner [Mon, 8 Oct 2018 20:49:57 +0000 (22:49 +0200)] 
parse: do not mask failed parse

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetns_ifaddrs: check for NETLINK_DUMP_STRICT_CHK
Christian Brauner [Mon, 8 Oct 2018 19:08:10 +0000 (21:08 +0200)] 
netns_ifaddrs: check for NETLINK_DUMP_STRICT_CHK

Make use of the new socket option, NETLINK_DUMP_STRICT_CHK, that
userspace can use via setsockopt to request strict checking of headers
and attributes on dump requests.

To get dump features such as kernel side filtering based on data in
the header or attributes appended to the dump request, userspace
must call setsockopt() for NETLINK_DUMP_STRICT_CHK and a non-zero
value. This is necessary to make use of the IFA_TARGET_NETNSID property.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomacro: add SOL_NETLINK
Christian Brauner [Mon, 8 Oct 2018 19:10:29 +0000 (21:10 +0200)] 
macro: add SOL_NETLINK

This allows to set netlink socket properties.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomacro: add NETLINK_DUMP_STRICT_CHK
Christian Brauner [Mon, 8 Oct 2018 18:55:55 +0000 (20:55 +0200)] 
macro: add NETLINK_DUMP_STRICT_CHK

This adds support for the new socket option, NETLINK_DUMP_STRICT_CHK,
that userspace can use via setsockopt to request strict checking of
headers and attributes on dump requests.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoattach: fix missing pthread.h include
Christian Brauner [Mon, 8 Oct 2018 15:20:08 +0000 (17:20 +0200)] 
attach: fix missing pthread.h include

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agofile_utils: fix too wide or inconsistent non-owner permissions
2xsec [Mon, 8 Oct 2018 07:37:40 +0000 (16:37 +0900)] 
file_utils: fix too wide or inconsistent non-owner permissions

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agostart: change log level
2xsec [Mon, 8 Oct 2018 07:24:53 +0000 (16:24 +0900)] 
start: change log level

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoattach: reset signal mask
Christian Brauner [Sun, 7 Oct 2018 09:21:06 +0000 (11:21 +0200)] 
attach: reset signal mask

Since we introduced clean exit from the mainloop when SIGTERM is sent we
changed the signal mask of the parent process but we never reset the
signal mask for the actual attached process.

Closes #399.

Fixes: 1349e92e4d23 ("console: exit mainloop on SIGTERM")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotools: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:09:00 +0000 (10:09 +0200)] 
tools: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostorage: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:06:52 +0000 (10:06 +0200)] 
storage: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:04:15 +0000 (10:04 +0200)] 
utils: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoterminal: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:03:55 +0000 (10:03 +0200)] 
terminal: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agostart: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:02:53 +0000 (10:02 +0200)] 
start: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agopam: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:02:39 +0000 (10:02 +0200)] 
pam: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetwork: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:02:14 +0000 (10:02 +0200)] 
network: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomacro: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:01:59 +0000 (10:01 +0200)] 
macro: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxccontainer: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:01:30 +0000 (10:01 +0200)] 
lxccontainer: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolog: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 08:00:50 +0000 (10:00 +0200)] 
log: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 07:59:16 +0000 (09:59 +0200)] 
confile: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconf: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 07:58:56 +0000 (09:58 +0200)] 
conf: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocmd: s/MAXPATHLEN/PATH_MAX/g
Christian Brauner [Sun, 7 Oct 2018 07:53:46 +0000 (09:53 +0200)] 
cmd: s/MAXPATHLEN/PATH_MAX/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agomacro: add PATH_MAX
Christian Brauner [Sun, 7 Oct 2018 07:53:30 +0000 (09:53 +0200)] 
macro: add PATH_MAX

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoparse: report errors when failing config parsing
Christian Brauner [Sat, 6 Oct 2018 22:50:52 +0000 (00:50 +0200)] 
parse: report errors when failing config parsing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoparse: remove access() check
Christian Brauner [Sat, 6 Oct 2018 22:42:44 +0000 (00:42 +0200)] 
parse: remove access() check

We can just fail on open() and not waste an additional syscall.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotools: lxc-unshare: remove unnecessary initialization
2xsec [Fri, 5 Oct 2018 02:08:41 +0000 (11:08 +0900)] 
tools: lxc-unshare: remove unnecessary initialization

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agotools: lxc-start: remove unused argument
2xsec [Fri, 5 Oct 2018 02:07:02 +0000 (11:07 +0900)] 
tools: lxc-start: remove unused argument

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agoraw_syscalls: move lxc_raw_gettid()
Christian Brauner [Wed, 3 Oct 2018 11:10:55 +0000 (13:10 +0200)] 
raw_syscalls: move lxc_raw_gettid()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: move signalfd()
Christian Brauner [Wed, 3 Oct 2018 11:08:51 +0000 (13:08 +0200)] 
syscall_wrappers: move signalfd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: move unshare()
Christian Brauner [Wed, 3 Oct 2018 11:03:30 +0000 (13:03 +0200)] 
syscall_wrappers: move unshare()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: move sethostname()
Christian Brauner [Wed, 3 Oct 2018 10:59:32 +0000 (12:59 +0200)] 
syscall_wrappers: move sethostname()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: move setns()
Christian Brauner [Wed, 3 Oct 2018 10:57:32 +0000 (12:57 +0200)] 
syscall_wrappers: move setns()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: move memfd_create()
Christian Brauner [Wed, 3 Oct 2018 10:49:46 +0000 (12:49 +0200)] 
syscall_wrappers: move memfd_create()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocgfsng: handle v1 cpuset hierarchy first
Christian Brauner [Wed, 3 Oct 2018 10:23:36 +0000 (12:23 +0200)] 
cgfsng: handle v1 cpuset hierarchy first

If the value of cgroup.clone_children in our immediate ancestor cgroup
is 0 then the cpuset of any cgroups we create in subtrees will be empty
and hence we'll copy an empty cpuset at which point we cannot enter the
cpuset cgroup.
Avoid this problem by initializing cgroup.clone_children to 1 an copying
the initialized cpuset of our immediate ancestor. Note, that the cpuset
of our immediate ancestor must be initialized and ours as well otherwise
we couldn't be located in this cgroup.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: fix lxc_set_death_signal()
Christian Brauner [Tue, 2 Oct 2018 18:59:34 +0000 (20:59 +0200)] 
utils: fix lxc_set_death_signal()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocgfsng: avoid tiny race window
Christian Brauner [Tue, 2 Oct 2018 15:40:25 +0000 (17:40 +0200)] 
cgfsng: avoid tiny race window

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoparse: prefault config file with MAP_POPULATE
Christian Brauner [Tue, 2 Oct 2018 14:40:13 +0000 (16:40 +0200)] 
parse: prefault config file with MAP_POPULATE

When we call lxc_file_for_each_line_mmap() we will always parse the
whole config file. Prefault it in case it is really long to optimize
performance.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetns_iaddrs: remove unused functions
2xsec [Tue, 2 Oct 2018 09:55:33 +0000 (18:55 +0900)] 
netns_iaddrs: remove unused functions

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agocgroups: remove unnecessary line
2xsec [Tue, 2 Oct 2018 09:49:16 +0000 (18:49 +0900)] 
cgroups: remove unnecessary line

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
7 years agonetns_ifaddrs: only use struct rtnl_link_stats64
Christian Brauner [Sun, 30 Sep 2018 18:58:06 +0000 (20:58 +0200)] 
netns_ifaddrs: only use struct rtnl_link_stats64

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotests: add missing build dependencies
Christian Brauner [Sun, 30 Sep 2018 18:23:54 +0000 (20:23 +0200)] 
tests: add missing build dependencies

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoautotools: fix lxc-usernsexec build
Christian Brauner [Sun, 30 Sep 2018 18:13:02 +0000 (20:13 +0200)] 
autotools: fix lxc-usernsexec build

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoautotools: fix lxc-user-nic build
Christian Brauner [Sun, 30 Sep 2018 18:10:36 +0000 (20:10 +0200)] 
autotools: fix lxc-user-nic build

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoautotools: fix lxc-monitord build
Christian Brauner [Sun, 30 Sep 2018 18:08:46 +0000 (20:08 +0200)] 
autotools: fix lxc-monitord build

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoautotools: fix lxc init build
Christian Brauner [Sun, 30 Sep 2018 18:07:02 +0000 (20:07 +0200)] 
autotools: fix lxc init build

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoraw_syscalls: add lxc_raw_getpid()
Christian Brauner [Sun, 30 Sep 2018 18:05:17 +0000 (20:05 +0200)] 
raw_syscalls: add lxc_raw_getpid()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoraw_syscalls: add lxc_raw_clone{_cb}()
Christian Brauner [Sun, 30 Sep 2018 17:47:58 +0000 (19:47 +0200)] 
raw_syscalls: add lxc_raw_clone{_cb}()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoraw_syscalls: add lxc_raw_execveat()
Christian Brauner [Sun, 30 Sep 2018 10:43:15 +0000 (12:43 +0200)] 
raw_syscalls: add lxc_raw_execveat()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agosyscall_wrappers: add pivot_root()
Christian Brauner [Sun, 30 Sep 2018 10:41:34 +0000 (12:41 +0200)] 
syscall_wrappers: add pivot_root()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agonetns_ifaddrs: handle IFLA_STATS{64} correctly
Christian Brauner [Sun, 30 Sep 2018 10:25:27 +0000 (12:25 +0200)] 
netns_ifaddrs: handle IFLA_STATS{64} correctly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoautotools: support -z relro and -z now
Christian Brauner [Fri, 28 Sep 2018 20:58:20 +0000 (22:58 +0200)] 
autotools: support -z relro and -z now

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: add lxc_setup_keyring()
Christian Brauner [Fri, 28 Sep 2018 11:14:25 +0000 (13:14 +0200)] 
utils: add lxc_setup_keyring()

Allocate a new keyring if we can to prevent information leak.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfigure: fix -Wimplicit-fallthrough check
Christian Brauner [Fri, 28 Sep 2018 11:29:58 +0000 (13:29 +0200)] 
configure: fix -Wimplicit-fallthrough check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agooci-template: Add logic for no /etc/passwd, group
Jungsub Shin [Fri, 28 Sep 2018 10:21:08 +0000 (19:21 +0900)] 
oci-template: Add logic for no /etc/passwd, group

OCI image spec dosen't specify action when there is
no /etc/passwd or /etc/group. So if there is no
/etc/passwd with string user info, set uid to 0. If there
is no /etc/group with string group info, set gid to 0.

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
7 years agobtrfs: fix btrfs containers
Christian Brauner [Fri, 28 Sep 2018 09:24:46 +0000 (11:24 +0200)] 
btrfs: fix btrfs containers

Closes #2612.
Closes #2655.

Fixes: 9de31d5a1394 ("tree-wide: s/strncpy()/strlcpy()/g")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotemplate: oci template supports for char user info
Jungsub Shin [Fri, 21 Sep 2018 06:29:37 +0000 (15:29 +0900)] 
template: oci template supports for char user info

oci template changes character user info to uid, gid
according to OCI image spec.

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
7 years agotree-wide: fix includes to fix bionic builds
Christian Brauner [Wed, 26 Sep 2018 22:51:59 +0000 (00:51 +0200)] 
tree-wide: fix includes to fix bionic builds

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