]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
3 years agoconf: remove unused variables
Christian Brauner [Thu, 26 Aug 2021 11:38:07 +0000 (13:38 +0200)]
conf: remove unused variables

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: switch to parse_mount_attrs() even for legacy mount()
Christian Brauner [Thu, 26 Aug 2021 09:11:08 +0000 (11:11 +0200)]
conf: switch to parse_mount_attrs() even for legacy mount()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: support recursive propagation options properly
Christian Brauner [Thu, 26 Aug 2021 09:06:52 +0000 (11:06 +0200)]
conf: support recursive propagation options properly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: rework recursive mount option handling
Christian Brauner [Thu, 26 Aug 2021 08:47:47 +0000 (10:47 +0200)]
conf: rework recursive mount option handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agorootfs: remove "options" member
Christian Brauner [Thu, 26 Aug 2021 08:25:48 +0000 (10:25 +0200)]
rootfs: remove "options" member

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: remove unused mountflags nember
Christian Brauner [Thu, 26 Aug 2021 08:17:21 +0000 (10:17 +0200)]
conf: remove unused mountflags nember

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: port id_map to new list type
Christian Brauner [Wed, 25 Aug 2021 20:38:18 +0000 (22:38 +0200)]
conf: port id_map to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: port cgroup settings to new list type
Christian Brauner [Wed, 25 Aug 2021 17:20:57 +0000 (19:20 +0200)]
conf: port cgroup settings to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: port procs to new list type
Christian Brauner [Wed, 25 Aug 2021 16:55:10 +0000 (18:55 +0200)]
conf: port procs to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: port sysctls to new list type
Christian Brauner [Wed, 25 Aug 2021 16:47:51 +0000 (18:47 +0200)]
conf: port sysctls to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: port rlimits to new list type
Christian Brauner [Wed, 25 Aug 2021 16:38:06 +0000 (18:38 +0200)]
conf: port rlimits to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3950 from brauner/2021-08-25.list
Stéphane Graber [Wed, 25 Aug 2021 16:29:14 +0000 (12:29 -0400)]
Merge pull request #3950 from brauner/2021-08-25.list

tree-wide: introduce new list type and port network handling to it

3 years agoconf: port state_clients to new list type
Christian Brauner [Wed, 25 Aug 2021 12:38:00 +0000 (14:38 +0200)]
conf: port state_clients to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomainloop: port handlers to new list type
Christian Brauner [Wed, 25 Aug 2021 12:47:06 +0000 (14:47 +0200)]
mainloop: port handlers to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agocgroups: port bpf devices to new list type
Christian Brauner [Wed, 25 Aug 2021 12:27:09 +0000 (14:27 +0200)]
cgroups: port bpf devices to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotree-wide: port network handling to new list type
Christian Brauner [Wed, 25 Aug 2021 10:13:40 +0000 (12:13 +0200)]
tree-wide: port network handling to new list type

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agolist: add new kernel-based list implementation
Christian Brauner [Wed, 25 Aug 2021 09:11:07 +0000 (11:11 +0200)]
list: add new kernel-based list implementation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3949 from brauner/2021-08-24.attach
Stéphane Graber [Wed, 25 Aug 2021 03:56:17 +0000 (23:56 -0400)]
Merge pull request #3949 from brauner/2021-08-24.attach

tools: lxc-attach fixes

3 years agoMerge pull request #3948 from brauner/2021-08-24.fixes
Stéphane Graber [Tue, 24 Aug 2021 12:29:49 +0000 (08:29 -0400)]
Merge pull request #3948 from brauner/2021-08-24.fixes

confile: return negative errno everywhere

3 years agotools: fix elevated privilege handler in lxc-attach
Maximilian Blenk [Tue, 24 Aug 2021 07:55:14 +0000 (09:55 +0200)]
tools: fix elevated privilege handler in lxc-attach

Make sure to return an error when the user requests an LSM profile to be
set while also requesting that elevated LSM privileges are to be used.

Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconfile: rework lxc_fill_elevated_privileges()
Christian Brauner [Tue, 24 Aug 2021 07:54:27 +0000 (09:54 +0200)]
confile: rework lxc_fill_elevated_privileges()

