]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
5 years agocgroups: premount cgroups on cgroup2-only systems 3396/head
Christian Brauner [Sun, 3 May 2020 12:08:11 +0000 (14:08 +0200)] 
cgroups: premount cgroups on cgroup2-only systems

Fixes: #3183
Cc: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommon.conf: add cgroup2 default device limits
Christian Brauner [Sun, 3 May 2020 10:01:44 +0000 (12:01 +0200)] 
common.conf: add cgroup2 default device limits

Fixes: #3183
Cc: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: ignore cgroup2 limits on non-cgroup2 layouts
Christian Brauner [Sun, 3 May 2020 09:59:15 +0000 (11:59 +0200)] 
cgroups: ignore cgroup2 limits on non-cgroup2 layouts

Mixing cgroup2 and legacy cgroup systems such that some controllers are enabled
in legacy cgroup hierarchies and other controllers in the unified hierarchies
is simply not something we're supporting. Even systemd's hybrid layout (crazy)
doesn't bind controllers to the unified cgroup hierarchy.

Fixes: #3183
Cc: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3392 from tomponline/tp-ipvlan-netlink
Christian Brauner [Wed, 22 Apr 2020 10:01:42 +0000 (12:01 +0200)] 
Merge pull request #3392 from tomponline/tp-ipvlan-netlink

src/lxc/network: Fixes netlink attribute type 1 has an invalid length message

5 years agosrc/lxc/network: Fixes netlink attribute type 1 has an invalid length message 3392/head
Thomas Parrott [Wed, 22 Apr 2020 09:11:07 +0000 (10:11 +0100)] 
src/lxc/network: Fixes netlink attribute type 1 has an invalid length message

Fixes #3386

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
5 years agoMerge pull request #3391 from stgraber/master
Christian Brauner [Tue, 21 Apr 2020 17:14:10 +0000 (19:14 +0200)] 
Merge pull request #3391 from stgraber/master

apparmor: Allow boot_id

5 years agoapparmor: Allow boot_id 3391/head
Stéphane Graber [Tue, 21 Apr 2020 17:09:07 +0000 (13:09 -0400)] 
apparmor: Allow boot_id

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoconfigure: fix coverity builds
Christian Brauner [Thu, 16 Apr 2020 08:02:59 +0000 (10:02 +0200)] 
configure: fix coverity builds

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3385 from brauner/2020-04-15/fixes
Stéphane Graber [Wed, 15 Apr 2020 21:39:18 +0000 (17:39 -0400)] 
Merge pull request #3385 from brauner/2020-04-15/fixes

cgroups: fix cgroup limit braino

5 years agocgroups: fix cgroup limit braino 3385/head
Christian Brauner [Wed, 15 Apr 2020 21:15:49 +0000 (23:15 +0200)] 
cgroups: fix cgroup limit braino

Fixes: https://discuss.linuxcontainers.org/t/memory-limits-no-longer-being-applied/7429/7
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3384 from brauner/master
Stéphane Graber [Wed, 15 Apr 2020 19:41:05 +0000 (15:41 -0400)] 
Merge pull request #3384 from brauner/master

travis: coverity gets confused about the %m printf extension in glibc

5 years agotravis: coverity gets confused about the %m printf extension in glibc 3384/head
Christian Brauner [Wed, 15 Apr 2020 19:27:53 +0000 (21:27 +0200)] 
travis: coverity gets confused about the %m printf extension in glibc

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3383 from brauner/2020-04-15/fixes
Stéphane Graber [Wed, 15 Apr 2020 14:55:20 +0000 (10:55 -0400)] 
Merge pull request #3383 from brauner/2020-04-15/fixes

log: set GNU_SOURCE as it might help coverity along

5 years agolog: set GNU_SOURCE as it might help coverity along 3383/head
Christian Brauner [Wed, 15 Apr 2020 13:55:57 +0000 (15:55 +0200)] 
log: set GNU_SOURCE as it might help coverity along

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3382 from brauner/2020-04-15/fixes
Stéphane Graber [Wed, 15 Apr 2020 13:24:51 +0000 (09:24 -0400)] 
Merge pull request #3382 from brauner/2020-04-15/fixes

