]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
4 years agoconf: kill PATH_MAX bytes 3662/head
Christian Brauner [Mon, 8 Feb 2021 19:32:56 +0000 (20:32 +0100)] 
conf: kill PATH_MAX bytes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: kill PATH_MAX bytes
Christian Brauner [Mon, 8 Feb 2021 19:30:59 +0000 (20:30 +0100)] 
conf: kill PATH_MAX bytes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotests: add logging to lxc-test-unpriv
Christian Brauner [Mon, 8 Feb 2021 19:24:01 +0000 (20:24 +0100)] 
tests: add logging to lxc-test-unpriv

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: fd-only tty setup
Christian Brauner [Mon, 8 Feb 2021 13:52:50 +0000 (14:52 +0100)] 
conf: fd-only tty setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: s/OPEN_TREE_CLONE | OPEN_TREE_CLONE/OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC/g
Christian Brauner [Mon, 8 Feb 2021 13:46:08 +0000 (14:46 +0100)] 
mount_utils: s/OPEN_TREE_CLONE | OPEN_TREE_CLONE/OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: rework rootfs pinning
Christian Brauner [Mon, 8 Feb 2021 10:24:57 +0000 (11:24 +0100)] 
conf: rework rootfs pinning

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: kill PAT_MAX bytes
Christian Brauner [Mon, 8 Feb 2021 09:22:00 +0000 (10:22 +0100)] 
conf: kill PAT_MAX bytes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: kill PATH_MAX bytes
Christian Brauner [Mon, 8 Feb 2021 09:21:18 +0000 (10:21 +0100)] 
conf: kill PATH_MAX bytes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: don't pass struct lxc_conf
Christian Brauner [Mon, 8 Feb 2021 09:17:05 +0000 (10:17 +0100)] 
conf: don't pass struct lxc_conf

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: kill PATH_MAX bytes
Christian Brauner [Mon, 8 Feb 2021 09:16:18 +0000 (10:16 +0100)] 
conf: kill PATH_MAX bytes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: s/setup_mount()/setup_mount_fstab()/g
Christian Brauner [Mon, 8 Feb 2021 08:54:57 +0000 (09:54 +0100)] 
conf: s/setup_mount()/setup_mount_fstab()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: add locked flag helpers
Christian Brauner [Sun, 7 Feb 2021 15:19:36 +0000 (16:19 +0100)] 
mount_utils: add locked flag helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3660 from brauner/2021-02-05/fixes_1
Stéphane Graber [Fri, 5 Feb 2021 22:01:39 +0000 (17:01 -0500)] 
Merge pull request #3660 from brauner/2021-02-05/fixes_1

mount_utils: initialize fd

4 years agomount_utils: kill mount_filesystem() 3660/head
Christian Brauner [Fri, 5 Feb 2021 20:49:51 +0000 (21:49 +0100)] 
mount_utils: kill mount_filesystem()

We have way better helpers now.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: switch to simple mount()
Christian Brauner [Fri, 5 Feb 2021 20:47:56 +0000 (21:47 +0100)] 
attach: switch to simple mount()

At the point where we're remounging proc and sys we're in the container's
namespaces so there's no chance of escape so a simple mount() syscall will
suffice.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: initialize fd
Christian Brauner [Fri, 5 Feb 2021 20:21:01 +0000 (21:21 +0100)] 
mount_utils: initialize fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3659 from brauner/2021-02-05/fixes
Stéphane Graber [Fri, 5 Feb 2021 18:40:19 +0000 (13:40 -0500)] 
Merge pull request #3659 from brauner/2021-02-05/fixes

mount: extend support for the new mount api

4 years agotree-wide: make use of new_mount_api() where it makes sense 3659/head
Christian Brauner [Fri, 5 Feb 2021 17:46:47 +0000 (18:46 +0100)] 
tree-wide: make use of new_mount_api() where it makes sense

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: detect new mount api support
Christian Brauner [Fri, 5 Feb 2021 17:42:10 +0000 (18:42 +0100)] 
mount_utils: detect new mount api support

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: kill mount_from_at()
Christian Brauner [Fri, 5 Feb 2021 16:54:19 +0000 (17:54 +0100)] 
mount_utils: kill mount_from_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: use fd_bind_mount() in lxc_fill_autodev()
Christian Brauner [Fri, 5 Feb 2021 16:53:41 +0000 (17:53 +0100)] 
conf: use fd_bind_mount() in lxc_fill_autodev()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: add support for bind-mounts through the new mount api
Christian Brauner [Fri, 5 Feb 2021 16:38:05 +0000 (17:38 +0100)] 
mount_utils: add support for bind-mounts through the new mount api