Cc: Maximilian Blenk <Maximilian.Blenk@bmw.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoattach_options: add LXC_ATTACH_LSM_LABEL to LXC_ATTACH_LSM flags
Christian Brauner [Tue, 24 Aug 2021 07:44:54 +0000 (09:44 +0200)]
attach_options: add LXC_ATTACH_LSM_LABEL to LXC_ATTACH_LSM flags

Cc: Maximilian Blenk <Maximilian.Blenk@bmw.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotools: align struct initialization
Christian Brauner [Tue, 24 Aug 2021 07:37:14 +0000 (09:37 +0200)]
tools: align struct initialization

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotools: fix variable declarations in lxc-attach
Christian Brauner [Tue, 24 Aug 2021 07:36:34 +0000 (09:36 +0200)]
tools: fix variable declarations in lxc-attach

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoattach: allow LSM attach without new mnt namespace
Maximilian Blenk [Mon, 23 Aug 2021 13:39:28 +0000 (15:39 +0200)]
attach: allow LSM attach without new mnt namespace

Currently, the -c command (to set the selinux context) seems to be
broken because lxc-attach expects that also a new mount namespace
is specified via command line. This commit remove the check for the new
mount namespace to fix this issue. Please note that the
--elevated-privileges option is not affected by this issue.

Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconfile: return negative errno everywhere
Christian Brauner [Tue, 24 Aug 2021 07:13:36 +0000 (09:13 +0200)]
confile: return negative errno everywhere

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3947 from blenk92/fix-missing-seccomp
Christian Brauner [Tue, 24 Aug 2021 07:07:48 +0000 (09:07 +0200)]
Merge pull request #3947 from blenk92/fix-missing-seccomp

config: enable seccomp profile only when compiled with libseccomp

3 years agoconfig: enable seccomp profile only when compiled with libseccomp
Maximilian Blenk [Mon, 23 Aug 2021 20:04:40 +0000 (22:04 +0200)]
config: enable seccomp profile only when compiled with libseccomp

Make lxc fail if seccomp.profile is specified but lxc is compiled
without seccomp support. Currently, seccomp.profile is silently ignored
if is specified in such a scenario. This could lead to the false
impression that the seccomp filter is applied while it actually isn't.

Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
3 years agoMerge pull request #3943 from brauner/2021-08-19.fixes
Stéphane Graber [Thu, 19 Aug 2021 19:18:07 +0000 (15:18 -0400)]
Merge pull request #3943 from brauner/2021-08-19.fixes

seccomp: fix complication when !HAVE_DECL_SECCOMP_NOTIFY_FD

3 years agoseccomp: fix complication when !HAVE_DECL_SECCOMP_NOTIFY_FD
Christian Brauner [Thu, 19 Aug 2021 08:47:31 +0000 (10:47 +0200)]
seccomp: fix complication when !HAVE_DECL_SECCOMP_NOTIFY_FD