conf: correctly cleanup memory in get_minimal_idmap()

5 years agoconf: correctly cleanup memory in get_minimal_idmap() 3382/head
Christian Brauner [Wed, 15 Apr 2020 12:54:35 +0000 (14:54 +0200)] 
conf: correctly cleanup memory in get_minimal_idmap()

Fixes: Coverity 1461760.
Fixes: Coverity 1461762.
Fixes: Coverity 1461763.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3381 from brauner/2020-04-15/fixes
Stéphane Graber [Wed, 15 Apr 2020 12:38:10 +0000 (08:38 -0400)] 
Merge pull request #3381 from brauner/2020-04-15/fixes

fixes

5 years agorexec: free argv array on failure 3381/head
Christian Brauner [Wed, 15 Apr 2020 12:09:11 +0000 (14:09 +0200)] 
rexec: free argv array on failure

Fixes: Coverity 1461736.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: move check for valid config earlier
Christian Brauner [Wed, 15 Apr 2020 12:06:29 +0000 (14:06 +0200)] 
attach: move check for valid config earlier

Fixes: Coverity 1461735.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolog: restore non-local value
Christian Brauner [Wed, 15 Apr 2020 12:04:04 +0000 (14:04 +0200)] 
log: restore non-local value

Fixes: Coverity 1461734.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agonetwork: log warning on network deconfiguration failures
Christian Brauner [Wed, 15 Apr 2020 12:02:03 +0000 (14:02 +0200)] 
network: log warning on network deconfiguration failures

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: add additional check to lxc_cmd_sock_get_state()
Christian Brauner [Wed, 15 Apr 2020 11:59:19 +0000 (13:59 +0200)] 
commands: add additional check to lxc_cmd_sock_get_state()

to please Coverity.

Fixes: Coverity 1461732.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agozfs: fix resource leak
Christian Brauner [Wed, 15 Apr 2020 11:56:24 +0000 (13:56 +0200)] 
zfs: fix resource leak

Fixes: Coverity 1461730.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocriu: make explicit that we're ignoring rmdir() return value
Christian Brauner [Wed, 15 Apr 2020 11:53:04 +0000 (13:53 +0200)] 
criu: make explicit that we're ignoring rmdir() return value

Fixes: Coverity 1461726.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconf: don't double free in get_minimal_idmap()
Christian Brauner [Wed, 15 Apr 2020 11:51:51 +0000 (13:51 +0200)] 
conf: don't double free in get_minimal_idmap()

Fixes: Coverity 1461725.
Fixes: Coverity 1461727.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: use correct NULL pointer check
Christian Brauner [Wed, 15 Apr 2020 11:46:46 +0000 (13:46 +0200)] 
cgroups: use correct NULL pointer check

Fixes: Coverity 1461722.
Fixes: Coverity 1461737.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agorexec: avoid double-close
Christian Brauner [Wed, 15 Apr 2020 11:42:41 +0000 (13:42 +0200)] 
rexec: avoid double-close

Fixes: Coverity 1461721.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: fix cgroup2 devices
Christian Brauner [Wed, 15 Apr 2020 11:37:51 +0000 (13:37 +0200)] 
cgroups: fix cgroup2 devices

Fixes: Coverity 1461748.
Fixes: Coverity 1461746.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agouuid: close fd
Christian Brauner [Wed, 15 Apr 2020 09:59:57 +0000 (11:59 +0200)] 
uuid: close fd

Fixes: Coverity 1461751.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: do not pass NULL pointer
Christian Brauner [Wed, 15 Apr 2020 09:56:54 +0000 (11:56 +0200)] 
cgroups: do not pass NULL pointer

Fixes: Coverity 1461752.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3380 from brauner/2020-04-15/fixes
Christian Brauner [Wed, 15 Apr 2020 09:45:57 +0000 (11:45 +0200)] 
Merge pull request #3380 from brauner/2020-04-15/fixes

fixes

