]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 years agochange defines for return value of handlers
Donghwa Jeong [Thu, 31 May 2018 05:54:43 +0000 (14:54 +0900)]
change defines for return value of handlers

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agoMerge pull request #2365 from brauner/2018-05-30/improve_strprint
Stéphane Graber [Wed, 30 May 2018 15:35:32 +0000 (11:35 -0400)]
Merge pull request #2365 from brauner/2018-05-30/improve_strprint

confile: improve strprint()

6 years agoconfile: improve strprint()
Christian Brauner [Wed, 30 May 2018 13:34:03 +0000 (15:34 +0200)]
confile: improve strprint()

POSIX specifies [1]:
"If the value of n is zero on a call to snprintf(), nothing shall be written,
the number of bytes that would have been written had n been sufficiently large
excluding the terminating null shall be returned, and s may be a null pointer."

But in case there are any non-sane libcs out there that do actually dereference
the buffer when when 0 is passed as length to snprintf() let's give them a
dummy buffer.

[1]: The Open Group Base Specifications Issue 7, 2018 edition
     IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
     Copyright © 2001-2018 IEEE and The Open Group

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agoMerge pull request #2363 from 2xsec/master
Christian Brauner [Wed, 30 May 2018 03:37:13 +0000 (05:37 +0200)]
Merge pull request #2363 from 2xsec/master

conf: va_end was not called.

6 years agoMerge pull request #2360 from brauner/2018-05-29/conf_cleanup
Stéphane Graber [Tue, 29 May 2018 19:15:46 +0000 (15:15 -0400)]
Merge pull request #2360 from brauner/2018-05-29/conf_cleanup