[2021-08-18 05:48:26] [build-stdout] mv -f $depbase.Tpo $depbase.Po
[2021-08-18 05:48:26] [build-stderr] seccomp.c: In function ‘seccomp_notify_cleanup_handler’:
[2021-08-18 05:48:26] [build-stderr] seccomp.c:1367:25: error: ‘struct lxc_seccomp’ has no member named ‘notifier’
[2021-08-18 05:48:26] [build-stderr]  1367 |  if (fd == conf->seccomp.notifier.notify_fd)
[2021-08-18 05:48:26] [build-stderr]       |                         ^
[2021-08-18 05:48:26] [build-stderr] In file included from af_unix.h:12,
[2021-08-18 05:48:26] [build-stderr]                  from seccomp.c:14:
[2021-08-18 05:48:26] [build-stderr] seccomp.c:1368:29: error: ‘struct lxc_seccomp’ has no member named ‘notifier’
[2021-08-18 05:48:26] [build-stderr]  1368 |   fd = move_fd(conf->seccomp.notifier.notify_fd);
[2021-08-18 05:48:26] [build-stderr]       |                             ^
[2021-08-18 05:48:26] [build-stderr] macro.h:655:26: note: in definition of macro ‘move_fd’
[2021-08-18 05:48:26] [build-stderr]   655 |   int __internal_fd__ = (fd); \
[2021-08-18 05:48:26] [build-stderr]       |                          ^~
[2021-08-18 05:48:26] [build-stderr] seccomp.c:1368:29: error: ‘struct lxc_seccomp’ has no member named ‘notifier’
[2021-08-18 05:48:26] [build-stderr]  1368 |   fd = move_fd(conf->seccomp.notifier.notify_fd);
[2021-08-18 05:48:26] [build-stderr]       |                             ^
[2021-08-18 05:48:26] [build-stderr] macro.h:656:4: note: in definition of macro ‘move_fd’
[2021-08-18 05:48:26] [build-stderr]   656 |   (fd) = -EBADF;              \
[2021-08-18 05:48:26] [build-stderr]       |    ^~
[2021-08-18 05:48:26] [build-stderr] make[3]: *** [Makefile:4496: seccomp.o] Error 1
[2021-08-18 05:48:26] [build-stdout] make[3]: Leaving directory '/opt/src/src/lxc'
[2021-08-18 05:48:26] [build-stdout] make[2]: Leaving directory '/opt/src/src'
[2021-08-18 05:48:26] [build-stdout] make[1]: Leaving directory '/opt/src/src'
[2021-08-18 05:48:26] [build-stderr] make[2]: *** [Makefile:440: all-recursive] Error 1
[2021-08-18 05:48:26] [build-stderr] make[1]: *** [Makefile:379: all] Error 2
[2021-08-18 05:48:26] [build-stderr] make: *** [Makefile:537: all-recursive] Error 1
[2021-08-18 05:48:26] [build-stderr] + '[' -f build.ninja ']'
[2021-08-18 05:48:26] [build-stdout] Semmle autobuild: no supported build system detected.
[2021-08-18 05:48:26] [build-stderr] + '[' -d ../_lgtm_build_dir ']'
[2021-08-18 05:48:26] [build-stderr] + for f in build build.sh
[2021-08-18 05:48:26] [build-stderr] + '[' -x build ']'
[2021-08-18 05:48:26] [build-stderr] + for f in build build.sh
[2021-08-18 05:48:26] [build-stderr] + '[' -x build.sh ']'
[2021-08-18 05:48:26] [build-stderr] + '[' -f setup.py ']'
[2021-08-18 05:48:26] [build-stderr] + echo 'Semmle autobuild: no supported build system detected.'
[2021-08-18 05:48:26] [build-stderr] + exit 1
[2021-08-18 05:48:26] [ERROR] Spawned process exited abnormally (code 1; tried to run: [/opt/dist/tools/linux64/preload_tracer, /opt/dist/cpp/tools/do-build])
[2021-08-18 05:48:26] [build-stderr] A fatal error occurred: Exit status 1 from command: [/opt/dist/cpp/tools/do-build]
[2021-08-18 05:48:26] [build-stderr] deptrace-server: received exit command
[2021-08-18 05:48:27] [ERROR] Spawned process exited abnormally (code 2; tried to run: [/opt/work/lgtm-workspace/lgtm/extract.sh])
A fatal error occurred: Exit status 2 from command: [/opt/work/lgtm-workspace/lgtm/extract.sh]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3940 from brauner/2021-08-16.fixes.2
Stéphane Graber [Tue, 17 Aug 2021 16:45:57 +0000 (12:45 -0400)]
Merge pull request #3940 from brauner/2021-08-16.fixes.2

tests: only rely on busybox template getting rid of all network dependencies; terminal: allow for tty allocation even when container did not request separate devpts instance

3 years agotests: use busybox in lxc-test-usernic.in
Christian Brauner [Mon, 16 Aug 2021 15:46:39 +0000 (17:46 +0200)]
tests: use busybox in lxc-test-usernic.in

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotests: use busybox in lxc-test-unpriv
Christian Brauner [Mon, 16 Aug 2021 15:44:54 +0000 (17:44 +0200)]
tests: use busybox in lxc-test-unpriv

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotests: use busybox in lxc-test-no-new-privs
Christian Brauner [Mon, 16 Aug 2021 15:40:45 +0000 (17:40 +0200)]
tests: use busybox in lxc-test-no-new-privs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotest: use busybox in lxc-test-autostart
Christian Brauner [Mon, 16 Aug 2021 15:40:04 +0000 (17:40 +0200)]
test: use busybox in lxc-test-autostart

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotest: use busybox in lxc-test-apparmor-mount
Christian Brauner [Mon, 16 Aug 2021 15:38:49 +0000 (17:38 +0200)]
test: use busybox in lxc-test-apparmor-mount

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotest: use busybox in lxc-test-apparmor-generated
Christian Brauner [Mon, 16 Aug 2021 15:33:59 +0000 (17:33 +0200)]
test: use busybox in lxc-test-apparmor-generated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agotests: fix order in sys_mixed
Christian Brauner [Tue, 17 Aug 2021 10:14:53 +0000 (12:14 +0200)]
tests: fix order in sys_mixed