fd_bind_mount()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: kill mount_at()
Christian Brauner [Fri, 5 Feb 2021 16:34:57 +0000 (17:34 +0100)] 
mount_utils: kill mount_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: switch __cg_mount_direct() to use the new mount api
Christian Brauner [Fri, 5 Feb 2021 16:20:27 +0000 (17:20 +0100)] 
cgroups: switch __cg_mount_direct() to use the new mount api

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: switch tmpfs mounting to new mount api
Christian Brauner [Fri, 5 Feb 2021 15:37:17 +0000 (16:37 +0100)] 
cgroups: switch tmpfs mounting to new mount api

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: switch mount_autodev() to new mount api
Christian Brauner [Fri, 5 Feb 2021 15:36:59 +0000 (16:36 +0100)] 
conf: switch mount_autodev() to new mount api

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: add extended helpers for new mount api
Christian Brauner [Fri, 5 Feb 2021 15:35:36 +0000 (16:35 +0100)] 
mount_utils: add extended helpers for new mount api

fs_prepare()
fs_set_property()
fs_attach()
fs_mount()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomount_utils: move mount_at() and mount_from_at() over from utils.{c,h}
Christian Brauner [Fri, 5 Feb 2021 11:34:07 +0000 (12:34 +0100)] 
mount_utils: move mount_at() and mount_from_at() over from utils.{c,h}

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3657 from brauner/2021-02-05/init_groups
Christian Brauner [Fri, 5 Feb 2021 11:30:17 +0000 (12:30 +0100)] 
Merge pull request #3657 from brauner/2021-02-05/init_groups

conf: implement lxc.init.groups

4 years agoconfile: make garbage groups an error 3657/head
Christian Brauner [Fri, 5 Feb 2021 10:59:14 +0000 (11:59 +0100)] 
confile: make garbage groups an error

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotests: improve lxc.init.groups tests
Christian Brauner [Fri, 5 Feb 2021 10:28:08 +0000 (11:28 +0100)] 
tests: improve lxc.init.groups tests

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile: handle appending init groups
Christian Brauner [Fri, 5 Feb 2021 10:06:24 +0000 (11:06 +0100)] 
confile: handle appending init groups

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: use lxc_groups_t directly
Christian Brauner [Fri, 5 Feb 2021 10:05:58 +0000 (11:05 +0100)] 
conf: use lxc_groups_t directly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach_options: use size_t for lxc_groups_t
Christian Brauner [Fri, 5 Feb 2021 10:05:15 +0000 (11:05 +0100)] 
attach_options: use size_t for lxc_groups_t

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: use brackets around flag check
Christian Brauner [Fri, 5 Feb 2021 09:40:56 +0000 (10:40 +0100)] 
attach: use brackets around flag check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach_options: use standard C pointer syntax
Christian Brauner [Fri, 5 Feb 2021 09:38:27 +0000 (10:38 +0100)] 
attach_options: use standard C pointer syntax

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach_options: initialize .groups
Christian Brauner [Fri, 5 Feb 2021 09:37:09 +0000 (10:37 +0100)] 
attach_options: initialize .groups

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: Add groups option to keep additional group IDs.
Ruben Jenster [Wed, 3 Feb 2021 23:37:44 +0000 (00:37 +0100)] 
attach: Add groups option to keep additional group IDs.

Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
4 years agoconfile: add lxc.init.groups to keep additional groups
Ruben Jenster [Fri, 30 Oct 2020 09:00:07 +0000 (10:00 +0100)] 
confile: add lxc.init.groups to keep additional groups

Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
4 years agoutils: rework lxc_setgroups()
Christian Brauner [Fri, 5 Feb 2021 11:07:44 +0000 (12:07 +0100)] 
utils: rework lxc_setgroups()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: use lxc_drop_groups() instead of lxc_setgroups(0, NULL)
Christian Brauner [Fri, 5 Feb 2021 08:56:59 +0000 (09:56 +0100)] 
tree-wide: use lxc_drop_groups() instead of lxc_setgroups(0, NULL)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoutils: add lxc_drop_groups()
Christian Brauner [Fri, 5 Feb 2021 08:55:16 +0000 (09:55 +0100)] 
utils: add lxc_drop_groups()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3655 from brauner/2021-02-04/fixes_1
Stéphane Graber [Thu, 4 Feb 2021 22:44:48 +0000 (17:44 -0500)] 
Merge pull request #3655 from brauner/2021-02-04/fixes_1