conf: small cleanups

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 agoconf: non-functional changes
Christian Brauner [Mon, 28 May 2018 22:57:13 +0000 (00:57 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: make tmp_umount_proc bool
Christian Brauner [Mon, 28 May 2018 22:54:16 +0000 (00:54 +0200)]
conf: make tmp_umount_proc bool

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: make root idmap structs const
Christian Brauner [Mon, 28 May 2018 22:52:37 +0000 (00:52 +0200)]
conf: make root idmap structs const

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: add reboot macros
Christian Brauner [Mon, 28 May 2018 22:48:15 +0000 (00:48 +0200)]
start: add reboot macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2358 from brauner/2018-05-28/do_not_init_ns_clone_flags
Stéphane Graber [Mon, 28 May 2018 14:29:15 +0000 (10:29 -0400)]
Merge pull request #2358 from brauner/2018-05-28/do_not_init_ns_clone_flags

start: do not init ns_clone_flags to -1

6 years agoconf: ensure lxc_delete_tty() does not crash
Christian Brauner [Mon, 28 May 2018 13:10:19 +0000 (15:10 +0200)]
conf: ensure lxc_delete_tty() does not crash

We need to make sure that the ttys are actually initialized otherwise deleting
them is not safe.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: do not init ns_clone_flags to -1
Christian Brauner [Mon, 28 May 2018 11:27:43 +0000 (13:27 +0200)]
start: do not init ns_clone_flags to -1

ns_clone_flags is used as a bitmask so initializing it to -1 is a bad idea.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2355 from 2xsec/master
Christian Brauner [Mon, 28 May 2018 06:27:59 +0000 (08:27 +0200)]
Merge pull request #2355 from 2xsec/master

network: fix socket handle leak

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 agoMerge pull request #2354 from brauner/2018-05-26/config_cleanups
Stéphane Graber [Sat, 26 May 2018 22:04:33 +0000 (18:04 -0400)]
Merge pull request #2354 from brauner/2018-05-26/config_cleanups

conf: cleanups, and bugfixes

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 agoconf: non-functional changes
Christian Brauner [Sat, 26 May 2018 11:12:32 +0000 (13:12 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: pts -> pty_max
Christian Brauner [Sat, 26 May 2018 11:09:13 +0000 (13:09 +0200)]
conf: pts -> pty_max

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: simplify tty handling
Christian Brauner [Sat, 26 May 2018 10:53:56 +0000 (12:53 +0200)]
conf: simplify tty handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: reshuffle mount members
Christian Brauner [Sat, 26 May 2018 10:53:12 +0000 (12:53 +0200)]
conf: reshuffle mount members

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: make close_all_fds a boolean
Christian Brauner [Sat, 26 May 2018 10:52:09 +0000 (12:52 +0200)]
conf: make close_all_fds a boolean

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: non-functional changes
Christian Brauner [Sat, 26 May 2018 10:50:53 +0000 (12:50 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: make is_execute a boolean
Christian Brauner [Sat, 26 May 2018 10:50:03 +0000 (12:50 +0200)]
conf: make is_execute a boolean

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: non-functional changes
Christian Brauner [Sat, 26 May 2018 10:48:09 +0000 (12:48 +0200)]
conf: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2353 from brauner/2018-05-25/fix_lxc_create
Stéphane Graber [Sat, 26 May 2018 03:48:10 +0000 (23:48 -0400)]
Merge pull request #2353 from brauner/2018-05-25/fix_lxc_create

tools: fix lxc-create with global config value II

6 years agocoverity: #1435747
Christian Brauner [Sat, 26 May 2018 01:25:20 +0000 (03:25 +0200)]
coverity: #1435747

Dereference before null check

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 agocoverity: #1435806
Christian Brauner [Sat, 26 May 2018 01:20:36 +0000 (03:20 +0200)]
coverity: #1435806

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 agoMerge pull request #2352 from brauner/2018-05-25/further_seccomp_fixes
Stéphane Graber [Fri, 25 May 2018 14:12:04 +0000 (10:12 -0400)]
Merge pull request #2352 from brauner/2018-05-25/further_seccomp_fixes

seccomp: more fixes

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 agoseccomp: make do_resolve_add_rule() more strict
Christian Brauner [Fri, 25 May 2018 11:27:50 +0000 (13:27 +0200)]
seccomp: make do_resolve_add_rule() more strict

Let's error out on syscalls that cannot be resolved or fail to resolve instead
of just warning users.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: parse_v2_rules()
Christian Brauner [Fri, 25 May 2018 11:26:25 +0000 (13:26 +0200)]
seccomp: parse_v2_rules()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: lxc_read_seccomp_config()
Christian Brauner [Fri, 25 May 2018 11:16:31 +0000 (13:16 +0200)]
seccomp: lxc_read_seccomp_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2351 from Blub/seccomp-fixup-2
Christian Brauner [Fri, 25 May 2018 10:43:53 +0000 (12:43 +0200)]
Merge pull request #2351 from Blub/seccomp-fixup-2

Seccomp fixup part 2

6 years agoseccomp: error on unrecognized actions
Wolfgang Bumiller [Fri, 25 May 2018 10:07:12 +0000 (12:07 +0200)]
seccomp: error on unrecognized actions

Be more strict about unrecognized actions. Previously the
parser would happily accept lines with typos like:

  kexec_load errrno 1

(note the extra 'r')

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoseccomp: refactor line handling of parse_config
Wolfgang Bumiller [Fri, 25 May 2018 10:04:13 +0000 (12:04 +0200)]
seccomp: refactor line handling of parse_config

Moving parse_config_v2 to use getline accidentally parsed
the wrong buffer. Since both _v1 and _v2 now use getline it
seems to be simpler to also use getline() for the first line
before entering the version specific parsers and pass along
the pointer and size so they can reuse them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 9c3798eba41c ("seccomp: parse_config_v2()")
6 years agoseccomp: re-add action parse error handling
Wolfgang Bumiller [Fri, 25 May 2018 09:44:42 +0000 (11:44 +0200)]
seccomp: re-add action parse error handling

This can happen when the 'errno' action can't parse its
supplied number.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: f67c94d00a0d ("seccomp: parse_v2_rules()")
6 years agoMerge pull request #2350 from Blub/seccomp-cleanup-fixup
Christian Brauner [Fri, 25 May 2018 07:13:29 +0000 (09:13 +0200)]
Merge pull request #2350 from Blub/seccomp-cleanup-fixup

seccomp: leak fixup

6 years agoseccomp: leak fixup
Wolfgang Bumiller [Fri, 25 May 2018 06:42:01 +0000 (08:42 +0200)]
seccomp: leak fixup

Fix an error case not free()ing the line forgotten during
the move from fgets() on a static buffer to using getline.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: ccf8d128e430 ("seccomp: parse_config_v1()")
6 years agoMerge pull request #2349 from brauner/2018-05-24/prevent_fd_leak
Stéphane Graber [Fri, 25 May 2018 00:22:28 +0000 (20:22 -0400)]
Merge pull request #2349 from brauner/2018-05-24/prevent_fd_leak

lxccontainer: fix fd leaks when sending signals

6 years agostart: log setns() failure
Christian Brauner [Thu, 24 May 2018 22:25:16 +0000 (00:25 +0200)]
start: log setns() failure

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 agoMerge pull request #2347 from brauner/2018-05-24/seccomp_cleanups
Stéphane Graber [Thu, 24 May 2018 20:57:13 +0000 (16:57 -0400)]
Merge pull request #2347 from brauner/2018-05-24/seccomp_cleanups

seccomp: cleanup

6 years agoMerge pull request #2348 from brauner/2018-05-24/pthread_sigmask
Stéphane Graber [Thu, 24 May 2018 20:53:19 +0000 (16:53 -0400)]
Merge pull request #2348 from brauner/2018-05-24/pthread_sigmask

tree-wide: s/sigprocmask/pthread_sigmask()/g

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 agoseccomp: lxc_read_seccomp_config()
Christian Brauner [Thu, 24 May 2018 14:53:31 +0000 (16:53 +0200)]
seccomp: lxc_read_seccomp_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: parse_config()
Christian Brauner [Thu, 24 May 2018 14:49:28 +0000 (16:49 +0200)]
seccomp: parse_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: parse_config_v2()
Christian Brauner [Thu, 24 May 2018 14:47:08 +0000 (16:47 +0200)]
seccomp: parse_config_v2()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: do_resolve_add_rule()
Christian Brauner [Thu, 24 May 2018 14:35:21 +0000 (16:35 +0200)]
seccomp: do_resolve_add_rule()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: scmp_filter_ctx get_new_ctx()
Christian Brauner [Thu, 24 May 2018 14:28:02 +0000 (16:28 +0200)]
seccomp: scmp_filter_ctx get_new_ctx()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: get_hostarch()
Christian Brauner [Thu, 24 May 2018 14:24:59 +0000 (16:24 +0200)]
seccomp: get_hostarch()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: move #ifdefines
Christian Brauner [Thu, 24 May 2018 14:24:09 +0000 (16:24 +0200)]
seccomp: move #ifdefines

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: parse_v2_rules()
Christian Brauner [Thu, 24 May 2018 14:22:58 +0000 (16:22 +0200)]
seccomp: parse_v2_rules()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: fix get_seccomp_arg_value()
Christian Brauner [Thu, 24 May 2018 11:49:36 +0000 (13:49 +0200)]
seccomp: fix get_seccomp_arg_value()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: get_v2_action()
Christian Brauner [Thu, 24 May 2018 11:47:59 +0000 (13:47 +0200)]
seccomp: get_v2_action()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: get_action_name()
Christian Brauner [Thu, 24 May 2018 11:46:06 +0000 (13:46 +0200)]
seccomp: get_action_name()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: get_v2_default_action()
Christian Brauner [Thu, 24 May 2018 11:42:47 +0000 (13:42 +0200)]
seccomp: get_v2_default_action()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: add remove_trailing_newlines()
Christian Brauner [Thu, 24 May 2018 11:38:08 +0000 (13:38 +0200)]
utils: add remove_trailing_newlines()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: parse_config_v1()
Christian Brauner [Thu, 24 May 2018 11:35:01 +0000 (13:35 +0200)]
seccomp: parse_config_v1()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxcseccomp: cleanup header
Christian Brauner [Thu, 24 May 2018 11:34:49 +0000 (13:34 +0200)]
lxcseccomp: cleanup header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2345 from flx42/seccomp-fixes
Christian Brauner [Thu, 24 May 2018 09:30:30 +0000 (11:30 +0200)]
Merge pull request #2345 from flx42/seccomp-fixes

Seccomp fixes

6 years agoseccomp: fix type mismatch when parsing syscall arguments filters
Felix Abecassis [Thu, 24 May 2018 05:25:53 +0000 (22:25 -0700)]
seccomp: fix type mismatch when parsing syscall arguments filters

Specifier %lli was insufficient for the type uint64_t, all values
between 2^63-1 and 2^64-1 were silently converted to 2^63-1.

We can't use %llu since it doesn't handle hexadecimal. Instead, we
parse the values as strings and then use strtoull(3).

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: remove unnecessary memset
Felix Abecassis [Thu, 24 May 2018 04:28:39 +0000 (21:28 -0700)]
seccomp: remove unnecessary memset

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: remove confusing comment line
Felix Abecassis [Thu, 24 May 2018 04:28:01 +0000 (21:28 -0700)]
seccomp: remove confusing comment line

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: fix off-by-one error in array allocation for sscanf
Felix Abecassis [Thu, 24 May 2018 03:51:42 +0000 (20:51 -0700)]
seccomp: fix off-by-one error in array allocation for sscanf

The maximum field width does not include the null terminator.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoMerge pull request #2344 from brauner/2018-05-23/on_demand_log_file
Stéphane Graber [Wed, 23 May 2018 15:28:01 +0000 (11:28 -0400)]
Merge pull request #2344 from brauner/2018-05-23/on_demand_log_file

tools: only create log file when requested

6 years agoMerge pull request #2340 from brauner/2018-05-22/fix_init_cmd
Stéphane Graber [Wed, 23 May 2018 15:27:10 +0000 (11:27 -0400)]
Merge pull request #2340 from brauner/2018-05-22/fix_init_cmd

lxc-init: skip signals that can't be caught

6 years agoMerge pull request #2338 from brauner/2018-05-17/multi_threaded_logging
Stéphane Graber [Wed, 23 May 2018 15:26:43 +0000 (11:26 -0400)]
Merge pull request #2338 from brauner/2018-05-17/multi_threaded_logging

log: enable per-thread container name prefix

6 years agotools: only create log file when requested
Christian Brauner [Wed, 23 May 2018 11:49:42 +0000 (13:49 +0200)]
tools: only create log file when requested

We used to initialize a log unconditionally before. This has led to scenarios
where users where left with container directories and an empty log file even
though they didn't request a log be created at all.
Switch all tools to only create a log file when the user explicitly requests
this.

Closes #1779.
Closes #2032.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2341 from tych0/optionally-execveat
Christian Brauner [Wed, 23 May 2018 10:25:42 +0000 (12:25 +0200)]
Merge pull request #2341 from tych0/optionally-execveat

use execveat syscall to exec lxc-init if supported

6 years agoexecute: use execveat() syscall if supported
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>
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 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

6 years agolog: enable per-thread container name prefix
Christian Brauner [Sun, 20 May 2018 12:05:51 +0000 (14:05 +0200)]
log: enable per-thread container name prefix

When using the LXC API multi-thread and users initialize a log:

struct lxc_log log;
log.name = "my-log";
lxc_log_init(&log);

all threads will have the same "my-log" prefix even though thy might call
lxc_container_new() in separate threads. There is currently no easy way to
handle per-thread container name prefixes.
To handle this carry a reference to the name of the container in struct
lxc_conf and if no log.name was set, use it by default. This way each thread
will get the container it is currently working on as a log-prefix.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: duguhaotian <duguhaotian@gmail.com>
6 years agoconf: simplify write_id_mapping()
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>
6 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>
6 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>
6 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>
6 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

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 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

6 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()

6 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

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 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

6 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

6 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

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: #1435602
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>
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 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