We need to set the config item after we loaded the config obviously.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: allow for tty allocation even when container did not request separate devpts...
Christian Brauner [Tue, 17 Aug 2021 09:38:11 +0000 (11:38 +0200)]
conf: allow for tty allocation even when container did not request separate devpts instance

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agobusybox: simplify
Christian Brauner [Tue, 17 Aug 2021 09:03:17 +0000 (11:03 +0200)]
busybox: simplify

Start relying on autodev for busybox template and wipe all the device
creation.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agobusybox: mount sys:ro
Christian Brauner [Tue, 17 Aug 2021 09:07:38 +0000 (11:07 +0200)]
busybox: mount sys:ro

There's no udev so sys doesn't need to be read-write.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoterminal: use /dev/ptmx when allocating pty devices from devpts instances we didn...
Christian Brauner [Tue, 17 Aug 2021 08:43:34 +0000 (10:43 +0200)]
terminal: use /dev/ptmx when allocating pty devices from devpts instances we didn't mount ourselves

When we aren't told what devpts instance to allocate from we assume it
is the one in the caller's mount namespace.
This poses a slight complication, a lot of distros will change
permissions on /dev/ptmx so it can be opened by unprivileged users but
will not change permissions on /dev/pts/ptmx itself. In addition,
/dev/ptmx can either be a symlink, a bind-mount, or a separate device
node. So we need to allow for fairly lax lookup.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agofile_utils: add same_device() helper
Christian Brauner [Tue, 17 Aug 2021 08:38:44 +0000 (10:38 +0200)]
file_utils: add same_device() helper

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3938 from brauner/2021-08-16.fixes
Stéphane Graber [Mon, 16 Aug 2021 16:35:46 +0000 (12:35 -0400)]
Merge pull request #3938 from brauner/2021-08-16.fixes

cgroups: simplify offline and isolated cpumask handling

3 years agoMerge pull request #3939 from Cypresslin/fix-test-exec-bit
Christian Brauner [Mon, 16 Aug 2021 10:06:16 +0000 (12:06 +0200)]
Merge pull request #3939 from Cypresslin/fix-test-exec-bit

tests: set lxc-test-automount/createconfig/snapdeps as executable

3 years agotests: set lxc-test-automount/createconfig/snapdeps as executable
Po-Hsu Lin [Mon, 16 Aug 2021 09:32:24 +0000 (17:32 +0800)]
tests: set lxc-test-automount/createconfig/snapdeps as executable

The debian/tests/exercise script will skip those non-executable tests
in src/test, thus these three tests were never get tested.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
3 years agocgroups: simplify offline and isolated cpu handling
Christian Brauner [Mon, 16 Aug 2021 09:11:43 +0000 (11:11 +0200)]
cgroups: simplify offline and isolated cpu handling

Don't create separate cpumask arrays for them. Just clear the ones that
are set in the original cpumask array.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agocgroups: use semantically clean check in cpuset1_cpus_initialize()
Christian Brauner [Mon, 16 Aug 2021 08:56:51 +0000 (10:56 +0200)]
cgroups: use semantically clean check in cpuset1_cpus_initialize()

The variable is a pointer not a integer.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3937 from brauner/2021-08-13.fixes
Stéphane Graber [Sat, 14 Aug 2021 15:12:27 +0000 (11:12 -0400)]
Merge pull request #3937 from brauner/2021-08-13.fixes

cgroups: cpumask fixes

3 years agocgroups: fix cpumask handling
Christian Brauner [Fri, 13 Aug 2021 22:36:21 +0000 (00:36 +0200)]
cgroups: fix cpumask handling