Tiny fixes in attach and utils

4 years agoutils: check for snprintf() error 3655/head
Christian Brauner [Thu, 4 Feb 2021 21:48:18 +0000 (22:48 +0100)] 
utils: check for snprintf() error

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: improve logging and terminology
Christian Brauner [Thu, 4 Feb 2021 21:42:58 +0000 (22:42 +0100)] 
attach: improve logging and terminology

The term "intermediate process" is not very nice imho, "transient process" fits
better.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3651 from brauner/2021-02-04/fixes
Stéphane Graber [Thu, 4 Feb 2021 20:40:31 +0000 (15:40 -0500)] 
Merge pull request #3651 from brauner/2021-02-04/fixes

cgroups: fix cgroup mounting

4 years agocgroups: check for correct error in __cg_unified_attach() from cgroup_attach() 3651/head
Christian Brauner [Thu, 4 Feb 2021 19:27:40 +0000 (20:27 +0100)] 
cgroups: check for correct error in __cg_unified_attach() from cgroup_attach()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: s/dfd_root_host/dfd_host/g
Christian Brauner [Thu, 4 Feb 2021 18:06:38 +0000 (19:06 +0100)] 
tree-wide: s/dfd_root_host/dfd_host/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: s/mntpt_fd/dfd_mnt/g
Christian Brauner [Thu, 4 Feb 2021 18:05:55 +0000 (19:05 +0100)] 
tree-wide: s/mntpt_fd/dfd_mnt/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotree-wide: s/dev_mntpt_fd/dfd_dev/g
Christian Brauner [Thu, 4 Feb 2021 18:05:05 +0000 (19:05 +0100)] 
tree-wide: s/dev_mntpt_fd/dfd_dev/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agosyscall_wrappers: fix PROTECT_OPEN_W macro
Christian Brauner [Thu, 4 Feb 2021 15:06:43 +0000 (16:06 +0100)] 
syscall_wrappers: fix PROTECT_OPEN_W macro

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: restricted fd-only lxc_fill_autodev()
Christian Brauner [Thu, 4 Feb 2021 14:57:13 +0000 (15:57 +0100)] 
conf: restricted fd-only lxc_fill_autodev()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: start stashing dfd to host's / during container setup
Christian Brauner [Thu, 4 Feb 2021 14:56:37 +0000 (15:56 +0100)] 
conf: start stashing dfd to host's / during container setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: fix lxc_setup_dev_console()
Christian Brauner [Thu, 4 Feb 2021 14:52:54 +0000 (15:52 +0100)] 
conf: fix lxc_setup_dev_console()

We were printing garbage on accident.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoutils: add mount_from_at()
Christian Brauner [Thu, 4 Feb 2021 14:23:55 +0000 (15:23 +0100)] 
utils: add mount_from_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: restrict open calls in cgroup_attach_create_leaf()
Christian Brauner [Thu, 4 Feb 2021 14:05:43 +0000 (15:05 +0100)] 
cgroups: restrict open calls in cgroup_attach_create_leaf()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve error handling and logging in cgroup_attach_leaf()
Christian Brauner [Thu, 4 Feb 2021 14:02:14 +0000 (15:02 +0100)] 
cgroups: improve error handling and logging in cgroup_attach_leaf()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fix argument vetting in cgroup_attach()
Christian Brauner [Thu, 4 Feb 2021 14:01:45 +0000 (15:01 +0100)] 
cgroups: fix argument vetting in cgroup_attach()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: fix fallback logic when attaching to cgroups
Christian Brauner [Thu, 4 Feb 2021 14:01:09 +0000 (15:01 +0100)] 
attach: fix fallback logic when attaching to cgroups

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: switch to fd-based cgroup mounting
Christian Brauner [Thu, 4 Feb 2021 13:00:18 +0000 (14:00 +0100)] 
cgroups: switch to fd-based cgroup mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: restricted fd-only controller mountpoint creation
Christian Brauner [Thu, 4 Feb 2021 11:50:43 +0000 (12:50 +0100)] 
cgroups: restricted fd-only controller mountpoint creation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: fix cgroup mounting
Christian Brauner [Thu, 4 Feb 2021 10:22:26 +0000 (11:22 +0100)] 
cgroups: fix cgroup mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3650 from brauner/2021-02-03/fixes_1
Stéphane Graber [Wed, 3 Feb 2021 22:05:35 +0000 (17:05 -0500)] 
Merge pull request #3650 from brauner/2021-02-03/fixes_1