5 years agoconf: fix tty cleanup 3380/head
Christian Brauner [Wed, 15 Apr 2020 09:32:48 +0000 (11:32 +0200)] 
conf: fix tty cleanup

Fixes: Coverity 1461755.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomemory_utils: directly NULL ptr in free_disarm()
Christian Brauner [Wed, 15 Apr 2020 09:15:56 +0000 (11:15 +0200)] 
memory_utils: directly NULL ptr in free_disarm()

This should keep coverity happy.

Fixes: Coverity 1461757.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3379 from brauner/upstream/master
Christian Brauner [Wed, 15 Apr 2020 09:00:48 +0000 (11:00 +0200)] 
Merge pull request #3379 from brauner/upstream/master

travis: add back coverity

5 years agotravis: add back coverity 3379/head
Christian Brauner [Wed, 15 Apr 2020 08:50:59 +0000 (10:50 +0200)] 
travis: add back coverity

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3378 from brauner/2020-04-13/fixes
Stéphane Graber [Mon, 13 Apr 2020 15:24:24 +0000 (11:24 -0400)] 
Merge pull request #3378 from brauner/2020-04-13/fixes

cgroups: adhere to boolean return

5 years agocgroups: adhere to boolean return 3378/head
Christian Brauner [Mon, 13 Apr 2020 12:39:18 +0000 (14:39 +0200)] 
cgroups: adhere to boolean return

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3377 from lifeng68/fix_cgroup_exit
Christian Brauner [Mon, 13 Apr 2020 06:59:58 +0000 (08:59 +0200)] 
Merge pull request #3377 from lifeng68/fix_cgroup_exit

cgroup: fix wrong use of cgfd_con in cgroup_exit

5 years agocgroup: fix wrong use of cgfd_con in cgroup_exit 3377/head
LiFeng [Mon, 13 Apr 2020 04:52:30 +0000 (12:52 +0800)] 
cgroup: fix wrong use of cgfd_con in cgroup_exit

Signed-off-by: LiFeng <lifeng68@huawei.com>
5 years agoMerge pull request #3376 from toddnni/lxc-oci-fix
Stéphane Graber [Mon, 13 Apr 2020 02:59:45 +0000 (22:59 -0400)] 
Merge pull request #3376 from toddnni/lxc-oci-fix

Fix lxc-oci template with loop backingstore

5 years agoFix lxc-oci template with loop backingstore 3376/head
Toni Ylenius [Sun, 12 Apr 2020 19:28:24 +0000 (22:28 +0300)] 
Fix lxc-oci template with loop backingstore

Move the content of rootfs inside OCI package to rootfs instead of
replacing it, as the directory is used as the mountpoint.

Tested with directory and loop backingstore.

Signed-off-by: Toni Ylenius <toni.ylenius@iki.fi>
5 years agoMerge pull request #3375 from brauner/2020-04-12/fixes
Stéphane Graber [Sun, 12 Apr 2020 17:16:02 +0000 (13:16 -0400)] 
Merge pull request #3375 from brauner/2020-04-12/fixes

cgroups: ignore legacy limits on pure cgroup2 systems

5 years agoMerge pull request #3374 from stgraber/master
Christian Brauner [Sun, 12 Apr 2020 14:51:20 +0000 (16:51 +0200)] 
Merge pull request #3374 from stgraber/master

tests/no-new-privs: Don't mess with /etc/lxc

5 years agocgroups: ignore legacy limits on pure cgroup2 systems 3375/head
Christian Brauner [Sun, 12 Apr 2020 08:19:40 +0000 (10:19 +0200)] 
cgroups: ignore legacy limits on pure cgroup2 systems

Link: https://github.com/lxc/lxc/issues/3183#issuecomment-612462322
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotests/no-new-privs: Don't mess with /etc/lxc 3374/head
Stéphane Graber [Sun, 12 Apr 2020 03:05:04 +0000 (23:05 -0400)] 
tests/no-new-privs: Don't mess with /etc/lxc

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoMerge pull request #3370 from stgraber/master
Christian Brauner [Fri, 10 Apr 2020 19:09:51 +0000 (21:09 +0200)] 
Merge pull request #3370 from stgraber/master