Link: https://discuss.linuxcontainers.org/t/lxc-4-0-9-lxc-start-sigabrt-on-systems-with-defined-offline-cpus-and-a-total-number-of-cpus-divisible-by-32
Signed-off-by: Jim Ferrigno <jim.ferrigno@oracle.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agocgroups: fix comments in cpuset1_initialize()
Christian Brauner [Fri, 13 Aug 2021 19:37:02 +0000 (21:37 +0200)]
cgroups: fix comments in cpuset1_initialize()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoRevert "cgroups: fix cpu bitmasks"
Christian Brauner [Fri, 13 Aug 2021 19:35:30 +0000 (21:35 +0200)]
Revert "cgroups: fix cpu bitmasks"

This reverts commit e0f7296a6d537f0d2eb5fbc6d7f9e007d11d516a.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3934 from brauner/2021-08-12.fixes
Christian Brauner [Thu, 12 Aug 2021 08:12:45 +0000 (10:12 +0200)]
Merge pull request #3934 from brauner/2021-08-12.fixes

cgroups: cpumask fixes

3 years agocgroups: s/calloc/zalloc/g
Christian Brauner [Thu, 12 Aug 2021 07:00:00 +0000 (09:00 +0200)]
cgroups: s/calloc/zalloc/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agocgroups: fix cpu bitmasks
Jim Ferrigno [Wed, 11 Aug 2021 18:44:32 +0000 (14:44 -0400)]
cgroups: fix cpu bitmasks

Link: https://discuss.linuxcontainers.org/t/lxc-4-0-9-lxc-start-sigabrt-on-systems-with-defined-offline-cpus-and-a-total-number-of-cpus-divisible-by-32
Signed-off-by: Jim Ferrigno <jim.ferrigno@oracle.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3899 from denisfa/master
Stéphane Graber [Wed, 11 Aug 2021 17:42:18 +0000 (13:42 -0400)]
Merge pull request #3899 from denisfa/master

Improve bash completion experience.

3 years agoMerge pull request #3932 from brauner/2021-08-11.fixes
Stéphane Graber [Wed, 11 Aug 2021 17:22:48 +0000 (13:22 -0400)]
Merge pull request #3932 from brauner/2021-08-11.fixes

mainloop: further io_uring fixes

3 years agomainloop: disable IORING_SETUP_SQPOLL for now
Christian Brauner [Wed, 11 Aug 2021 15:46:54 +0000 (17:46 +0200)]
mainloop: disable IORING_SETUP_SQPOLL for now

It's a bit more complicated to use then I envisioned here.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomainloop: add comments about multishot and oneshot cleanup
Christian Brauner [Wed, 11 Aug 2021 14:54:34 +0000 (16:54 +0200)]
mainloop: add comments about multishot and oneshot cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomainloop: s/handler_name/name/g
Christian Brauner [Wed, 11 Aug 2021 13:58:58 +0000 (15:58 +0200)]
mainloop: s/handler_name/name/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3931 from brauner/2021-08-11.fixes
Stéphane Graber [Wed, 11 Aug 2021 14:58:21 +0000 (10:58 -0400)]
Merge pull request #3931 from brauner/2021-08-11.fixes

memory_utils: make cleanup handler as unused

3 years agomainloop: move variables into tighter scope
Christian Brauner [Wed, 11 Aug 2021 13:52:12 +0000 (15:52 +0200)]
mainloop: move variables into tighter scope

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomemory_utils: make cleanup handler as unused
Christian Brauner [Wed, 11 Aug 2021 13:43:18 +0000 (15:43 +0200)]
memory_utils: make cleanup handler as unused

They are sometimes used to just clean something up automatically at end
of scope but the variables themselves might not be actually used.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3930 from brauner/2021-08-10.fixes
Stéphane Graber [Wed, 11 Aug 2021 13:08:09 +0000 (09:08 -0400)]
Merge pull request #3930 from brauner/2021-08-10.fixes

mainloop: io_uring cleanup handling fixes