conf: harden various mount paths

4 years agoutils: harden __safe_mount_beneath_at() 3650/head
Christian Brauner [Wed, 3 Feb 2021 20:57:44 +0000 (21:57 +0100)] 
utils: harden __safe_mount_beneath_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: refactor transient procfs mounting
Christian Brauner [Wed, 3 Feb 2021 20:31:03 +0000 (21:31 +0100)] 
conf: refactor transient procfs mounting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: restrict open call in lxc_mount_rootfs()
Christian Brauner [Wed, 3 Feb 2021 19:58:45 +0000 (20:58 +0100)] 
conf: restrict open call in lxc_mount_rootfs()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: make lxc_create_tmp_proc_mount() static
Christian Brauner [Wed, 3 Feb 2021 19:55:01 +0000 (20:55 +0100)] 
conf: make lxc_create_tmp_proc_mount() static

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: coding style
Christian Brauner [Wed, 3 Feb 2021 19:51:56 +0000 (20:51 +0100)] 
conf: coding style

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3648 from brauner/2021-02-03/fixes
Stéphane Graber [Wed, 3 Feb 2021 15:38:50 +0000 (10:38 -0500)] 
Merge pull request #3648 from brauner/2021-02-03/fixes

conf: open hardening & fd-only operations

4 years agoMerge pull request #3649 from brauner/2021-02-03/attach_via_pidfds
Stéphane Graber [Wed, 3 Feb 2021 15:23:53 +0000 (10:23 -0500)] 
Merge pull request #3649 from brauner/2021-02-03/attach_via_pidfds

attach: attach to namespaces via pidfds

4 years agoattach: attach to namespaces via pidfds 3649/head
Christian Brauner [Wed, 3 Feb 2021 14:12:37 +0000 (15:12 +0100)] 
attach: attach to namespaces via pidfds

This is a feature we've enabled in kernel v5.8 and v5.9.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: fd-only devtps setup 3648/head
Christian Brauner [Wed, 3 Feb 2021 10:27:53 +0000 (11:27 +0100)] 
conf: fd-only devtps setup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: fd-only pivot root
Christian Brauner [Wed, 3 Feb 2021 10:18:04 +0000 (11:18 +0100)] 
conf: fd-only pivot root

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: restrict open for lxc_mount_rootfs()
Christian Brauner [Wed, 3 Feb 2021 09:58:35 +0000 (10:58 +0100)] 
conf: restrict open for lxc_mount_rootfs()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: fd-only operations in lxc_setup_dev_symlinks()
Christian Brauner [Wed, 3 Feb 2021 09:48:12 +0000 (10:48 +0100)] 
conf: fd-only operations in lxc_setup_dev_symlinks()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: harden open in lxc_fill_autodev()
Christian Brauner [Wed, 3 Feb 2021 09:35:16 +0000 (10:35 +0100)] 
conf: harden open in lxc_fill_autodev()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: restrict open of dev/
Christian Brauner [Wed, 3 Feb 2021 09:55:48 +0000 (10:55 +0100)] 
conf: restrict open of dev/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: remove unnecessary syscall
Christian Brauner [Wed, 3 Feb 2021 09:04:59 +0000 (10:04 +0100)] 
conf: remove unnecessary syscall

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agorexec: mark all fds as close-on-exec if possible
Christian Brauner [Wed, 3 Feb 2021 08:48:25 +0000 (09:48 +0100)] 
rexec: mark all fds as close-on-exec if possible

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agosyscalls: add close_range()
Christian Brauner [Wed, 3 Feb 2021 08:45:30 +0000 (09:45 +0100)] 
syscalls: add close_range()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agorexec: check lseek() return value
Christian Brauner [Wed, 3 Feb 2021 08:39:21 +0000 (09:39 +0100)] 
rexec: check lseek() return value