lxc-update-config: Fix bad handling of lxc.logfile

5 years agolxc-update-config: Fix bad handling of lxc.logfile 3370/head
Stéphane Graber [Fri, 10 Apr 2020 18:43:35 +0000 (14:43 -0400)] 
lxc-update-config: Fix bad handling of lxc.logfile

Closes #3369

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoMerge pull request #3368 from brauner/2020-04-09/fixes
Stéphane Graber [Thu, 9 Apr 2020 13:20:52 +0000 (09:20 -0400)] 
Merge pull request #3368 from brauner/2020-04-09/fixes

fixes

5 years agoconf: move_ptr() in all cases in mapped_hostid_add() 3368/head
Christian Brauner [Thu, 9 Apr 2020 12:30:31 +0000 (14:30 +0200)] 
conf: move_ptr() in all cases in mapped_hostid_add()

Closes #3366.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3367 from tomponline/tp-nic-ipvlan
Christian Brauner [Thu, 9 Apr 2020 12:13:06 +0000 (14:13 +0200)] 
Merge pull request #3367 from tomponline/tp-nic-ipvlan

src/lxc/network: ipvlan comment and code style tweak

5 years agoconf: use macros all around in lxc_map_ids()
Christian Brauner [Thu, 9 Apr 2020 10:49:16 +0000 (12:49 +0200)] 
conf: use macros all around in lxc_map_ids()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconf: tweak get_minimal_idmap()
Christian Brauner [Thu, 9 Apr 2020 10:44:25 +0000 (12:44 +0200)] 
conf: tweak get_minimal_idmap()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agosrc/lxc/network: ipvlan comment and code style tweak 3367/head
Thomas Parrott [Thu, 9 Apr 2020 10:35:48 +0000 (11:35 +0100)] 
src/lxc/network: ipvlan comment and code style tweak

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
5 years agoMerge pull request #3365 from albatross0/ipvlan_l2
Christian Brauner [Thu, 9 Apr 2020 10:25:33 +0000 (12:25 +0200)] 
Merge pull request #3365 from albatross0/ipvlan_l2

network: Make it possible to set the mode of IPVLAN to L2

5 years agonetwork: Make it possible to set the mode of IPVLAN to L2 3365/head
KUWAZAWA Takuya [Thu, 9 Apr 2020 06:40:15 +0000 (15:40 +0900)] 
network: Make it possible to set the mode of IPVLAN to L2

Signed-off-by: KUWAZAWA Takuya <albatross0@gmail.com>
5 years agoMerge pull request #3362 from brauner/2020-04-07/fixes
Stéphane Graber [Wed, 8 Apr 2020 12:56:41 +0000 (08:56 -0400)] 
Merge pull request #3362 from brauner/2020-04-07/fixes

lxc_user_nic: fixes

5 years agoseccomp: newer kernels require the buffer to be zeroed 3362/head
Christian Brauner [Wed, 8 Apr 2020 12:42:05 +0000 (14:42 +0200)] 
seccomp: newer kernels require the buffer to be zeroed

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: whitespace fixes
Christian Brauner [Wed, 8 Apr 2020 08:01:01 +0000 (10:01 +0200)] 
cgroups: whitespace fixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxc_user_nic: continue when we failed to find a group
Christian Brauner [Tue, 7 Apr 2020 19:28:32 +0000 (21:28 +0200)] 
lxc_user_nic: continue when we failed to find a group

Closes #3361.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxc_user_nic: simplify group retrieval
Christian Brauner [Tue, 7 Apr 2020 19:28:17 +0000 (21:28 +0200)] 
lxc_user_nic: simplify group retrieval

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3360 from brauner/2020-04-07/fixes
Stéphane Graber [Tue, 7 Apr 2020 12:56:26 +0000 (08:56 -0400)] 
Merge pull request #3360 from brauner/2020-04-07/fixes

start: ensure all file descriptors are closed during exec

