]>
git.ipfire.org Git - thirdparty/lxc.git/log
Stéphane Graber [Thu, 29 Apr 2021 20:55:34 +0000 (16:55 -0400)]
Release LXC 4.0.7
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 13:38:48 +0000 (15:38 +0200)]
api-extensions: add entry for idmapped_mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:33:37 +0000 (11:33 +0200)]
storage/dir: cleanup mount code
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:27:58 +0000 (11:27 +0200)]
storage/dir: remove error handling down
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:26:59 +0000 (11:26 +0200)]
storage/dir: source can't be empty
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:26:11 +0000 (11:26 +0200)]
storage/dir: use "source" and "target" as terms
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:24:15 +0000 (11:24 +0200)]
storage/dir: retrieve proper source path later
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:23:03 +0000 (11:23 +0200)]
storage/dir: use clear error messages
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:21:03 +0000 (11:21 +0200)]
storage/dir: bdev->dest can't be empty
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 28 Apr 2021 09:19:47 +0000 (11:19 +0200)]
dir: use mnt_opts->data instead of mntdata
Fixes: https://launchpadlibrarian.net/535845165/buildlog_ubuntu-focal-s390x.lxc_1%3A4.0.6+master~20210427-2321-0ubuntu1~focal_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Tue, 27 Apr 2021 00:03:39 +0000 (00:03 +0000)]
build-system: turn off lto=thin when building the fuzzers
With lto=thin the fuzzers fail as soon as they start with
```
ERROR: The size of coverage PC tables does not match the
number of instrumented PCs. This might be a compiler bug,
please contact the libFuzzer developers.
Also check https://bugs.llvm.org/show_bug.cgi?id=34636
for possible workarounds (tl;dr: don't use the old GNU ld)
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 26 Apr 2021 21:41:54 +0000 (21:41 +0000)]
tests: run the fuzzers along with the other tests
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Wed, 14 Apr 2021 18:37:08 +0000 (18:37 +0000)]
log: create log files in "fuzzing" mode if it's called outside fuzz targets
to make it possible to run the fuzzers along with the other tests
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Wed, 14 Apr 2021 09:22:51 +0000 (09:22 +0000)]
ci: switch to --enable-fuzzers
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Wed, 14 Apr 2021 09:20:31 +0000 (09:20 +0000)]
build-system: add --enable-fuzzers
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Brauner [Sun, 25 Apr 2021 10:23:56 +0000 (12:23 +0200)]
conf: improve idmapped mounts support
Setting up a detached idmapped mount is a privileged operation, mounting
it doesn't have to be.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 25 Apr 2021 09:02:15 +0000 (11:02 +0200)]
conf: s/lxc_rootfs_prepare/lxc_rootfs_init/g
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 25 Apr 2021 08:24:17 +0000 (10:24 +0200)]
conf: move all mount options into struct lxc_mount_options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 25 Apr 2021 07:59:42 +0000 (09:59 +0200)]
conf: stash lxc_storage into lxc_rootfs and bind to its lifetime
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 24 Apr 2021 09:19:53 +0000 (11:19 +0200)]
configure: fix function detection
Fixes: #3809
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 23 Apr 2021 09:29:47 +0000 (11:29 +0200)]
dir: fix rootfs mounting
We need to be able to lookup symlinks and allow xdev.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 19:09:12 +0000 (21:09 +0200)]
conf: don't overrun dest buffer in parse_lxc_mntopts()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 18:55:46 +0000 (20:55 +0200)]
conf: better naming
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 11:43:27 +0000 (13:43 +0200)]
getsubopt: use correct include
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 09:00:09 +0000 (11:00 +0200)]
Makefile: fix strchrnul() inclusion
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 07:45:13 +0000 (09:45 +0200)]
conf: include strchrnul for platforms that don't support it
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 22 Apr 2021 07:44:07 +0000 (09:44 +0200)]
strchrnul: include header
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Mar 2021 10:40:19 +0000 (11:40 +0100)]
conf: don't allow idmapped lxc.mount.{entry,fstab} just yet
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 18 Mar 2021 11:15:01 +0000 (12:15 +0100)]
conf: tweak parse_lxc_mntopts()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 18 Mar 2021 10:24:18 +0000 (11:24 +0100)]
apparmor: handle on-exec
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 18 Mar 2021 09:40:43 +0000 (10:40 +0100)]
attach: use correct lxc_namespace_t type
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 18 Mar 2021 09:40:13 +0000 (10:40 +0100)]
attach: visually separate pids from fds during initalization
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 15:43:15 +0000 (16:43 +0100)]
conf: verify that the rootfs can support idmapped mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 15:22:46 +0000 (16:22 +0100)]
start: documented idmapped mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 15:16:48 +0000 (16:16 +0100)]
mount_utils: add two detached mount helpers
They'll come in handy in the future.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 10:39:13 +0000 (11:39 +0100)]
conf: support idmapping directories
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 10:07:47 +0000 (11:07 +0100)]
mount_utils: add helper to determine whether new mount api supports bind mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 10:03:04 +0000 (11:03 +0100)]
storage: keep a reference to lxc_rootfs in lxc_storage
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 09:54:19 +0000 (10:54 +0100)]
mount_utils: add support for mount_setattr() syscall
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 09:45:29 +0000 (10:45 +0100)]
confile: parse idmap=<path> mount option for rootfs
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 09:35:33 +0000 (10:35 +0100)]
conf: add first, trivial support for idmapped mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 17 Mar 2021 09:01:19 +0000 (10:01 +0100)]
conf: rework lxc specific mount option parsing
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Thu, 15 Apr 2021 07:09:10 +0000 (07:09 +0000)]
seccomp: init and destroy notifier.cookie
It's a follow-up to
84cf6d259b24e4ad48e
Closes https://github.com/lxc/lxc/issues/3806
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 23:55:23 +0000 (23:55 +0000)]
autoconf: stop passing -fsanitize=address via AM_LDFLAGS
The snippet is redundant because the build system automatically
passes the sanitizers flags set in AM_CFLAGS to the linker
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 23:33:44 +0000 (23:33 +0000)]
ci: get rid of the -static-libasan stopgap
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 22:55:53 +0000 (22:55 +0000)]
build-system: stop building init.lxc.static with sanitizers
`-static` isn't compatible with `-fsanitize=`:
```
gcc: error: cannot specify -static with -fsanitize=address
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 21:54:15 +0000 (21:54 +0000)]
autoconf: add AC_LANG_SOURCE to CC_CHECK_LDFLAGS
Inspired by https://lore.kernel.org/alsa-devel/
18135209 -abc9-ca1c-84e0-
8ac3e75caaf1 @perex.cz/t/
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 14:45:29 +0000 (14:45 +0000)]
ci: make use of --enable-sanitizers instead of CFLAGS
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 06:23:03 +0000 (06:23 +0000)]
tests: free the buffer filled by lxc_cmd_rsp_recv
Fixes https://github.com/lxc/lxc/issues/3796
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Tue, 13 Apr 2021 06:03:20 +0000 (06:03 +0000)]
Revert "ci: get around https://github.com/lxc/lxc/issues/3796"
This reverts commit
44818e893e68e6e76652323ff4f12c9214d2ffa7 .
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 22:40:35 +0000 (22:40 +0000)]
ci: build with -Wall -Werror
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 19:30:50 +0000 (19:30 +0000)]
ci: turn on strict_string_checks
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 18:03:50 +0000 (18:03 +0000)]
ci: get around https://github.com/lxc/lxc/issues/3796
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 17:38:11 +0000 (17:38 +0000)]
ci: prevent lxc-exercise from running indefinitely
and show all the commands it runs to make it easier to
debug potential issues.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 17:36:50 +0000 (17:36 +0000)]
ci: get around https://github.com/lxc/lxc/issues/3788
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 16:29:44 +0000 (16:29 +0000)]
ci: get around https://github.com/lxc/lxc/issues/3798
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 16:25:31 +0000 (16:25 +0000)]
ci: switch to lxc-exercise from the lxc-ci repository
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 04:19:11 +0000 (04:19 +0000)]
ci: link lib[au]san with init.lxc.static statically
init.lxc.static is run in arbitrary containers where the libasan library lxc has been built with
isn't always installed. To make it work let's override GCC's default and link both libasan
and libubsan statically. It should help to fix issues like
```
++ lxc-execute -n c1 -- sudo -u ubuntu /nnptest
lxc-init: error while loading shared libraries: libasan.so.5: cannot open shared object file: No such file or directory
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Sun, 11 Apr 2021 00:38:56 +0000 (00:38 +0000)]
ci: an attempt to run the tests under ASan/UBsan
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Mon, 12 Apr 2021 20:39:48 +0000 (20:39 +0000)]
apparmor: turn bytes into null-terminated strings before calling strcspn
```
==70349==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000009fb at pc 0x000000433b70 bp 0x7ffcde087810 sp 0x7ffcde086fd0
READ of size 12 at 0x6020000009fb thread T0
#0 0x433b6f in strcspn (/usr/bin/lxc-execute+0x433b6f)
#1 0x7f720413a5cb in apparmor_process_label_get /home/runner/work/lxc/lxc/src/lxc/lsm/apparmor.c:449:8
#2 0x7f720413bc2a in apparmor_prepare /home/runner/work/lxc/lxc/src/lxc/lsm/apparmor.c:1104:13
#3 0x7f720409b6e9 in lxc_init /home/runner/work/lxc/lxc/src/lxc/start.c:848:8
#4 0x7f72040a395a in __lxc_start /home/runner/work/lxc/lxc/src/lxc/start.c:2009:8
#5 0x7f7203fc7186 in lxc_execute /home/runner/work/lxc/lxc/src/lxc/execute.c:99:9
#6 0x7f7204000e44 in do_lxcapi_start /home/runner/work/lxc/lxc/src/lxc/lxccontainer.c:1112:9
#7 0x7f7203ff0c07 in lxcapi_start /home/runner/work/lxc/lxc/src/lxc/lxccontainer.c:1149:8
#8 0x4c6912 in main /home/runner/work/lxc/lxc/src/lxc/tools/lxc_execute.c:224:9
#9 0x7f72034ac0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#10 0x41d93d in _start (/usr/bin/lxc-execute+0x41d93d)
+ echo ---
0x6020000009fb is located 0 bytes to the right of 11-byte region [0x6020000009f0,0x6020000009fb)
allocated by thread T0 here:
#0 0x496399 in realloc (/usr/bin/lxc-execute+0x496399)
#1 0x7f7203fcf85c in fd_to_buf /home/runner/work/lxc/lxc/src/lxc/file_utils.c:463:10
#2 0x7f720413a52b in apparmor_process_label_get /home/runner/work/lxc/lxc/src/lxc/lsm/apparmor.c:442:8
#3 0x7f720413bc2a in apparmor_prepare /home/runner/work/lxc/lxc/src/lxc/lsm/apparmor.c:1104:13
#4 0x7f720409b6e9 in lxc_init /home/runner/work/lxc/lxc/src/lxc/start.c:848:8
#5 0x7f72040a395a in __lxc_start /home/runner/work/lxc/lxc/src/lxc/start.c:2009:8
#6 0x7f7203fc7186 in lxc_execute /home/runner/work/lxc/lxc/src/lxc/execute.c:99:9
#7 0x7f7204000e44 in do_lxcapi_start /home/runner/work/lxc/lxc/src/lxc/lxccontainer.c:1112:9
#8 0x7f7203ff0c07 in lxcapi_start /home/runner/work/lxc/lxc/src/lxc/lxccontainer.c:1149:8
#9 0x4c6912 in main /home/runner/work/lxc/lxc/src/lxc/tools/lxc_execute.c:224:9
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Brauner [Sat, 17 Apr 2021 15:46:37 +0000 (17:46 +0200)]
commands: don't needlessly allocate
Fixes: #3796
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 15 Apr 2021 12:11:56 +0000 (14:11 +0200)]
process_utils: free stack after return
Fixes: #3789
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 15 Apr 2021 12:11:26 +0000 (14:11 +0200)]
configure: fix sanitizer compilation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 17 Apr 2021 15:25:46 +0000 (17:25 +0200)]
error_utils: add missing macro.h include
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Mon, 12 Apr 2021 01:41:27 +0000 (01:41 +0000)]
tests: pass on ASAN/UBSAN options to several tests
to make it easier to run them under ASan/UBSan.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Sun, 11 Apr 2021 15:02:20 +0000 (15:02 +0000)]
tests: stop cutting off right square brackets in share_ns
Closes https://github.com/lxc/lxc/issues/3791
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Sun, 11 Apr 2021 09:49:28 +0000 (09:49 +0000)]
tests: switch to the "busybox" template in lxc-test-checkpoint-restore
criu can't seem to dump systemd-logind used in Ubuntu due to what appears to be
https://github.com/checkpoint-restore/criu/issues/1430.
Let's switch to busybox where all the processes hopefully can be dumped.
Closes https://github.com/lxc/lxc/issues/3792
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Brauner [Wed, 14 Apr 2021 14:12:45 +0000 (16:12 +0200)]
lxccontainer: fix container creation error paths
Fixes: #3782
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Sat, 10 Apr 2021 12:31:02 +0000 (12:31 +0000)]
tests: fix a memory leak in attach
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Sat, 10 Apr 2021 07:36:21 +0000 (07:36 +0000)]
tests: fix a memory leak in cgpath
```
==131188==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 568 byte(s) in 1 object(s) allocated from:
#0 0x7f8918943bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
#1 0x7f89181ee5a3 in lxc_container_new /home/vagrant/lxc/src/lxc/lxccontainer.c:5264
#2 0x55ffc5022869 in test_container /home/vagrant/lxc/src/tests/cgpath.c:176
#3 0x55ffc5023023 in main /home/vagrant/lxc/src/tests/cgpath.c:233
#4 0x7f891709e0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Brauner [Tue, 13 Apr 2021 12:42:15 +0000 (14:42 +0200)]
Revert "confile: make lxc_get_config() and lxc_get_config_net() always return non-NULL"
This reverts commit
674791ed75c53fb18c5823c5807876bde4865616 .
Our stable queue tool somehow still listed this patch as pending when it
had already been applied earlier.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Sat, 10 Apr 2021 04:45:46 +0000 (04:45 +0000)]
tests: fix a memory leak in lxcpath
```
$ sudo ./src/tests/lxc-test-lxcpath
=================================================================
==95911==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 39 byte(s) in 1 object(s) allocated from:
#0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
#1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
#2 0x562961680c30 in main /home/vagrant/lxc/src/tests/lxcpath.c:49
#3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
Direct leak of 21 byte(s) in 1 object(s) allocated from:
#0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
#1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
#2 0x56296168115e in main /home/vagrant/lxc/src/tests/lxcpath.c:77
#3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
Direct leak of 21 byte(s) in 1 object(s) allocated from:
#0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
#1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
#2 0x562961680f0a in main /home/vagrant/lxc/src/tests/lxcpath.c:63
#3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
SUMMARY: AddressSanitizer: 81 byte(s) leaked in 3 allocation(s).
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Sat, 10 Apr 2021 02:09:09 +0000 (02:09 +0000)]
tests: fix a memory leak in cgpath
```
$ sudo ./src/tests/lxc-test-cgpath
Container creation tests...Passed
Container creation with LXCPATH tests...Passed
=================================================================
==57206==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 296 byte(s) in 1 object(s) allocated from:
#0 0x7fef22c27dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6)
#1 0x557c6e3ce3d9 in cgroup_ops_init cgroups/cgfsng.c:3347
#2 0x557c6e3d6516 in cgroup_init cgroups/cgroup.c:33
#3 0x557c6e3788e2 in test_running_container /home/vagrant/lxc/src/tests/cgpath.c:102
#4 0x557c6e379c69 in test_container /home/vagrant/lxc/src/tests/cgpath.c:197
#5 0x557c6e379e37 in main /home/vagrant/lxc/src/tests/cgpath.c:233
#6 0x7fef2136c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
Direct leak of 296 byte(s) in 1 object(s) allocated from:
#0 0x7fef22c27dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6)
#1 0x557c6e3ce3d9 in cgroup_ops_init cgroups/cgfsng.c:3347
#2 0x557c6e3d6516 in cgroup_init cgroups/cgroup.c:33
#3 0x557c6e3788e2 in test_running_container /home/vagrant/lxc/src/tests/cgpath.c:102
#4 0x557c6e379c69 in test_container /home/vagrant/lxc/src/tests/cgpath.c:197
#5 0x557c6e379e61 in main /home/vagrant/lxc/src/tests/cgpath.c:237
#6 0x7fef2136c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Brauner [Wed, 7 Apr 2021 14:51:31 +0000 (16:51 +0200)]
confile: make lxc_get_config() and lxc_get_config_net() always return non-NULL
Introduce the concept of an unsupported config item.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 12 Apr 2021 15:50:39 +0000 (17:50 +0200)]
Revert "rexec: mark all fds as close-on-exec if possible"
This reverts commit
531d36ad009325b74a105d9d6956e320f37b2937 .
Callers might want to explicilty inhert file descriptors so we can't
close them behind their back when we exec.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 12 Apr 2021 15:23:24 +0000 (17:23 +0200)]
attach: don't return early when calculating namespaces via pidfd
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 12 Apr 2021 07:47:59 +0000 (09:47 +0200)]
conf: don't report success when idmaptools lack all privilege
Fixes: #3777
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 12 Apr 2021 07:44:40 +0000 (09:44 +0200)]
conf: simplify idmaptool_on_path_and_privileged()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 7 Apr 2021 14:51:31 +0000 (16:51 +0200)]
confile: make lxc_get_config() and lxc_get_config_net() always return non-NULL
Introduce the concept of an unsupported config item.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Wed, 7 Apr 2021 14:34:02 +0000 (10:34 -0400)]
github: Try to fix action naming
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Christian Brauner [Tue, 6 Apr 2021 15:23:50 +0000 (17:23 +0200)]
confile: enforce maximum subkey length
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 6 Apr 2021 15:22:52 +0000 (17:22 +0200)]
log: add error_ret()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 6 Apr 2021 15:10:49 +0000 (17:10 +0200)]
macro: ensure ret_errno() always returns negative
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Evgeny Vereshchagin [Wed, 31 Mar 2021 09:48:19 +0000 (09:48 +0000)]
cifuzz: fuzz longer
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Wed, 31 Mar 2021 09:35:57 +0000 (09:35 +0000)]
confile: fix a memory leak lxc_config_define_add
```
2021-04-02T05:45:54.9410345Z ==13==ERROR: LeakSanitizer: detected memory leaks
2021-04-02T05:45:54.9410737Z
2021-04-02T05:45:54.9411488Z Direct leak of 16 byte(s) in 1 object(s) allocated from:
2021-04-02T05:45:54.9412556Z #0 0x54d752 in calloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3
2021-04-02T05:45:54.9413360Z #1 0x583795 in parse_new_conf_line /src/lxc/src/lxc/confile.c:3048:8
2021-04-02T05:45:54.9414057Z #2 0x582f1a in lxc_config_define_add /src/lxc/src/lxc/confile.c:3090:15
2021-04-02T05:45:54.9415352Z #3 0x5810fa in LLVMFuzzerTestOneInput /src/lxc/src/tests/fuzz-lxc-define-load.c:30:6
2021-04-02T05:45:54.9419212Z #4 0x483b93 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
2021-04-02T05:45:54.9421819Z #5 0x48309a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
2021-04-02T05:45:54.9424205Z #6 0x485474 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:814:7
2021-04-02T05:45:54.9426658Z #7 0x485689 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3
2021-04-02T05:45:54.9428616Z #8 0x473717 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
2021-04-02T05:45:54.9429989Z #9 0x49f572 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
2021-04-02T05:45:54.9433312Z #10 0x7fa96041b83f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
2021-04-02T05:45:54.9433795Z
2021-04-02T05:45:54.9434661Z DEDUP_TOKEN: calloc--parse_new_conf_line--lxc_config_define_add
2021-04-02T05:45:54.9435483Z SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
2021-04-02T05:45:54.9435958Z
2021-04-02T05:45:54.9436404Z INFO: a leak has been found in the initial corpus.
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Evgeny Vereshchagin [Wed, 31 Mar 2021 07:12:51 +0000 (07:12 +0000)]
oss-fuzz: fuzz lxc_config_define_add and lxc_config_define_load
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
Christian Ratzenhofer [Tue, 6 Apr 2021 12:39:11 +0000 (14:39 +0200)]
templates/*.in: fixed PATH handling with spaces
if $PATH already contains a path with a space the append of the
default directories in all template scripts fails with an error
like the following:
/usr/share/lxc/templates/lxc-download: 69: export: (x86)/NVIDIA: bad
variable name
Signed-off-by: Christian Ratzenhofer <christian.ratzenhofer@cdnm.at>
Christian Brauner [Tue, 6 Apr 2021 08:34:31 +0000 (10:34 +0200)]
log: ensure we always return negative errno
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 6 Apr 2021 08:30:38 +0000 (10:30 +0200)]
conf: fix setups where /dev is outside of LXC's control
Fixes: #3770
Suggested-by: Ruben Jenster <r.jenster@drachenfels.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 2 Apr 2021 14:17:25 +0000 (16:17 +0200)]
confile: complain when LXC is built without AppArmor support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 2 Apr 2021 14:15:22 +0000 (16:15 +0200)]
confile: complain when LXC is built without selinux support
Link: https://github.com/lxc/lxc/issues/3765
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 2 Apr 2021 10:04:22 +0000 (12:04 +0200)]
confile: fix lxc.namespace.share.[identifier]
Link: https://github.com/lxc/lxc/pull/3763/files#r606089660
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 1 Apr 2021 08:07:59 +0000 (10:07 +0200)]
confile: simplify get_network_config_ops()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 1 Apr 2021 07:30:08 +0000 (09:30 +0200)]
string_utils: use restrict for lxc_safe_int64_residual()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 1 Apr 2021 08:56:52 +0000 (10:56 +0200)]
string_utils: ensure that errno is set on return
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 1 Apr 2021 07:16:14 +0000 (09:16 +0200)]
string_utils: move to lxc-copy() sources
It's the only place where it is still used.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 31 Mar 2021 13:59:54 +0000 (15:59 +0200)]
lxc_user_nic: cleanup get_alloted()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 31 Mar 2021 13:59:34 +0000 (15:59 +0200)]
lxc_user_nic: cleanup append_alloted()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 31 Mar 2021 08:54:28 +0000 (10:54 +0200)]
confile: cap to last bit in set_config_net_ipv4_address()
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32708
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 30 Mar 2021 15:20:51 +0000 (17:20 +0200)]
string_utils: switch to path_simplify()
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32689
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>