3 years agomainloop: fix io_uring cleanup handling
Christian Brauner [Wed, 11 Aug 2021 09:03:13 +0000 (11:03 +0200)]
mainloop: fix io_uring cleanup handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomainloop: remove CANCEL_RAISE flag
Christian Brauner [Tue, 10 Aug 2021 15:57:26 +0000 (17:57 +0200)]
mainloop: remove CANCEL_RAISE flag

This is really not needed since we're not checking it anywhere anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomainloop: minor fixes
Christian Brauner [Tue, 10 Aug 2021 15:42:41 +0000 (17:42 +0200)]
mainloop: minor fixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3928 from simondeziel/download-user-agent
Christian Brauner [Tue, 10 Aug 2021 15:09:06 +0000 (17:09 +0200)]
Merge pull request #3928 from simondeziel/download-user-agent

lxc-download: customize the user-agent to include LXC package version and compat level

3 years agoMerge pull request #3929 from tych0/fix-sys-poll-warning
Christian Brauner [Tue, 10 Aug 2021 15:07:19 +0000 (17:07 +0200)]
Merge pull request #3929 from tych0/fix-sys-poll-warning

mainloop: s,sys/poll,poll

3 years agomainloop: s,sys/poll,poll
Tycho Andersen [Tue, 10 Aug 2021 14:45:21 +0000 (08:45 -0600)]
mainloop: s,sys/poll,poll

I get the following warning (which then fails the build because of
-Werror):

In file included from mainloop.c:11:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
3 years agolxc-download: add LXC version/compat level to user-agent
Simon Deziel [Tue, 10 Aug 2021 14:35:12 +0000 (10:35 -0400)]
lxc-download: add LXC version/compat level to user-agent

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
3 years agoMerge pull request #3924 from brauner/2021-06-04.io_uring
Stéphane Graber [Tue, 10 Aug 2021 14:01:55 +0000 (10:01 -0400)]
Merge pull request #3924 from brauner/2021-06-04.io_uring

mainloop: io_uring support

3 years agomainloop: add io_uring support
Christian Brauner [Fri, 4 Jun 2021 16:21:04 +0000 (18:21 +0200)]
mainloop: add io_uring support

Users can choose to compile liblxc with io_uring support. This will
cause LXC to use io_uring instead of epoll.
We're using both, io_uring's one-shot and multi-shot poll mode depending
on the type of handler.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3927 from tomponline/tp-nic-address-broadcast
Christian Brauner [Tue, 10 Aug 2021 11:03:10 +0000 (13:03 +0200)]
Merge pull request #3927 from tomponline/tp-nic-address-broadcast

doc: Adds mention of ability to specify manual IPv4 broadcast address

3 years agodoc: Adds mention of ability to specify manual IPv4 broadcast address
Thomas Parrott [Tue, 10 Aug 2021 10:32:30 +0000 (11:32 +0100)]
doc: Adds mention of ability to specify manual IPv4 broadcast address

See also https://github.com/lxc/lxd/pull/9103

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
3 years agotree-wide: s/lxc_epoll_descr/lxc_async_descr/g
Christian Brauner [Fri, 4 Jun 2021 13:13:14 +0000 (15:13 +0200)]
tree-wide: s/lxc_epoll_descr/lxc_async_descr/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: log session keyring failure on WARN level
Christian Brauner [Fri, 6 Aug 2021 07:45:33 +0000 (09:45 +0200)]
conf: log session keyring failure on WARN level

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agocgroups: log at warning instead of error level
Christian Brauner [Wed, 4 Aug 2021 10:31:07 +0000 (12:31 +0200)]
cgroups: log at warning instead of error level

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3926 from stgraber/master
Christian Brauner [Mon, 9 Aug 2021 17:41:40 +0000 (19:41 +0200)]
Merge pull request #3926 from stgraber/master

doc/api-extensions: Grammar fix

3 years agodoc/api-extensions: Grammar fix
Stéphane Graber [Mon, 9 Aug 2021 17:18:44 +0000 (13:18 -0400)]
doc/api-extensions: Grammar fix

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoMerge pull request #3925 from brauner/2021-08-09.fixes
Stéphane Graber [Mon, 9 Aug 2021 14:25:07 +0000 (10:25 -0400)]
Merge pull request #3925 from brauner/2021-08-09.fixes

lsm/apparmor: small fixes