5 years agosyscall_numbers: handle riscv 3360/head
Christian Brauner [Tue, 7 Apr 2020 10:59:59 +0000 (12:59 +0200)] 
syscall_numbers: handle riscv

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: ensure all file descriptors are closed during exec
Christian Brauner [Tue, 7 Apr 2020 08:36:23 +0000 (10:36 +0200)] 
start: ensure all file descriptors are closed during exec

Closes https://github.com/checkpoint-restore/criu/issues/1011.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3359 from Blub/legacy-devices-isolation-change
Christian Brauner [Tue, 7 Apr 2020 08:35:39 +0000 (10:35 +0200)] 
Merge pull request #3359 from Blub/legacy-devices-isolation-change

cgroup isolation: handle devices cgroup early

5 years agocgroup isolation: handle devices cgroup early 3359/head
Wolfgang Bumiller [Tue, 7 Apr 2020 07:57:09 +0000 (09:57 +0200)] 
cgroup isolation: handle devices cgroup early

Otherwise we cannot use an 'a' entry in devices.deny/allow
as these are not permitted once a subdirectory was created.

Without isolation we initialize the devices cgroup
particularly late, so there are probably cases which cannot
work with isolation.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoMerge pull request #3357 from Blub/cgroup-isolation-fixes
Christian Brauner [Sun, 5 Apr 2020 15:08:49 +0000 (17:08 +0200)] 
Merge pull request #3357 from Blub/cgroup-isolation-fixes

Cgroup isolation fixes

5 years agoget the right path in get_cgroup command 3357/head
Wolfgang Bumiller [Sun, 5 Apr 2020 14:12:45 +0000 (16:12 +0200)] 
get the right path in get_cgroup command

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoconfile: fix jump table order
Wolfgang Bumiller [Sun, 5 Apr 2020 13:55:28 +0000 (15:55 +0200)] 
confile: fix jump table order

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoMerge pull request #3356 from tenforward/japanese
Christian Brauner [Sun, 5 Apr 2020 12:46:22 +0000 (14:46 +0200)] 
Merge pull request #3356 from tenforward/japanese

doc: Add lxc.cgroup.dir.{monitor,container,container.inner} to Japanese man

5 years agodoc: Add lxc.cgroup.dir.{monitor,container,container.inner} to Japanese man 3356/head
KATOH Yasufumi [Sun, 5 Apr 2020 12:18:59 +0000 (21:18 +0900)] 
doc: Add lxc.cgroup.dir.{monitor,container,container.inner} to Japanese man

Update for commit a900cba

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
5 years agoMerge pull request #3355 from brauner/2020-04-04/fixes
Stéphane Graber [Sat, 4 Apr 2020 14:38:01 +0000 (10:38 -0400)] 
Merge pull request #3355 from brauner/2020-04-04/fixes

api-extensions: add and document cgroup_advanced_isolation

5 years agoapi-extensions: add and document cgroup_advanced_isolation 3355/head
Christian Brauner [Sat, 4 Apr 2020 10:07:43 +0000 (12:07 +0200)] 
api-extensions: add and document cgroup_advanced_isolation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3353 from Blub/lxc.cgroup.dir-components
Christian Brauner [Fri, 3 Apr 2020 18:26:02 +0000 (20:26 +0200)] 
Merge pull request #3353 from Blub/lxc.cgroup.dir-components

 introduce lxc.cgroup.dir.{monitor,container,container.inner}

5 years agoconfile: coding style fixes for set_config_cgroup_container_inner_dir() 3353/head
Christian Brauner [Fri, 3 Apr 2020 18:10:58 +0000 (20:10 +0200)] 
confile: coding style fixes for set_config_cgroup_container_inner_dir()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agodoc: s/lxc.cgroup.container.namespace/lxc.cgroup.container.inner/g
Christian Brauner [Fri, 3 Apr 2020 18:08:41 +0000 (20:08 +0200)] 
doc: s/lxc.cgroup.container.namespace/lxc.cgroup.container.inner/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: remove unused variable
Christian Brauner [Fri, 3 Apr 2020 18:07:41 +0000 (20:07 +0200)] 
cgroups: remove unused variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agointroduce lxc.cgroup.dir.{monitor,container,container.inner}
Wolfgang Bumiller [Thu, 2 Apr 2020 08:01:37 +0000 (10:01 +0200)] 
introduce lxc.cgroup.dir.{monitor,container,container.inner}