Not really needed buy ok.

Fixes: Coverity: 1472769
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotests: check for NULL in device_add_remove
Christian Brauner [Wed, 3 Feb 2021 08:36:23 +0000 (09:36 +0100)] 
tests: check for NULL in device_add_remove

Fixes: Coverity 1472768
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3647 from brauner/2021-02-02/fixes
Stéphane Graber [Tue, 2 Feb 2021 23:30:27 +0000 (18:30 -0500)] 
Merge pull request #3647 from brauner/2021-02-02/fixes

cgroup2: only rely on command socket when getting cgroup values

4 years agocgroups: improve parameter vetting 3647/head
Christian Brauner [Tue, 2 Feb 2021 23:00:50 +0000 (00:00 +0100)] 
cgroups: improve parameter vetting

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotests: support pure unified cgroup layouts in cgpath test
Christian Brauner [Tue, 2 Feb 2021 22:52:18 +0000 (23:52 +0100)] 
tests: support pure unified cgroup layouts in cgpath test

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agotest: add logging to device_add_remove
Christian Brauner [Tue, 2 Feb 2021 22:30:00 +0000 (23:30 +0100)] 
test: add logging to device_add_remove

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agofreezer: remove lxc_cmd_freeze() and lxc_cmd_unfreeze() calls
Christian Brauner [Tue, 2 Feb 2021 22:24:28 +0000 (23:24 +0100)] 
freezer: remove lxc_cmd_freeze() and lxc_cmd_unfreeze() calls

We're now handling them better.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: use __cgroup_unfreeze() directly
Christian Brauner [Tue, 2 Feb 2021 22:20:07 +0000 (23:20 +0100)] 
commands: use __cgroup_unfreeze() directly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: export __cgroup_unfreeze() for use in commands
Christian Brauner [Tue, 2 Feb 2021 22:19:23 +0000 (23:19 +0100)] 
cgroups: export __cgroup_unfreeze() for use in commands

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: use lxc_cmd_get_limiting_cgroup2_fd()
Christian Brauner [Tue, 2 Feb 2021 22:08:04 +0000 (23:08 +0100)] 
cgroups: use lxc_cmd_get_limiting_cgroup2_fd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: add missing lxc_cmd_get_limiting_cgroup2_fd() implementation
Christian Brauner [Tue, 2 Feb 2021 22:05:30 +0000 (23:05 +0100)] 
commands: add missing lxc_cmd_get_limiting_cgroup2_fd() implementation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgpath: add logging
Christian Brauner [Tue, 2 Feb 2021 21:55:52 +0000 (22:55 +0100)] 
cgpath: add logging

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: explicitly close seccomp notifier fd
Christian Brauner [Tue, 2 Feb 2021 21:41:40 +0000 (22:41 +0100)] 
attach: explicitly close seccomp notifier fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: switch back to returning ints
Christian Brauner [Tue, 2 Feb 2021 21:28:01 +0000 (22:28 +0100)] 
cgroups: switch back to returning ints

Whick makes for easier error checking and fallback code.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: check for ENOCGROUP2 explicitly
Christian Brauner [Tue, 2 Feb 2021 21:23:45 +0000 (22:23 +0100)] 
attach: check for ENOCGROUP2 explicitly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: return ENOCGROUP2 from cgroup_attach()
Christian Brauner [Tue, 2 Feb 2021 21:22:53 +0000 (22:22 +0100)] 
cgroups: return ENOCGROUP2 from cgroup_attach()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: stricter argument vetting for cgroup_attach()
Christian Brauner [Tue, 2 Feb 2021 21:22:25 +0000 (22:22 +0100)] 
cgroups: stricter argument vetting for cgroup_attach()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: move down cgroup_attach()
Christian Brauner [Tue, 2 Feb 2021 21:21:38 +0000 (22:21 +0100)] 
cgroups: move down cgroup_attach()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxccontainer: use correct error checks
Christian Brauner [Tue, 2 Feb 2021 21:15:43 +0000 (22:15 +0100)] 
lxccontainer: use correct error checks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: vet parameters
Christian Brauner [Tue, 2 Feb 2021 20:59:04 +0000 (21:59 +0100)] 
cgroups: vet parameters

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