3 years agolsm/apparmor: use cleanup macro
Christian Brauner [Mon, 9 Aug 2021 13:59:26 +0000 (15:59 +0200)]
lsm/apparmor: use cleanup macro

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agolsm/apparmor: log failure to write AppArmor profile
Christian Brauner [Mon, 9 Aug 2021 13:58:53 +0000 (15:58 +0200)]
lsm/apparmor: log failure to write AppArmor profile

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3923 from brauner/2021-08-05.fixes
Stéphane Graber [Thu, 5 Aug 2021 15:41:23 +0000 (11:41 -0400)]
Merge pull request #3923 from brauner/2021-08-05.fixes

network: fix container with empty network namespaces

3 years agonetwork: fix container with empty network namespaces
Christian Brauner [Thu, 5 Aug 2021 14:16:33 +0000 (16:16 +0200)]
network: fix container with empty network namespaces

Fixes: #3922
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3921 from brauner/2021-08-03.fixes
Stéphane Graber [Tue, 3 Aug 2021 14:02:27 +0000 (10:02 -0400)]
Merge pull request #3921 from brauner/2021-08-03.fixes

conf: rootfs mount option fixes

3 years agotests: add test for rootfs mount options
Christian Brauner [Tue, 3 Aug 2021 12:40:28 +0000 (14:40 +0200)]
tests: add test for rootfs mount options

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: allow mount options for rootfs when using new mount api
Christian Brauner [Tue, 3 Aug 2021 11:16:45 +0000 (13:16 +0200)]
conf: allow mount options for rootfs when using new mount api

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomount_utils: make some mount helpers static inline
Christian Brauner [Tue, 3 Aug 2021 10:51:24 +0000 (12:51 +0200)]
mount_utils: make some mount helpers static inline

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: let parse_vfs_attr() handle legacy mount flags as well
Christian Brauner [Tue, 3 Aug 2021 10:13:01 +0000 (12:13 +0200)]
conf: let parse_vfs_attr() handle legacy mount flags as well

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: log failure to create tty mountpoint
Christian Brauner [Tue, 3 Aug 2021 07:22:46 +0000 (09:22 +0200)]
conf: log failure to create tty mountpoint

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3920 from brauner/2021-08-02.fixes
Stéphane Graber [Mon, 2 Aug 2021 18:33:37 +0000 (14:33 -0400)]
Merge pull request #3920 from brauner/2021-08-02.fixes

mount_utils: introduce mount_at()

3 years agoconf: refactor lxc_recv_ttys_from_child()
Christian Brauner [Mon, 2 Aug 2021 17:16:54 +0000 (19:16 +0200)]
conf: refactor lxc_recv_ttys_from_child()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: fix logging in lxc_idmapped_mounts_child()
Christian Brauner [Mon, 2 Aug 2021 16:47:44 +0000 (18:47 +0200)]
conf: fix logging in lxc_idmapped_mounts_child()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agomount_utils: introduce mount_at()
Christian Brauner [Mon, 2 Aug 2021 13:30:03 +0000 (15:30 +0200)]
mount_utils: introduce mount_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3919 from brauner/2021-07-31.devpts
Stéphane Graber [Sat, 31 Jul 2021 14:54:25 +0000 (10:54 -0400)]
Merge pull request #3919 from brauner/2021-07-31.devpts

terminal: handle kernel without TIOCGPTPEER

3 years agoterminal: fail on unknown error during TIOCGPTPEER
Christian Brauner [Sat, 31 Jul 2021 08:19:57 +0000 (10:19 +0200)]
terminal: fail on unknown error during TIOCGPTPEER

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoterminal: move native terminal allocation from error logging to info
Christian Brauner [Sat, 31 Jul 2021 08:17:36 +0000 (10:17 +0200)]
terminal: move native terminal allocation from error logging to info

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoconf: handle kernels without TIOCGPTPEER
Christian Brauner [Sat, 31 Jul 2021 08:14:39 +0000 (10:14 +0200)]
conf: handle kernels without TIOCGPTPEER

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 years agoMerge pull request #3918 from brauner/2021-07-30.devpts
Stéphane Graber [Fri, 30 Jul 2021 14:42:39 +0000 (10:42 -0400)]
Merge pull request #3918 from brauner/2021-07-30.devpts

conf: rework console setup