This is a new approach to #1302 with a container-side
configuration instead of a global boolean flag.

Contrary to the previous PR using an optional additional
parameter for the get-cgroup command, this introduces two
new additional commands to get the limiting cgroup path and
cgroup2 file descriptor. If the limiting option is not in
use, these behave identical to their full-path counterparts.

If these variables are used the payload will end up in the
concatenation of lxc.cgroup.dir.container and
lxc.cgroup.dir.container.inner (which may be empty), and the
monitor will end up in lxc.cgruop.dir.monitor. The
directories are fixed, no retry count logic is applied,
failing to create these directories will simply be a hard
error.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoMerge pull request #3352 from Blub/readd-cgroup-ops-check
Christian Brauner [Fri, 3 Apr 2020 08:28:37 +0000 (10:28 +0200)] 
Merge pull request #3352 from Blub/readd-cgroup-ops-check

Revert "start: remove unnecessary check for valid cgroup_ops"

5 years agoRevert "start: remove unnecessary check for valid cgroup_ops" 3352/head
Wolfgang Bumiller [Fri, 3 Apr 2020 08:09:38 +0000 (10:09 +0200)] 
Revert "start: remove unnecessary check for valid cgroup_ops"

This reverts commit 52520e4f793f73e5956c2d9de9c83f074622ce1d.

This can be NULL when there's a pre-start hook which fails.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoMerge pull request #3350 from brauner/2020-04-02/fixes
Stéphane Graber [Thu, 2 Apr 2020 16:21:34 +0000 (12:21 -0400)] 
Merge pull request #3350 from brauner/2020-04-02/fixes

lxccontainer: poll takes millisecond not seconds

5 years agolxccontainer: poll takes millisecond not seconds 3350/head
Christian Brauner [Thu, 2 Apr 2020 16:19:31 +0000 (18:19 +0200)] 
lxccontainer: poll takes millisecond not seconds

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3349 from cyphar/cgfsng-uninitialised-2
Christian Brauner [Thu, 2 Apr 2020 15:37:17 +0000 (17:37 +0200)] 
Merge pull request #3349 from cyphar/cgfsng-uninitialised-2

cgroups: fix build warning on GCC 7

5 years agocgroups: fix build warning on GCC 7 3349/head
Aleksa Sarai [Thu, 2 Apr 2020 15:13:11 +0000 (02:13 +1100)] 
cgroups: fix build warning on GCC 7

GCC 7 appears to be clever enough to detect that transient_len is
uninitialised but not that it won't be used despite [1]. Just initialise
it to zero to stop the complaining, and allow LXC to build on openSUSE
Leap.

[1]: 346830421a96 ("cgroups: fix "uninitialized transient_len" warning")

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
5 years agoMerge pull request #3348 from brauner/2020-04-02/fixes
Stéphane Graber [Thu, 2 Apr 2020 14:35:43 +0000 (10:35 -0400)] 
Merge pull request #3348 from brauner/2020-04-02/fixes

fixes

5 years agoutils: use setres{u,g}id() in lxc_switch_uid_gid() 3348/head
Christian Brauner [Thu, 2 Apr 2020 09:51:13 +0000 (11:51 +0200)] 
utils: use setres{u,g}id() in lxc_switch_uid_gid()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoutils: rework fix_stdio_permissions()
Christian Brauner [Thu, 2 Apr 2020 09:50:27 +0000 (11:50 +0200)] 
utils: rework fix_stdio_permissions()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3344 from gaohuatao-1/master
Christian Brauner [Thu, 2 Apr 2020 09:38:48 +0000 (11:38 +0200)] 
Merge pull request #3344 from gaohuatao-1/master

fix non-root user cannot write /dev/stdout

5 years agoMerge pull request #3347 from cyphar/cgfsng-uninitialised
Christian Brauner [Thu, 2 Apr 2020 08:46:45 +0000 (10:46 +0200)] 
Merge pull request #3347 from cyphar/cgfsng-uninitialised

cgroups: fix "uninitialized transient_len" warning

5 years agocgroups: fix "uninitialized transient_len" warning 3347/head
Aleksa Sarai [Thu, 2 Apr 2020 08:15:11 +0000 (19:15 +1100)] 
cgroups: fix "uninitialized transient_len" warning

Without this change, a build error is triggered if you compile with
-Werror=maybe-uninitialized.

 cgroups/cgfsng.c: In function 'cgfsng_monitor_enter':
 groups/cgfsng.c:1387:9: error: 'transient_len' may be used uninitialized in this function
    ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", transient, transient_len);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The issue is that if handler->transient_pid is 0, then transient_len is
uninitialised but lxc_writeat(..., transient_len) still gets called.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
5 years agoMerge pull request #3346 from stgraber/master
Christian Brauner [Wed, 1 Apr 2020 21:03:09 +0000 (23:03 +0200)] 
Merge pull request #3346 from stgraber/master

systemd: Add Documentation key

5 years agoMerge pull request #3345 from brauner/2020-03-30/fixes
Stéphane Graber [Wed, 1 Apr 2020 20:57:25 +0000 (16:57 -0400)] 
Merge pull request #3345 from brauner/2020-03-30/fixes

fixes

5 years agosystemd: Add Documentation key 3346/head
Stéphane Graber [Wed, 1 Apr 2020 20:57:15 +0000 (16:57 -0400)] 
systemd: Add Documentation key

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoautotools: don't install run-coccinelle.sh 3345/head
Christian Brauner [Wed, 1 Apr 2020 20:25:53 +0000 (22:25 +0200)] 
autotools: don't install run-coccinelle.sh

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3343 from Blub/apparmor-mount-rule-generation
Christian Brauner [Wed, 1 Apr 2020 19:16:34 +0000 (21:16 +0200)] 
Merge pull request #3343 from Blub/apparmor-mount-rule-generation

apparmor: generate ro,bind,remount rule list

5 years agoapparmor: generate ro,bind,remount rule list 3343/head
Wolfgang Bumiller [Fri, 2 Aug 2019 10:57:42 +0000 (12:57 +0200)] 
apparmor: generate ro,bind,remount rule list

and update to changes based on lxd

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofix non-root user cannot write /dev/stdout 3344/head
gaohuatao [Wed, 1 Apr 2020 13:36:44 +0000 (09:36 -0400)] 
fix non-root user cannot write /dev/stdout

Signed-off-by: gaohuatao <gaohuatao@huawei.com>
5 years agoMerge pull request #3341 from Blub/upstream-exec-reload
Christian Brauner [Tue, 31 Mar 2020 18:23:38 +0000 (20:23 +0200)] 
Merge pull request #3341 from Blub/upstream-exec-reload

init: add ExecReload to lxc.service to only reload profiles

5 years agoMerge pull request #3342 from Blub/upstream-monitord-service
Christian Brauner [Tue, 31 Mar 2020 18:22:48 +0000 (20:22 +0200)] 
Merge pull request #3342 from Blub/upstream-monitord-service

allow running lxc-monitord as a system daemon

5 years agoallow running lxc-monitord as a system daemon 3342/head
Wolfgang Bumiller [Tue, 31 Mar 2020 13:22:42 +0000 (15:22 +0200)] 
allow running lxc-monitord as a system daemon

lxc-monitord instances are spawned on demand and, if this
happens from a service, the daemon is considered part of
it by systemd, as it is running in the same cgroups. This
can be avoided by leaving it running permanently.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoinit: add ExecReload to lxc.service to only reload profiles 3341/head
Wolfgang Bumiller [Tue, 31 Mar 2020 13:31:23 +0000 (15:31 +0200)] 
init: add ExecReload to lxc.service to only reload profiles

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>