Stéphane Graber
fbc31691ee
github: Update for main branch
...
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-07-24 11:38:07 -04:00
Christian Brauner
5a82a3f90e
Merge pull request #4327 from hallyn/2023-07-17/ai
...
CONTRIBUTING: add a note on AI generated code
2023-07-17 19:04:37 +02:00
Serge Hallyn
69e51b919e
CONTRIBUTING: add a note on AI generated code
...
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2023-07-17 07:57:17 -05:00
Christian Brauner
43a0751ecd
Merge pull request #4324 from hallyn/2023-07-06/bequiet
...
get_hierarchy: dont WARN about no usable controller
2023-07-07 12:48:59 +02:00
Serge Hallyn
84cfe97724
get_hierarchy: dont WARN about no usable controller
...
If I start a container with loglevel WARN, and (on a pretty
stock ubuntu) do lxc-info -n $c, I get
lxc-start media 20230706233337.765 WARN cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable cpuacct controller
lxc-start media 20230706233337.765 WARN cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable blkio controller
I don't think that's worth WARNing about, so change it to
INFO.
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2023-07-06 18:34:59 -05:00
Stéphane Graber
213e2f68d9
github: Add DCO/target tests
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-06-21 21:45:27 -04:00
Christian Brauner
8aab05bd9d
Merge pull request #4313 from mosbrew-ag/master
...
explicitly convert *mainloop_handler to __u64
2023-05-26 08:34:49 +02:00
Anatolii Gryzlov
cf2b202093
explicitly convert *mainloop_handler to __u64
...
GCC treats such conversion as warning, while Clang-15 aborts compilation
Signed-off-by: Anatolii Gryzlov <agryzlov.mosbrew@gmail.com>
2023-05-25 02:39:49 +03:00
Stéphane Graber
883311259d
Merge pull request #4310 from magalilemes/parse-config-file
...
tests: fix parse_config_file seccomp test
2023-05-16 13:37:40 -04:00
Magali Lemes
8575ffeb7f
tests: fix parse_config_file seccomp test
...
Link: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1980218
Check if seccomp is enabled before throwing error.
Signed-off-by: Magali Lemes <magali.lemes@canonical.com>
2023-05-15 20:31:37 -03:00
Christian Brauner
70e42b0f93
Merge pull request #4309 from stgraber/master
...
src/tests: Fix container creation errors
2023-05-05 09:33:22 +02:00
Stéphane Graber
ca25f3bf64
src/tests: Fix container creation errors
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-05-04 16:58:56 +02:00
Christian Brauner
0e69800b70
Merge pull request #4305 from hallyn/2023-04-21/private_symbols
...
rename functions which clash with libsystemd's
2023-04-22 08:34:03 +02:00
Serge Hallyn
539c397725
rename functions which clash with libsystemd's
...
If statically linking against both liblxc and libsystemd, some
function names conflict:
mkdir_p fd_cloexec path_simplify is_dir is_fs_type
Rename those to lxc_\0, as:
for sym in mkdir_p fd_cloexec path_simplify is_dir is_fs_type; do
git grep "$sym" | awk -F: '{ print $1 }' | sort | uniq | xargs sed -i "s/$sym/lxc_$sym/g"
done
(the above loop wrongly replaces is_dir in meson.build, but
c'est la vie)
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2023-04-21 19:12:21 -05:00
Stéphane Graber
a7dcde0386
Merge pull request #4304 from mihalicyn/io_uring_stuck_fix
...
mainloop: fix stuck when io_uring is enabled
2023-04-21 14:12:44 -04:00
Alexander Mikhalitsyn
7fd671dbce
mainloop: io_uring: disable IORING_POLL_ADD_MULTI
...
Let's disable IORING_POLL_ADD_MULTI to workaround an issue
with false-positive POLLIN events in CQ.
In my local setup I managed to fix an issue without this
by making terminal FDs non-blocking, but during full
testsuite execution in Jenkins it was found that issue
still persists. So, let's add this ugly workaround too.
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-04-21 19:23:06 +02:00
Alexander Mikhalitsyn
715fb4effa
terminal: make a terminal FDs non-blocking
...
Let's prevent freezes on read(2) by making a terminal FDs non-blocking.
It was discovered that there is an issue with io_uring mainloop when
multishot poll (IORING_POLL_ADD_MULTI) mode is enabled. Sometimes
false-positive poll events are put into a CQ. It makes further read(2)
stuck forever and blocks all mainloop processing for an infinite time.
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-04-21 18:53:49 +02:00
Alexander Mikhalitsyn
7eff16cc4c
file_utils: add fd_make_nonblocking helper
...
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-04-21 18:53:33 +02:00
Alexander Mikhalitsyn
747c4df31a
file_utils: rename fd_make_nonblocking to fd_make_blocking
...
Currently, fd_make_nonblocking does exactly the opposite thing,
it clears O_NONBLOCK flag and makes fd blocking.
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-04-21 18:52:58 +02:00
Christian Brauner
0d1ffe0769
Merge pull request #4300 from solardiz/setproctitle
...
setproctitle(): Handle potential NULL return from strrchr()
2023-04-11 17:25:35 +02:00
Solar Designer
ebea2b5a99
setproctitle(): Handle potential NULL return from strrchr()
...
Signed-off-by: Solar Designer <solar@openwall.com>
2023-04-11 16:14:37 +02:00
Christian Brauner
e2d10d666c
Merge pull request #4299 from tych0/make-setproctitle-safe
...
make setproctitle()'s /proc/pid/stat parsing safe
2023-04-11 07:47:32 +02:00
Tycho Andersen
f7f15b20a3
make setproctitle()'s /proc/pid/stat parsing safe
...
it turns out that our parsing of /proc/pid/stat was not safe in general
(though probably safe for lxc, since our executable names do not contain
spaces).
Let's fix this by looking backwards through the file for ), and then
continuing on from there.
This was reported to me by Solar Designer, who pointed me to this thread:
https://twitter.com/solardiz/status/1634204168545001473
Indeed, this is a lot of tap dancing to work around the kernel's 16
character executable limit. Perhaps I'll send a kernel patch to raise that
limit next.
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2023-04-10 17:20:47 -06:00
Serge Hallyn
52326514c6
Merge pull request #4287 from hallyn/2023-03-10/dbus
...
switch from libsystemd's dbus to dbus-1
2023-03-19 17:05:06 -05:00
Serge Hallyn
5894cf3101
console-log test: make sure container is stopped before restarting
...
Closes #4237
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2023-03-19 16:04:46 -05:00
Serge Hallyn
820d2a2b3a
switch from libsystemd's dbus to dbus-1
...
This is purely so that we can do static linking. Linking against
libsystemd makes that a challenge because while it's perfectly simple
to do, distros tend not to provide a libsystemd.a.
Tools that want to (a) link against liblxc and (b) have a statically
linked binary to bind into a minimal container are ill served by
this. So link against libdbus-1.
.github/workflows/build.yml: switch to dbus-1.
src/lxc/cgroups/cgfsng.c: replace the unpriv_systemd_create_scope(),
start_scope, and enter_scope() systemd code with dbus-1 code.
src/tests/oss-fuzz.sh: update from libsystemd-dev to libdbus-1-dev
src/tests/oss-fuzz.sh: disable dbus
.github/workflows/*: update from libsystemd-dev to libdbus-1-dev
meson.build and meson_options.txt: switch from sd_bus to dbus
lxc.spec.in: add dbus-1 to BuildRequires
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Changelog: 03/13: use custom iter type so we can cleanup more easily...
Changelog: 03/13: initialize each dbus_iter to { 0 } as mihalicyn suggested.
2023-03-19 15:30:56 -05:00
Stéphane Graber
12887ebcc6
Merge pull request #4290 from mihalicyn/sk_cloexec
...
tree-wide: convert fcntl(FD_CLOEXEC) to SOCK_CLOEXEC
2023-03-17 11:20:54 -04:00
Alexander Mikhalitsyn
3c1453a38d
tree-wide: convert fcntl(FD_CLOEXEC) to SOCK_CLOEXEC
...
- replace accept() + fcntl(FD_CLOEXEC) with accept4(..., SOCK_CLOEXEC)
- remove fcntl(FD_CLOEXEC) in lxc_server_init() as we already set
SOCK_CLOEXEC in lxc_abstract_unix_open().
See also: ad9429e52
("tree-wide: make socket SOCK_CLOEXEC")
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-03-17 13:43:34 +01:00
Serge Hallyn
838221c111
Merge pull request #4281 from smoser/feature/oci-squashfs
...
Add support for squashfs images in oci via atomfs
2023-02-27 13:57:45 -06:00
Scott Moser
4ea0b361f1
Allow fuse mounts in apparmor start-container.
...
Unprivledged user should be able to do fuse mounts during start-container.
Specifically this solves the problem for un-priv fuse mounting via
pre-hook.
Signed-off-by: Scott Moser <smoser@brickies.net>
2023-02-27 09:07:38 -05:00
Scott Moser
1a2da75b6e
Add support for squashfs images in oci via atomfs
...
This adds support to the oci template for squashfs images.
It uses 'atomfs' from [1] to accomplish this.
Squashfs images (media type
application/vnd.stacker.image.layer.squashfs+zstd+verity) have several
benefits compared to tar+gz:
* immediately mountable
* read-only filesystem
* verity data present in oci manifest.
I presented this at Fosdem 2023 at [2].
The 'atomfs' program can be replaced by passing '--mount-helper'
argument to the oci template.
mount-helper mount oci:<oci_dir>:<oci_name> <mountpoint>
mount-helper umount <mountpoint>
[1] https://github.com/project-machine/atomfs
[2] https://fosdem.org/2023/schedule/event/container_secure_storage/
Signed-off-by: Scott Moser <smoser@brickies.net>
2023-02-27 09:06:37 -05:00
Christian Brauner
71f7e788d9
Merge pull request #4284 from Blub/2023-02-27/empty-apparmor-files
...
apparmor: don't try to mmap empty files
2023-02-27 13:23:13 +01:00
Wolfgang Bumiller
db3cbfa75c
apparmor: don't try to mmap empty files
...
In case empty profile files linger somehow (eg. powerloss or
oom killer etc. between creating and writing the file) we
tried to use mmap() with a length of 0 which is invalid.
Let's treat this as if it did not exist.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-27 11:08:46 +01:00
Stéphane Graber
0b286bde88
Merge pull request #4279 from mihalicyn/setproctitle_fix_fmt_spec
...
initutils: use PRIu64 for uint64_t in setproctitle
2023-02-16 11:15:00 -05:00
Alexander Mikhalitsyn
304bf58fa1
initutils: use PRIu64 for uint64_t in setproctitle
...
Kernel UAPI provides as with the following declaration:
/*
* This structure provides new memory descriptor
* map which mostly modifies /proc/pid/stat[m]
* output for a task. This mostly done in a
* sake of checkpoint/restore functionality.
*/
struct prctl_mm_map {
__u64 start_code; /* code section bounds */
__u64 end_code;
__u64 start_data; /* data section bounds */
__u64 end_data;
__u64 start_brk; /* heap for brk() syscall */
__u64 brk;
__u64 start_stack; /* stack starts at */
__u64 arg_start; /* command line arguments bounds */
__u64 arg_end;
__u64 env_start; /* environment variables bounds */
__u64 env_end;
__u64 *auxv; /* auxiliary vector */
__u32 auxv_size; /* vector size */
__u32 exe_fd; /* /proc/$pid/exe link file */
};
Let's use appropriate types/format specifiers everywhere.
Issue #4268
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-02-16 13:38:28 +01:00
Stéphane Graber
2d3dab782d
Merge pull request #4277 from n0p90/fix-nft-ip6-nat
...
lxc-net.in: fix nftables syntax for IPv6 NAT
2023-02-13 16:36:09 -05:00
Quentin Lyons
4de047f513
lxc-net.in: fix nftables syntax for IPv6 NAT
...
The nftables masquarade rule for IPv6 was using the IPv4 syntax. This
resulted in the following error when starting the lxc-net.service with
LXC_IPV6_NAT="true" and nftables:
Feb 11 18:54:54 pc lxc-net[4936]: Error: conflicting protocols specified: ip6 vs. ip
Feb 11 18:54:54 pc lxc-net[4936]: ^^^^^^^^
Feb 11 18:54:54 pc lxc-net[4917]: Failed to setup lxc-net.
Feb 11 18:54:54 pc systemd[1]: lxc-net.service: Main process exited, code=exited, status=1/FAILURE
Feb 11 18:54:54 pc systemd[1]: lxc-net.service: Failed with result 'exit-code'.
Feb 11 18:54:54 pc systemd[1]: Failed to start LXC network bridge setup.
Signed-off-by: Quentin Lyons <36303164+n0p90@users.noreply.github.com>
2023-02-12 02:24:22 +00:00
Christian Brauner
08f0e76965
Merge pull request #4275 from ariel-miculas/fix_strl_rc_checks
...
Fix strlcat's return value checks
2023-02-07 14:16:27 +01:00
Ariel Miculas
311bb8c53e
Fix strlcat's return value checks
...
Alternatively we could have used safe_strlcat, but it's not used
anywhere and there's also no safe_strlcpy
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
2023-02-07 13:52:31 +02:00
Christian Brauner
042d8165a1
Merge pull request #4270 from ariel-miculas/fix_typo
...
Fix typo: bev_type -> bdev_type
2023-01-30 17:45:12 +01:00
Ariel Miculas
588b53b198
Fix typo: bev_type -> bdev_type
...
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
2023-01-30 18:25:55 +02:00
Christian Brauner
4a1ec6086c
Merge pull request #4263 from hallyn/2023-01-18/drop-fuzz-test
...
drop broken lxc-test-fuzzers
2023-01-23 23:59:12 +01:00
Serge Hallyn
7914c259f2
drop broken lxc-test-fuzzers
...
Closes #4261
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2023-01-20 15:19:03 -06:00
Stéphane Graber
a1874c80dc
Merge pull request #4255 from gibmat/fix-sparc64-link-error
...
Fix build error on sparc64 caused by using the gold linker
2023-01-10 20:08:00 -05:00
Mathias Gibbens
849d808779
Fix build error on sparc64 caused by using the gold linker
...
Signed-off-by: Mathias Gibbens <gibmat@debian.org>
2023-01-10 23:20:14 +00:00
Stéphane Graber
e343a16122
Merge pull request #4253 from hallyn/2023-01-09/overlay
...
lxc-default-cgns apparmor profile: allow overlay mounts
2023-01-09 17:30:28 -05:00
Serge Hallyn
43ad7816d8
lxc-default-cgns apparmor profile: allow overlay mounts
...
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2023-01-09 13:36:45 -06:00
Christian Brauner
2097da81da
Merge pull request #4252 from mihalicyn/create_nic_fix
...
lxc_user_nic: fix get_mtu() error handling
2023-01-06 20:40:34 +01:00
Serge Hallyn
1b25a401b7
Merge pull request #4245 from MaherAzzouzi/master
...
Patching an incoming CVE (CVE-2022-47952)
2023-01-06 12:59:21 -06:00
Alexander Mikhalitsyn
4fa83282b5
lxc_user_nic: fix get_mtu() error handling
...
get_mtu() returns int, but "mtu" variable has unsigned int type.
It leads to logical error in error handling, which can end up
with strange -EINVAL error in lxc_veth_create(), cause (mtu > 0)
condition is met, but negative "mtu" value is too large when set
as mtu for network device.
Issue #4232
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2023-01-06 17:05:07 +01:00
Maher Azzouzi
1b0469530d
Patching an incoming CVE (CVE-2022-47952)
...
lxc-user-nic in lxc through 5.0.1 is installed setuid root, and may
allow local users to infer whether any file exists, even within a
protected directory tree, because "Failed to open" often indicates
that a file does not exist, whereas "does not refer to a network
namespace path" often indicates that a file exists. NOTE: this is
different from CVE-2018-6556 because the CVE-2018-6556 fix design was
based on the premise that "we will report back to the user that the
open() failed but the user has no way of knowing why it failed";
however, in many realistic cases, there are no plausible reasons for
failing except that the file does not exist.
PoC:
> % ls /l
> ls: cannot open directory '/l': Permission denied
> % /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic delete lol lol /l/h/tt h h
> cmd/lxc_user_nic.c: 1096: main: Failed to open "/l/h/tt" <----- file does not exist.
> % /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic delete lol lol /l/h/t h h
> cmd/lxc_user_nic.c: 1101: main: Path "/l/h/t" does not refer to a network namespace path <---- file exist!
Signed-off-by: MaherAzzouzi <maherazz04@gmail.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
2023-01-06 08:47:43 -06:00
Christian Brauner
440727ea38
Merge pull request #4246 from ffontaine/master
...
src/lxc/meson.build: fix build without apparmor
2023-01-05 10:30:33 +01:00
Stéphane Graber
1641f4576b
Merge pull request #4250 from brauner/build.shared.library
...
build: force linking against liblxc
2023-01-04 12:22:12 -05:00
Christian Brauner
a8e1070c61
build: force linking against liblxc
...
We really need to split up our code into better chunks so we avoid all of this
duplicated compilation.
Fixes: https://github.com/lxc/lxc/issues/4249
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2023-01-04 16:45:03 +01:00
Christian Brauner
6564e6ccb2
Merge pull request #4248 from stgraber/master
...
Tweak checkconfig output
2023-01-04 00:08:24 +01:00
Stéphane Graber
c27ea96f7f
checkconfig: Fix filesystem capability check
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-01-03 18:02:55 -05:00
Stéphane Graber
3f361da618
checkconfig: Tweak cgroup handling
...
Only run the Cgroup V1 checks if we're not on a fully functional CGroup
V2 system.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-01-03 18:02:54 -05:00
Stéphane Graber
3ab04999d8
checkconfig: Tweak layout
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-01-03 18:02:54 -05:00
Stéphane Graber
e027ca7119
checkconfig: Hide version if no lxc-start
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-01-03 18:02:53 -05:00
Stéphane Graber
914fec51b0
checkconfig: Fix mixed tabs/spaces
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2023-01-03 18:02:52 -05:00
Fabrice Fontaine
70b176b0d1
src/lxc/meson.build: fix build without apparmor
...
Don't build lsm/apparmor.c if apparmor is explicitly disabled by the
user to avoid the following build failure with gcc 4.8:
/home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/bits/fcntl2.h: In function '__apparmor_process_label_open.isra.0':
/home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
__open_missing_mode ();
^
Fixes:
- http://autobuild.buildroot.org/results/c9f05ad264543adf429badb99310905427092772
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-12-29 14:47:50 +01:00
Stéphane Graber
0b83d71c2c
Merge pull request #4242 from mihalicyn/fixes_after_coverity
...
Fixes after coverity scan
2022-12-12 11:39:17 -05:00
Alexander Mikhalitsyn
42b22da6d1
cgroups: fix cgroup layout detection in __initialize_cgroups
...
It looks like we made a mistake while detecting cgroup layout,
we are always set CGFSNG_LAYOUT_UNIFIED bit.
Reported-by: coverity (CID #1497115 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 12:28:31 +01:00
Alexander Mikhalitsyn
0072919ddc
state: additional check in lxc_wait to prevent OOB
...
I can't see a real problem here, but let's just add a check
just in case.
Reported-by: coverity (CID #1517314 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 11:26:21 +01:00
Alexander Mikhalitsyn
62b94d3ec3
cgroups: check snprintf retval in unpriv_systemd_create_scope
...
Reported-by: coverity (CID #1517315 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 10:35:21 +01:00
Alexander Mikhalitsyn
93d545e378
cgroups: fix buffer out-of-bounds access in enable_controllers_delegation
...
Reported-by: coverity (CID #1517317 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 10:35:02 +01:00
Alexander Mikhalitsyn
f8aa61f97f
network: always initialize struct nl_handler
...
Despite the fact that struct nl_handler is filled zeros
in netlink_open() there are two cases where we have possible
exit paths from the function before netlink_open() is called.
At the same time we have cleaner registered:
call_cleaner(netlink_close)
Two cases:
- netdev_get_flag
- lxc_ipvlan_create
If we are exiting from these functions before netlink_open()
is called we will close random file descriptor by reading
it from (struct nl_handler)->fd.
Let's just properly initialize this structure in all cases
to prevent this bug in the future.
Reported-by: coverity (CID #1517319 and #1517316 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 10:34:18 +01:00
Alexander Mikhalitsyn
6ea4a6c06b
apparmor: properly check lxc_strmmap ret value
...
Reported-by: coverity (CID #1517320 )
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-12 10:33:12 +01:00
Christian Brauner
667292ad89
Merge pull request #4239 from mihalicyn/github_coverity_fix
...
github: fix coverity (add libpam-dev)
2022-12-08 22:01:48 +01:00
Alexander Mikhalitsyn
b37cce95b6
github: fix coverity (add libpam-dev)
...
Should fix
meson.build:494:0: ERROR: C header 'security/pam_modules.h' not found
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-08 16:12:14 +01:00
Stéphane Graber
e85c649c25
Merge pull request #4236 from mihalicyn/github_check_fixes
...
github: fix coverity build
2022-12-08 08:32:15 -05:00
Serge Hallyn
6ab3551615
Merge pull request #4209 from DuratarskeyK/master
...
Simplify IN_SET macro considerably
2022-12-07 08:17:55 -06:00
Alexander Mikhalitsyn
a8dcf88d05
github: fix coverity build
...
1. install meson (ninja is dependency)
2. run meson setup before ninja build
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
2022-12-07 12:09:33 +01:00
Stéphane Graber
b16e4ea85b
Merge pull request #4229 from brauner/rootfs.propagate.shared
...
conf: create separate peer group for container's root
2022-11-29 17:11:29 -05:00
Christian Brauner
7e73934130
conf: ensure mount tunnel is a dependent mount
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-29 21:36:43 +01:00
Christian Brauner
01ae6d4713
apparmor: allow shared mounts in start-container.in
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-29 20:58:14 +01:00
Christian Brauner
81d94a4eec
conf: create separate peer group for container's root
...
Finally, we turn the rootfs into a shared mount. Note, that this
doesn't reestablish mount propagation with the hosts mount
namespace. Instead we'll create a new peer group.
We're doing this because most workloads do rely on the rootfs being
a shared mount. For example, systemd daemon like sytemd-udevd run in
their own mount namespace. Their mount namespace has been made a
dependent mount (MS_SLAVE) with the host rootfs as it's dominating
mount. This means new mounts on the host propagate into the
respective services.
This is broken if we leave the container's rootfs a dependent mount.
In which case both the container's rootfs and the service's rootfs
will be dependent mounts with the host's rootfs as their dominating
mount. So if you were to mount over the rootfs from the host it
would not just propagate into the container's mount namespace it
would also propagate into the service. That's nonsense semantics for
nearly all relevant use-cases. Instead, establish the container's
rootfs as a separate peer group mirroring the behavior on the host.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-24 17:26:27 +01:00
Stéphane Graber
d493695e30
Merge pull request #4230 from brauner/kill.lgtm
...
README: remove lgtm
2022-11-24 10:16:29 -05:00
Christian Brauner
07670dacdd
Merge pull request #4231 from brauner/cgroup.removal
...
cgroups: fix cgroup removal
2022-11-24 14:00:40 +01:00
Christian Brauner
68020412c2
cgroups: only allocate user namespace if we have to
...
If the monitor runs as root we can assume it's able to remove the cgroups it
created when the container started.
Fixes: https://github.com/lxc/lxd/issues/11108
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-24 12:45:52 +01:00
Christian Brauner
27f69d45bf
cgroups: use userns_exec_full() during cgroup removal
...
When removing cgroups we can't always use the minimal idmap if the user has
specified a specific map for the container instead of just a simple one.
Execute cgroup removal under the full map.
Fixes: https://github.com/lxc/lxd/issues/11108
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-24 12:45:32 +01:00
Christian Brauner
1029c2a06e
README: remove lgtm
...
It's more or less dead. If we care about a service like this we should use
something else.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-11-24 09:46:24 +01:00
Christian Brauner
fa56702e6c
Merge pull request #4228 from rchincha/issue-4223
...
meson.build: strip newline for variable assignments
2022-11-24 00:26:34 +01:00
Ramkumar Chinchani
dcf85308cb
meson.build: strip newline for variable assignments
...
Unfortunately, builds using alpine:edge still break!
Apparently, run_command(...).stdout() must be strip()'ed for variable
assignments
Addendum to 60e292c64a
Fixes issue #4223
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
2022-11-23 19:57:21 +00:00
Christian Brauner
60e292c64a
Merge pull request #4226 from rchincha/issue-4223
...
meson.build: strip newlines from git output
2022-11-23 09:14:50 +01:00
Ramkumar Chinchani
8aac588663
meson.build: strip newlines from git output
...
Fixes issue #4223
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
2022-11-22 18:20:19 +00:00
Christian Brauner
cafced2a3f
Merge pull request #4214 from cyphar/opensuse-build
...
build: fix build issues on openSUSE
2022-11-22 16:07:41 +01:00
Christian Brauner
cf9474fab6
Merge pull request #4222 from gibmat/fix-ia64-build
...
tests: lxc-test-reboot: Fix build on ia64
2022-11-22 12:32:49 +01:00
Mathias Gibbens
16c6ff2269
tests: lxc-test-reboot: Fix build on ia64
...
Add the prototype for __clone2(...) that is used on ia64, and adjust the
code to use it via macro tests.
Verified that the code compiles properly on Debian's ia64 porterbox
(yttrium), but was unable to actually run as lxc-test-reboot requires
root privileges.
Signed-off-by: Mathias Gibbens <gibmat@debian.org>
2022-11-19 15:14:47 +00:00
Stéphane Graber
8a49476094
Merge pull request #4221 from hallyn/2022-11-11/staticlib
...
src/lxc/meson.build: fix the static library path
2022-11-12 12:14:30 -05:00
Serge Hallyn
64eb31d02d
src/lxc/meson.build: fix the static library path
...
Since switching to meson, liblxc.a is being shipped as liblxc_static.a.
Change it back to liblxc.a.
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2022-11-11 18:20:37 -06:00
Aleksa Sarai
c6c705bfa3
build: drop build-time systemd dependency
...
On openSUSE, our packages are build in the Open Build Service which does
not have a proper systemd installation that you can query to get the
systemdunitdir.
The simplest solution is to re-add the ability to explicitly set the
systemdunitdir (as was previously possible with the autotools build
system in pre-5.0 LXC).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-31 00:07:56 +11:00
Aleksa Sarai
f321cd610a
build: use cc.get_define to detect FS_CONFIG_* symbols
...
For some reason, openSUSE has a very strange layout in sys/mount.h where
the definition of all of the FS_CONFIG_* idents are present but are
ifdef'd out in such a way that they will never be defined in an actual
build:
#define FSOPEN_CLOEXEC 0x00000001
/* ... */
#ifndef FSOPEN_CLOEXEC
enum fsconfig_command
{
FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
# define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG
/* ... */
};
#endif
Unfortunately, while cc.has_header_symbol is faster, it cannot handle
this which results in compilation errors on openSUSE because the
FS_CONFIG_* symbols are actually not defined when compiling even though
the ident is present in the header. Switching to cc.get_define fixes
this issue.
Fixes: cbabe8abf1
("build: check for FS_CONFIG_* header symbol in sys/mount.h")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-31 00:07:55 +11:00
Aleksa Sarai
5aff4ea371
build: only build init.lxc.static if libcap is statically linkable
...
Without setting this, the default build will fail if you don't have the
static libcap library installed (on openSUSE this is packaged separately
to libcap-devel).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-31 00:07:55 +11:00
Aleksa Sarai
c1f87c8113
build: fix handling of dependancies to fix build on openSUSE
...
Among other things, openSUSE places seccomp.h inside a non-default
include directory (/usr/include/seccomp/seccomp.h) which revealed
several issues with how dependencies were being handled previously.
The most notable issue is that the include cflags of our build
dependencies were not being provided to the recipes for static
executables (yet they still expected access to the dependency headers).
This also involved a minor cleanup of how these dependencies are
collected, and added liburing to the set of private pkg-config libs
(which I assume was an oversight?).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-31 00:07:54 +11:00
Aleksa Sarai
bc318926d7
cgroups: fix -Waddress warning
...
While in principle the pointer could overflow, GCC 12 considers this to
not be possible and issues the following warning:
../src/lxc/cgroups/cgfsng.c: In function ‘__cgfsng_delegate_controllers’:
../src/lxc/cgroups/cgfsng.c:3306:21: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘it + 8’ must not be NULL [-Waddress]
3306 | if ((it + 1) && *(it + 1))
| ^
This removes the only build warning triggered when building on openSUSE.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2022-10-31 00:07:53 +11:00
HisShadow
4deaa28c04
Unroll IN_SET since the max usage is 2 elements check
...
Signed-off-by: HisShadow <shadowpilot34@gmail.com>
2022-10-25 20:44:16 +03:00
Christian Brauner
fbed9bb759
Merge pull request #4204 from ajmalsiddiqui/master
...
lxc-attach: Fix lost return codes of spawned processes that are killed
2022-10-19 13:01:05 +02:00
Christian Brauner
bff4223cd8
Merge pull request #4210 from Cypresslin/lxc-destroy-help-force
...
tools: lxc-destroy: update help message for --force
2022-10-19 12:59:51 +02:00
Christian Brauner
a5d2343996
Merge pull request #4211 from Cypresslin/lxc-test-checkpoint-restore-cleanup
...
tests: lxc-test-checkpoint-restore: use trap to do cleanup
2022-10-19 12:59:20 +02:00
Po-Hsu Lin
73fd9bf558
tests: lxc-test-checkpoint-restore: use trap to do cleanup
...
This test will fail on Jammy 5.15, and because of the "set -e" it
will never go through the lxc-stop and lxc-destroy code in the end
of this script. Thus the lxc-test-criu container will not be removed.
Compose a cleanup() and use TRAP to solve this problem.
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
2022-10-19 14:20:39 +08:00
Po-Hsu Lin
8480c56a45
tools: lxc-destroy: update help message for --force
...
Looks like the --force is a flag to stop a running container before
destroying it.
Update the help message accordingly.
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
2022-10-19 12:57:29 +08:00
Stéphane Graber
37b5f00454
Merge pull request #4208 from brauner/2022-10-13.oss-fuzz.fixes
...
build: add libsystemd to oss fuzz dependencies
2022-10-13 13:25:20 -04:00
Christian Brauner
3cac3fce4b
build: add libsystemd to oss fuzz dependencies
...
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52169
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-10-13 17:48:10 +02:00
Christian Brauner
d92710c29d
Merge pull request #4207 from tomponline/tp-attach-permission-denied
...
lxc/attach: Detect EACCES from execvp and convert to 126 exit status
2022-10-13 17:23:07 +02:00
Thomas Parrott
f7cadaa346
lxc/attach: Detect EACCES from execvp and convert to 126 exit status
...
Before:
sudo lxc-attach -n test /etc/passwd ; echo $?
lxc-attach: test: ../src/lxc/attach.c: lxc_attach_run_command: 1841 Permission denied - Failed to exec "/etc/passwd"
255
After:
sudo lxc-attach -n test /etc/passwd ; echo $?
lxc-attach: test: ../src/lxc/attach.c: lxc_attach_run_command: 1841 Permission denied - Failed to exec "/etc/passwd"
126
Which better aligns with bash:
/etc/passwd; echo $?
bash: /etc/passwd: Permission denied
126
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2022-10-13 15:33:30 +01:00
Christian Brauner
1ec37707ea
Merge pull request #4187 from ChenQi1989/replace-aysncv
...
use sd_bus_call_method_async to replace the asyncv one
2022-10-05 20:49:01 +02:00
Mohammed Ajmal Siddiqui
4ebca5a005
lxc-attach: Fix lost return codes of spawned processes that are killed
...
lxc-attach swallows the return codes of processes that are terminated
via a signal, and by default exits with a return code of 0 (i.e.
indicating success) even if the command it tried to execute was
terminated.
This patch fixes it by explicitly checking if the process was terminated
via a signal, and returning an appropriate exit code.
Note that we add 128 to the signal value to generate the exit code
because by convention the exit code is 128 + signal number. e.g. if a
process is killed via signal 9, then the error code is 9 + 128 = 137.
Signed-off-by: Mohammed Ajmal Siddiqui <ajmalsiddiqui21@gmail.com>
2022-10-05 12:20:58 +05:30
Stéphane Graber
fb319ca7d8
Merge pull request #4202 from DarkGuySM/master
...
Update README.md
2022-10-02 22:56:52 -04:00
DarkGuySM
09233897b5
Update README.md
...
Corrected grammar in readme.
Signed-off-by: DarkGuySM <78262720+DarkGuySM@users.noreply.github.com>
2022-10-02 15:36:50 +05:30
Stéphane Graber
3b9927e7c4
Merge pull request #4200 from brauner/2022-09-14.fixes
...
conf: allow cross-device links
2022-09-14 11:06:17 -04:00
Christian Brauner
4a66dabf86
conf: allow cross-device links
...
Fixes: https://github.com/lxc/lxd/issues/10914
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-09-14 16:21:20 +02:00
Stéphane Graber
208161eb76
Merge pull request #4197 from lxc/dependabot/github_actions/actions/checkout-3
...
build(deps): bump actions/checkout from 2 to 3
2022-09-12 10:06:47 -04:00
dependabot[bot]
dc4f1220fe
build(deps): bump actions/checkout from 2 to 3
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 13:31:52 +00:00
Stéphane Graber
7c6573bebb
Merge pull request #4193 from sashashura/patch-1
...
GitHub Workflows security hardening
2022-09-01 14:07:52 -04:00
Alex
2b802090f5
Update cifuzz.yml
...
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
Signed-off-by: Alex <93376818+sashashura@users.noreply.github.com>
2022-09-01 15:52:05 +01:00
Stéphane Graber
aee88ef845
Merge pull request #4192 from DriedYellowPeach/master
...
fix error message when use tools with -? option
2022-09-01 06:04:29 -04:00
Neil.wrz
20cc784560
fix error message when use tools with -? option
...
Signed-off-by: Neil.wrz <wangrunze13@huawei.com>
2022-09-01 02:18:04 -07:00
Chen Qi
b0abedf60b
use sd_bus_call_method_async to replace the asyncv one
...
The sd_bus_call_method_asyncv's 10th parameter is of type
va_list and supplying NULL when invoking it causes compilation
error. Just replace it with the async one.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2022-08-25 05:46:07 -07:00
Stéphane Graber
954e8f653a
Merge pull request #4177 from CameronNemo/meson-docbook2x
...
meson: fix docbook2x detection
2022-08-17 11:17:24 -04:00
Stéphane Graber
0453033fd4
Merge pull request #4184 from brauner/2022-08-17.fixes
...
tree-wide: include improvements
2022-08-17 10:57:27 -04:00
Christian Brauner
589a930f15
tree-wide: split open helpers into open_utils.h
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-17 09:58:34 +02:00
Christian Brauner
7b1836bce1
build: prevent the inclusion of linux/mount.h with a hack
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-17 09:48:32 +02:00
Christian Brauner
da8c298534
mount_utils: remove conf.h include
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-17 09:46:14 +02:00
Christian Brauner
74c2f58e1f
mount: move mount utilities from syscall_wrappers.h into mount_utils.h
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-17 09:44:34 +02:00
Christian Brauner
68cf564890
tree-wide: minimize liburing.h inclusion
...
because it brings in linux/fs.h and defines struct open_how.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-17 09:39:25 +02:00
Cameron Nemo
06f99c2599
meson: fix docbook2x detection
...
docbook2man can sometimes be docbook2x and other times be docbook-utils.
Rather than compare paths, use version constraints to detect version.
Signed-off-by: Cameron Nemo <cam@nohom.org>
2022-08-16 20:41:29 -07:00
Stéphane Graber
1df8895204
Merge pull request #4180 from sgn/meson-distroconfdir
...
meson.build: allow explicit distrosysconfdir
2022-08-11 14:22:33 -04:00
Stéphane Graber
b3defe05b0
Merge pull request #4181 from brauner/2022-08-10.fixes
...
tree-wide: only rely on sys/ headers to avoid conflicts with linux/ headers
2022-08-10 09:25:21 -04:00
Christian Brauner
133aa416ca
tree-wide: use struct open_how directly
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-10 12:18:49 +02:00
Christian Brauner
63468abd32
tree-wide: use struct clone_args directly
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-10 12:16:14 +02:00
Christian Brauner
4771699fd9
tree-wide: wipe direct or indirect linux/mount.h inclusion
...
It is incompatible with sys/mount.h and causes massive headaches.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-10 12:02:19 +02:00
Đoàn Trần Công Danh
16ebb29dcc
meson.build: allow explicit distrosysconfdir
...
Allows either:
- Build inside minimal-and-clean chroot with neither
/etc/sysconfig nor /etc/default available.
- Cross Compile lxc from foreign distro,
let's say host distro uses /etc/sysconfig and build distro
uses /etc/default and vice versus.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2022-08-10 07:12:44 +07:00
Stéphane Graber
d83051ea6a
Merge pull request #4179 from brauner/2022-08-09.fixes
...
build: fixes for glibc 2.36
2022-08-09 17:40:09 -04:00
Christian Brauner
cbabe8abf1
build: check for FS_CONFIG_* header symbol in sys/mount.h
...
Fixes : #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-09 17:20:46 +02:00
Christian Brauner
ef1e0607b8
build: detect sys/pidfd.h availability
...
Fixes : #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-09 17:20:44 +02:00
Christian Brauner
c1115e1503
build: detect where struct mount_attr is declared
...
Fixes : #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-08-09 17:20:13 +02:00
Christian Brauner
cbbb09b56f
Merge pull request #4175 from stgraber/master
...
gitignore: Simplify
2022-08-03 09:55:30 +02:00
Stéphane Graber
e452c89457
gitignore: Simplify
...
The move to meson has made it so that all rendered/built files are now
nicely self-contained. This lets us greatly simplify our gitignore,
effectively just ignoring release tarballs and the few usual temporary
files we may deal with during development.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-08-01 18:12:06 -04:00
Stéphane Graber
332667eb21
Merge pull request #4173 from brauner/2022-07-25.lxc-usernsexec
...
lxc-usernsexec: allow to select which {g,u}id to switch to
2022-07-25 17:22:24 -04:00
Christian Brauner
32a0715193
lxc-usernsexec: allow to select which {g,u}id to switch to
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-07-25 22:25:55 +02:00
Christian Brauner
7f66430711
README: update security mails
...
Reported-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-07-19 10:29:41 +02:00
Christian Brauner
94997c0c40
Merge pull request #4168 from ffontaine/master
...
meson.build: fix build without stack-protector
2022-07-14 22:53:49 +01:00
Fabrice Fontaine
5e704fe389
meson.build: fix build without stack-protector
...
Move -fstack-protector-strong from possible_cc_flags to
possible_link_flags to avoid a build failure on toolchains without ssp
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-07-14 17:50:48 +02:00
Stéphane Graber
9a40624c82
Merge pull request #4167 from ffontaine/master
...
meson.build: fix build with -Dcapabilities=false
2022-07-14 11:45:37 -04:00
Fabrice Fontaine
7d72354898
meson.build: fix build with -Dcapabilities=false
...
Define libcap_static to an empty array to avoid the following build
failure with -Dcapabilities=false:
output/build/lxc-5.0.0/src/lxc/cmd/meson.build:64:4: ERROR: Unknown variable "libcap_static".
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-07-14 17:13:18 +02:00
Christian Brauner
4ef148de7a
Merge pull request #4166 from ffontaine/master
...
src/lxc/log.h: fix STRERROR_R_CHAR_P
2022-07-14 15:40:54 +01:00
Fabrice Fontaine
8ee8879083
src/lxc/log.h: fix STRERROR_R_CHAR_P
...
STRERROR_R_CHAR_P is always defined to 0 or 1 depending on the value of
have_func_strerror_r_char_p in meson.build so replace #ifdef by #if to
avoid a redefinition build failure if char *strerror_r is not defined
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-07-14 12:33:17 +02:00
Christian Brauner
b96e9ae47a
Merge pull request #4163 from Blub/meson/remaining-checks.2022-07-04
...
meson: add remaining still-in-use config checks
2022-07-04 13:22:37 +02:00
Wolfgang Bumiller
353f0f9926
meson: add remaining still-in-use config checks
...
These are all still in use in the code but have not been
added to meson.build when switching over from autoconf.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-04 12:01:10 +02:00
Christian Brauner
de6d054d22
Merge pull request #4151 from Teemperor/FixUninitRead
...
Fix uninitialized read in parse_cap when libcap is not used
2022-07-04 10:10:17 +02:00
Christian Brauner
890d0da215
Merge pull request #4161 from srd424/patch-1
...
Fix errors constructing mount string when extra mount options supplied
2022-07-04 09:23:02 +02:00
srd424
3d360cf9db
Store mount options in correct variable
...
This was exposed by the fix in the previous commit.
Signed-off-by: srd424 <srd424@users.noreply.github.com>
2022-07-03 18:18:23 +01:00
srd424
df3301046f
Fix off-by-one error constructing mount options
...
This fixes a really subtle off-by-one error constructing overlay mount options if rootfs options are provided and modern overlayfs (i.e. requiring a workdir) is used. We need to allow for the extra "," required to separate the extra options when computing the length!
Signed-off-by: srd424 <srd424@users.noreply.github.com>
2022-07-03 10:21:30 +01:00
Christian Brauner
cf1f3bc459
Merge pull request #4159 from Blub/meson/statvfs
...
add check for statvfs
2022-07-01 14:57:41 +02:00
Wolfgang Bumiller
a5e32dabc6
Merge pull request #4158 from brauner/2022-07-01.fixes
...
start: fix namespace sharing
2022-07-01 13:40:24 +02:00
Wolfgang Bumiller
8ee615c27d
add check for statvfs
...
we use HAVE_STATVFS in the code but with meson the check got
lost causing mount_entry to fail to remount some things such
as a bind mount of /dev/fuse via
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file 0 0
which would cause the following log messages:
DEBUG conf - ../src/lxc/conf.c:mount_entry:2416 - Remounting "/dev/fuse" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fuse" to respect bind or remount options
ERROR conf - ../src/lxc/conf.c:mount_entry:2459 - Operation not permitted - Failed to mount "/dev/fuse" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fuse"
note that the `Flags for ... were ...` line is not showing
up there, which depends on HAVE_STATVFS
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-01 11:18:50 +02:00
Christian Brauner
85a273b596
Merge pull request #4147 from marcfiu/issue-4026
...
fix for issue #4026 : set broadcast to 0.0.0.0 for /31 and /32
2022-07-01 10:16:17 +02:00
Christian Brauner
07a00b78f0
start: fix namespace sharing
...
Fixes : #4134
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-07-01 10:15:17 +02:00
Stéphane Graber
59d483ef49
Merge pull request #4157 from brauner/2022-06-30.fixes
...
conf: fix append_ttyname()
2022-06-30 11:20:26 -04:00
Christian Brauner
eae44ce199
conf: fix append_ttyname()
...
We appended container_tty= and then used setenv(container_tty, ...)
resulting int container_tty=container_tty=.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-30 12:48:01 +02:00
Stéphane Graber
10ae11cc79
Merge pull request #4154 from brauner/2022-06-29.fixes
...
conf: startup fixes
2022-06-29 13:09:48 -04:00
Christian Brauner
6c50e09f2c
start: record inherited namespaces earlier to make it available for idmapped rootfs setup
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-29 18:31:37 +02:00
Christian Brauner
7317d2a8a7
start: don't overwrite file descriptors during namespace preservation
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-29 18:31:01 +02:00
Christian Brauner
fc133a9f37
conf: log file descriptors on error during idmapped mount setup
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-29 18:29:52 +02:00
Marc E. Fiuczynski
26de6cbc8d
fix for issue 4026: set broadcast to 0.0.0.0 for /31 and /32
...
Signed-off-by: Marc E. Fiuczynski <mfiuczyn@akamai.com>
2022-06-27 15:15:48 -04:00
Christian Brauner
2e6e374c0a
Merge pull request #4153 from brauner/2022-06-21.unprivileged-cgroup2
...
use systemd dbus StartTransientUnit for unpriv cgroup2
2022-06-21 16:27:49 +02:00
Serge Hallyn
c55353f84a
use systemd dbus StartTransientUnit for unpriv cgroup2
...
If, when init'ing cgroups for a container start, we detect that we
are an unprivileged user on a unified-hierarchy-only system, then we
try to request systemd, through dbus api, to create a new scope for
us with delegation. Call the cgroup it creates for us P1. We then
create P1/init, move ourselves into there, so we can enable the
controllers for delegation to P1's children through P1/cgroup.subtree_control.
On attach, we try to request systemd attach us to the container's
scope. We can't do that ourselves in the normal case, as root owns
our login cgroups.
Create a new command api for the lxc monitor to tell lxc-attach the
systemd scope to which to attach.
Changelog:
* free cgroup_meta.systemd_scope in lxc_conf_free (Thanks Tycho)
* fix some indent
* address some (not all) of brauner's feedback
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2022-06-21 16:01:13 +02:00
Raphael Isemann
b203e1a141
Fix uninitialized read in parse_cap when libcap is not used
...
fuzz-lxc-cgroup-init currently fails for me with the input
```
lxc.cap.keep=0
```
with this report:
```
==640655==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x833c77 in parse_cap /src/lxc/san_build/../src/lxc/conf.c:3161:6
#1 0xaa5fd6 in add_cap_entry /src/lxc/san_build/../src/lxc/confile.c:2462:9
#2 0x9eb69c in set_config_cap_keep /src/lxc/san_build/../src/lxc/confile.c:2503:8
#3 0x974a76 in parse_line /src/lxc/san_build/../src/lxc/confile.c:3115:9
#4 0xea8cac in lxc_file_for_each_line_mmap /src/lxc/san_build/../src/lxc/parse.c:123:9
#5 0x9700a1 in lxc_config_read /src/lxc/san_build/../src/lxc/confile.c:3192:9
#6 0x4a3b50 in LLVMFuzzerTestOneInput /src/lxc/san_build/../src/tests/fuzz-lxc-cgroup-init.c:40:8
#7 0x10556e3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
#8 0x1041372 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
#9 0x1046bbc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
#10 0x106f7b2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#11 0x7ffff7bc00b2 in __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:308:16
#12 0x420a9d in _start (/home/fuzzer/oss-fuzz/build/out/lxc/fuzz-lxc-cgroup-init+0x420a9d)
Uninitialized value was created by an allocation of 'last_cap' in the stack frame of function 'parse_cap'
#0 0x832e30 in parse_cap /src/lxc/san_build/../src/lxc/conf.c:3131
```
The reason is that without libcap we parse_cap ends up comparing two
uninitialized values. See the snippet below:
```
int parse_cap(const char *cap_name, __u32 *cap)
{
int ret;
unsigned int res;
__u32 last_cap;
[...]
ret = lxc_caps_last_cap(&last_cap); // NOTE: 1. Call here.
if (ret) // Not taken as dummy lxc_caps_last_cap returned 0.
return -1;
if ((__u32)res > last_cap) // last_cap is uninitialized.
return -1;
*cap = (__u32)res;
return 0;
}
```
Root cause seems to be that the dummy `lxc_caps_last_cap` returns 0 but
doesn't set the last_cap value. This patch just returns -1 as an error code
to avoid the uninitialized read.
Note: When reproducing the bug you need to compile with O0 and *not* with O1
otherwise you will not see the report.
Signed-off-by: Raphael Isemann <teemperor@gmail.com>
2022-06-21 13:19:21 +02:00
Christian Brauner
0a73102d43
Merge pull request #4149 from petris/lxc_multicall
...
tools: Provide multicall lxc binary
2022-06-18 15:33:00 +02:00
Stéphane Graber
e73520adf4
meson: Set DEVEL flag post release
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-16 16:41:05 -04:00
Stéphane Graber
1f8c355727
Release LXC 5.0.0
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-16 16:40:04 -04:00
Petr Malat
f4d02217ee
tools: Provide multicall lxc binary
...
Create a binary, which embeds all lxc tools similar way as busybox
embeds its applets. This is handy for embedded systems as it saves
roughly 90% of the disk space.
To disable normal tools and use multicall binary exclusively use the
following meson setup options:
-Dtools=false -Dtools-multicall=true
Signed-off-by: Petr Malat <oss@malat.biz>
2022-06-15 16:27:47 +02:00
Petr Malat
289d6413eb
meson: Generate compile commands by iterating over an array
...
This makes it possible to add a new command without updating multiple
places in the meson file.
Signed-off-by: Petr Malat <oss@malat.biz>
2022-06-15 16:06:10 +02:00
Stéphane Graber
dcde35e709
Merge pull request #4148 from stgraber/master
...
meson: Fix bad strerror_r check
2022-06-13 22:17:52 -04:00
Stéphane Graber
9fea612230
meson: Fix bad strerror_r check
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-13 21:27:46 -04:00
Stéphane Graber
527281dacc
Merge pull request #4146 from brauner/2022-06-13.fixes
...
build: fixes
2022-06-13 10:12:07 -04:00
Christian Brauner
57f4bd73cb
build: map autotools options to meson options in meson_options.txt
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-13 15:46:33 +02:00
Christian Brauner
00b9b120af
README: reflect meson in the documentation
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-13 15:36:13 +02:00
Christian Brauner
493bf2ded8
build: add missing memfd-rexec option
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-13 15:33:36 +02:00
Christian Brauner
0c4549a331
build: support thread-safety enforcement as option
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-13 15:33:31 +02:00
Christian Brauner
de4543d8f8
build: use cc.links() to check for static libcap
...
Fixes : #4144
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-13 11:04:17 +02:00
Stéphane Graber
f5420c9d3f
Merge pull request #4142 from brauner/2022-06-09.build.fixes
...
tests: fix oss-fuzz port to meson
2022-06-09 17:35:34 -04:00
Christian Brauner
3952fb4588
oss-fuzz: cleanup build flags
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:08 +02:00
Christian Brauner
8f7ba7c8bc
oss-fuzz: ensure binaries are zipped
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:08 +02:00
Christian Brauner
cfa85da6da
oss-fuzz: adapt options to oss-fuzz build
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:08 +02:00
Christian Brauner
0196c4df71
oss-fuzz: handle dependencies
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:08 +02:00
Christian Brauner
9fec9fef72
build: separate oss-fuzz tests from regular test builds
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:08 +02:00
Christian Brauner
a8e5f3623e
github/workflows/cifuzz: update to Ubuntu 22.04
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:07 +02:00
Christian Brauner
d42a3b1366
build: add oss-fuzz switch
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:07 +02:00
Christian Brauner
0b9adfdad4
build: add seccomp build option
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:07 +02:00
Christian Brauner
826391b2a2
build: fix build with various options turned off
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:07 +02:00
Christian Brauner
abc5e6bb94
build: tweak build flags
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-09 23:07:07 +02:00
Stéphane Graber
31c831dfe4
Merge pull request #4141 from lxc/dependabot/github_actions/actions/upload-artifact-3
...
build(deps): bump actions/upload-artifact from 1 to 3
2022-06-09 02:02:41 -04:00
dependabot[bot]
cb3178a604
build(deps): bump actions/upload-artifact from 1 to 3
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-06-09 06:01:55 +00:00
Stéphane Graber
706b3f2d0a
Merge pull request #4140 from turrisxyz/Dependabot-GitHub-Actions
...
chore: Included githubactions in the dependabot config
2022-06-09 02:01:31 -04:00
naveen
7ceb9b99ba
chore: Included githubactions in the dependabot config
...
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.
Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot
GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-06-09 01:29:39 +00:00
Christian Brauner
46341a7598
Merge pull request #4139 from stgraber/master
...
Github workflow fixes
2022-06-09 00:46:28 +02:00
Stéphane Graber
554060879b
github: Fix compiler version task for coverity
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 17:46:50 -04:00
Stéphane Graber
59d1841165
github: Fix bad syntax in cifuzz
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 17:44:08 -04:00
Christian Brauner
0f8c8f89b3
Merge pull request #4137 from brauner/2022-06-08.stgraber.master
...
build: remove autotools and finish meson port
2022-06-08 20:43:10 +02:00
Christian Brauner
b4b1f1498c
github/workflows/sanitizers: port sanitizers builds to meson
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
0ab1a63461
github/workflows: port all workflows to Ubuntu 22.04
...
So we have a new enough meson version everywhere.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
272f1ee460
github/workflows/cifuzz: ensure necessary paths are added
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
2fb1430b3f
github/workflows/build: remove sanitizer build
...
We have a separate workflow for this.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
77b2a6c405
github/workflows/build: add -Db_lto_mode=default
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
47991ce753
github/workflows/build: install lvvm as well
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
b8b31ab36a
oss-fuzz: more meson options
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:15:07 +02:00
Christian Brauner
d679f7d85f
build: lxc-init doesn't need to build the whole config infra
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:03:59 +02:00
Christian Brauner
575d0e34ae
build: add additional command line switches
...
In order to compile for fuzzers where we will need and want to turn a
bunch of things off add command line switches that allow us to do so.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:03:05 +02:00
Christian Brauner
5b726537aa
build: use liblxc_sources everywhere
...
The old split didn't buy us a lot and causes problems when buidling with
sanitizers enabled so just use the full sources.
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 20:01:26 +02:00
Christian Brauner
6bb8d4ce31
config: make lxc-{containers,net}.in executable
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-06-08 18:52:14 +02:00
Stéphane Graber
bb97e07995
Merge pull request #4136 from turrisxyz/Pinned-Dependencies-GitHub
...
chore: Set permissions for GitHub actions
2022-06-08 01:26:59 -04:00
Stéphane Graber
cd3d65155b
meson: Always defined IS_BIONIC
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 01:00:51 -04:00
Stéphane Graber
6ae86a9c17
src: Don't use ifdef/defined for config.h
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:05 -04:00
Stéphane Graber
9c3a240bef
github: Update coverity workflow for meson
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:04 -04:00
Stéphane Graber
6f9fabfcb8
github: Update build test for meson
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:03 -04:00
Stéphane Graber
826cc3ddca
README: Update for meson
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:02 -04:00
Stéphane Graber
f2c06c6c2d
doc: Update for meson
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:01 -04:00
Stéphane Graber
62423c89e7
meson: Add basic Makefile
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:47:00 -04:00
Stéphane Graber
4c8139f9cf
Remove autotools
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-08 00:46:59 -04:00
neilnaveen
fe3add2ab8
chore: Set permissions for GitHub actions
...
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ )
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2022-06-08 01:08:12 +00:00
Christian Brauner
099bd13ce5
Merge pull request #4135 from stgraber/meson
...
More meson fixes
2022-06-07 23:51:34 +02:00
Stéphane Graber
7eac83c1b1
meson: Fix mntent include condition
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:26:47 -04:00
Stéphane Graber
61c40023d0
lxc/rexec: Use HAVE_FEXECVE
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:26:46 -04:00
Stéphane Graber
faa4ae06ef
meson: Add lxcmntent to unmount-namespace hook
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:14 -04:00
Stéphane Graber
199241209f
meson: Add missing prlimit include
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:13 -04:00
Stéphane Graber
7a489adb89
meson: Only build seccomp and selinux when needed
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:12 -04:00
Stéphane Graber
4c96107d1e
meson: Always define HAVE_LIBURING
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:11 -04:00
Stéphane Graber
869deb9173
meson: seccomp is optional
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:10 -04:00
Stéphane Graber
f7de7d7adf
meson: Fix on shallow git trees
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:09 -04:00
Stéphane Graber
d5dff814ac
meson: Add bionic detection
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:08 -04:00
Stéphane Graber
e18dbec746
meson: Fix RPM spec variables
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:07 -04:00
Stéphane Graber
8135966d1d
meson: Make lxc-user-nic setuid
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:06 -04:00
Stéphane Graber
1ccdc25349
meson: Don't include lxc-test-fuzzers
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:05 -04:00
Stéphane Graber
5055c73d91
meson: Skip static library when using sanitizer
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:04 -04:00
Stéphane Graber
8d77f43f5c
meson: Cleanup and fix includes
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:04 -04:00
Stéphane Graber
4dd5e0cf13
meson: Add coverity flag
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-07 17:18:03 -04:00
Christian Brauner
3d24d295ce
Merge pull request #4133 from dasteihn/sta/fallthrough
...
CODING_STYLE: add forgotten fallthrough
2022-06-07 13:20:05 +02:00
Philipp Stanner
3bba8eade7
CODING_STYLE: add forgotten fallthrough
...
Signed-off-by: Philipp Stanner <stanner@posteo.de>
2022-06-07 13:06:56 +02:00
Christian Brauner
4cda46cb33
Merge pull request #4130 from stgraber/master
...
Finalize the meson port
2022-06-03 10:32:25 +02:00
Stéphane Graber
9c562440e5
meson: Add RPM spec
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:50:01 -04:00
Stéphane Graber
eba7f7a6bc
meson: Rework configuration variables
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:50:00 -04:00
Stéphane Graber
7991f60047
meson: Tweak config for manpages
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:49:59 -04:00
Stéphane Graber
f80af4e12b
meson: Export more variables to doc
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:49:58 -04:00
Stéphane Graber
299f3f80d2
meson: Export LXC_DISTRO_SYSCONF
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-06-02 16:49:58 -04:00
Christian Brauner
6e4796b4e3
Merge pull request #4126 from stgraber/master
...
Complete meson port
2022-05-31 09:17:31 +02:00
Stéphane Graber
6105cc7f53
meson: Add apparmor profiles
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 19:16:42 -04:00
Stéphane Graber
36a53f3026
meson: Add sysconfig
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 19:16:41 -04:00
Stéphane Graber
8131bb44ec
meson: Add init scripts
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 19:16:40 -04:00
Stéphane Graber
7d8a38b260
meson: Rename want_io_uring
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 19:16:39 -04:00
Stéphane Graber
4412d151b6
meson: Make docbook2man required if user requested doc
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 19:16:38 -04:00
Christian Brauner
a3579c031e
Merge pull request #4125 from stgraber/master
...
meson: Tweak docs
2022-05-30 22:24:07 +02:00
Stéphane Graber
2bd9ab6fc5
meson: More flexible doc handling
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 16:00:12 -04:00
Stéphane Graber
fb15f1c0da
meson: Simplify if statements
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-30 16:00:11 -04:00
Christian Brauner
73fdf87ccb
Merge pull request #4124 from stgraber/master
...
More meson work
2022-05-28 08:27:12 +02:00
Stéphane Graber
47c56c50a8
meson: Add manpages
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-27 22:02:38 -04:00
Stéphane Graber
a79b0663b4
meson: Only build tools when requested
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-27 22:02:37 -04:00
Stéphane Graber
b3d189920a
meson: Add tools option
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-27 22:02:36 -04:00
Stéphane Graber
24dcd86d9a
meson: Re-shuffle PAM
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-27 22:02:35 -04:00
Stéphane Graber
54f1ddb39d
meson_options: Move entries around
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-27 22:02:34 -04:00
Stéphane Graber
771050e5c4
Merge pull request #4120 from brauner/2022-05-18.meson.pam
...
build: add pam_cgfs to meson
2022-05-24 10:26:38 -04:00
Christian Brauner
d5e2bc9750
Merge pull request #4121 from sitano/ivan_fix_pidfds_loglvl
...
lxc_can_use_pidfd: don't log error if pidfds not supported, trace
2022-05-21 09:23:57 +02:00
Ivan Prisyazhnyy
4afaadf02c
lxc_can_use_pidfd: don't log error if pidfds not supported, trace
...
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
2022-05-20 16:30:30 +02:00
Christian Brauner
8c8e72826f
pam: fix compiler warnings
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-05-19 11:49:48 +02:00
Christian Brauner
8c48813a6c
build: add pam_cgfs to meson
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-05-19 11:49:48 +02:00
Stéphane Graber
9647df5464
Merge pull request #4115 from terceiro/rename-completion
...
bash: rename main bash completion file
2022-05-15 16:58:16 -04:00
Christian Brauner
2b5efbcbe9
Merge pull request #4117 from stgraber/master
...
More meson coverage
2022-05-13 00:13:59 +02:00
Stéphane Graber
d9121fff7b
meson: Add remaining scripts
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:24:04 +02:00
Stéphane Graber
51f90ad973
meson: Re-organize dir variables
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:24:03 +02:00
Stéphane Graber
e4e52844c7
meson: Add init helper scripts
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:24:02 +02:00
Stéphane Graber
c2931f74c5
meson: Add common configs
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:24:01 +02:00
Stéphane Graber
7c927048f1
meson: Add SELinux configs
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:23:59 +02:00
Stéphane Graber
9d18059b8d
meson: Add global config
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-12 22:23:58 +02:00
Antonio Terceiro
25d1b3fb09
bash: rename main bash completion file
...
Since the `lxc` binary is actually provided by lxd, the main
bash-completion file needs to be moved away to not conflict with a bash
completion file provided for the `lxc` binary by lxd.
Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2022-05-12 10:47:18 -03:00
Christian Brauner
053cb087b6
Merge pull request #4113 from stgraber/master
...
More meson tweaks
2022-05-08 00:06:52 +02:00
Stéphane Graber
b3da01d799
meson: Add doc examples
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-07 18:47:12 +02:00
Stéphane Graber
7609de1826
meson: Rework options
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-07 18:47:11 +02:00
Christian Brauner
5730c268f1
Merge pull request #4110 from stgraber/master
...
More meson fixes
2022-05-02 07:34:14 -07:00
Stéphane Graber
181cd6dc51
meson: Use dependencies for pkgconfig
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-02 14:40:42 +02:00
Stéphane Graber
d841229ea5
meson: Bump minimal version
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-02 14:22:25 +02:00
Stéphane Graber
18ad1086fa
meson: Simplify pc handling
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-02 14:22:24 +02:00
Christian Brauner
c62dd66bd6
Merge pull request #4109 from stgraber/master
...
More meson fixes
2022-05-01 06:20:55 -07:00
Stéphane Graber
4a858b5665
meson: Add bash completion
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 12:21:53 +02:00
Stéphane Graber
1404fcb81f
meson: Include the /var paths
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 12:05:08 +02:00
Stéphane Graber
6dfabed1fa
meson: Include rootfs dir
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 12:05:07 +02:00
Stéphane Graber
0860988ed9
meson: Setup pkgconfig
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 11:50:18 +02:00
Stéphane Graber
1a9afaccbf
meson: Include headers
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 11:50:17 +02:00
Stéphane Graber
31985a040d
meson: Fix hook install locations
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:35 +02:00
Stéphane Graber
4c7c1431d4
meson: Fix library version
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:34 +02:00
Stéphane Graber
0940e81168
meson: Add lxc-attach
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:33 +02:00
Stéphane Graber
2f1bf5f58b
meson: Fix internal binaries
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:32 +02:00
Stéphane Graber
46b9598f1a
meson: Fix template installation location
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:31 +02:00
Stéphane Graber
a15711569e
meson: Get test binaries to match autotools
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-05-01 10:24:30 +02:00
Christian Brauner
0c0f740fba
Merge pull request #4108 from stgraber/master
...
Meson improvements
2022-04-29 09:51:29 +02:00
Stéphane Graber
14746eee9d
Update MAINTAINERS file
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 23:12:30 -04:00
Stéphane Graber
23ba778f9f
meson: Fix unix epoch
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 22:54:41 -04:00
Stéphane Graber
aa326e18e9
meson: Update run_command calls
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 22:54:40 -04:00
Stéphane Graber
4738079024
meson: Install the test binaries
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 22:54:39 -04:00
Stéphane Graber
20b03401be
meson: Cleanup build configs
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 22:17:01 -04:00
Stéphane Graber
df05cddc83
meson: Remove non-existent tests
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-04-28 17:55:11 -04:00
Stéphane Graber
5a7b9ce677
Merge pull request #4101 from memnoth/fix-fail-exec-dnsmasq
...
lxc-net.in: fix failure executing dnsmasq
2022-04-02 20:33:25 -04:00
Leesoo Ahn
f97607e02c
lxc-net.in: fix failure executing dnsmasq
...
Failure executing dnsmasq happens if misc dir is not existed as the
following error messages.
localhost.localdomain systemd[1]: Starting LXC network bridge setup...
localhost.localdomain lxc-net[5754]: dnsmasq: cannot open or create lease file /usr/local/var/lib/misc/dnsmasq.lxcbr0.leases: No such file or directory
localhost.localdomain dnsmasq[5754]: cannot open or create lease file /usr/local/var/lib/misc/dnsmasq.lxcbr0.leases: No such file or directory
localhost.localdomain dnsmasq[5754]: FAILED to start up
localhost.localdomain lxc-net[5727]: Failed to setup lxc-net.
localhost.localdomain lxc-net[5727]: Failed to setup lxc-net.
localhost.localdomain systemd[1]: lxc-net.service: Main process exited, code=exited, status=1/FAILURE
localhost.localdomain systemd[1]: lxc-net.service: Failed with result 'exit-code'.
localhost.localdomain systemd[1]: Failed to start LXC network bridge setup.
Modify 'lxc-net' script to call 'mkdir -p' command if the directory is not
existed before executing dnsmasq daemon.
Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
2022-04-02 20:23:21 +09:00
Stéphane Graber
d09a31dba6
Merge pull request #4099 from corubba/feature/stop-order
...
tools: lxc-autostart: Reverse order on stop
2022-03-30 11:40:16 -04:00
corubba
8f8d14f72d
tools: lxc-autostart: Reverse order on stop
...
As it was already discussed in lxc/lxd#2082 , containers should be
stopped in the opposite order they are started in. LXD does so already,
lxc should do the same.
Signed-off-by: Corubba Smith <corubba@gmx.de>
2022-03-27 01:36:20 +01:00
Christian Brauner
4ad335d07a
Merge pull request #4098 from memnoth/mnth/fastpath-mkdir_p
...
utils: add fastpath routine on mkdir_p function
2022-03-26 17:40:02 +01:00
Leesoo Ahn
0a0911faee
utils: add fastpath routine on mkdir_p function
...
Call 'access' to examine whether 'dir' is already existed or not instead
of directly calling 'mkdir' on each dir name separated by slash '/' even though
'dir' is existed.
Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
2022-03-26 22:22:10 +09:00
Stéphane Graber
90a9b72667
Merge pull request #4096 from brauner/2022-03-22.meson
...
build: add more tests to meson
2022-03-23 12:57:19 -04:00
Christian Brauner
cf9e29f352
build: add more tests to meson
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-03-23 16:11:00 +01:00
Christian Brauner
44c22b8a95
tests: fix include statements
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-03-23 16:10:48 +01:00
Stéphane Graber
c8f5432d54
Merge pull request #4095 from brauner/2022-03-22.meson
...
build: add tests to meson
2022-03-22 09:40:44 -04:00
Christian Brauner (Microsoft)
2cf04d6695
build: add tests to meson
...
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2022-03-22 08:48:43 +01:00
Stéphane Graber
30ebf0964d
Merge pull request #4091 from JamiKettunen/non-modular-kernels
...
lxc-checkconfig: Only check probed modules if /proc/modules exists
2022-03-09 17:14:05 +01:00
Jami Kettunen
b7affe5264
lxc-checkconfig: Only check probed modules if /proc/modules exists
...
Kernels can be built with CONFIG_MODULES=n which results in
is_probed() telling the module isn't probed and lsmod spamming the
following to stderr each time it's called:
libkmod: kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory
Fix this by "stubbing" is_probed() when /proc/modules doesn't exist
as it's always called after a is_enabled() anyway.
Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
2022-03-08 12:37:08 +02:00
Stéphane Graber
2ff64429ec
Merge pull request #4090 from brauner/2022-02-22.fixes.4
...
cgroups: modify cgroup2 attach logic
2022-02-24 11:32:30 -05:00
Christian Brauner
2e67b0d47f
cgroups: modify cgroup2 attach logic
...
Recent kernels have seen various permission checking fixes when moving
processes into cgroups. So we're forced to modify how we attach to
containers.
Link: https://discuss.linuxcontainers.org/t/lxd-4-23-unable-to-start-nested-containers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-02-23 15:58:27 +01:00
Stéphane Graber
642052d58c
Merge pull request #4089 from brauner/2022-02-22.fixes
...
ttys: ensure container_ttys= env variable is set correctly
2022-02-22 10:52:37 -05:00
Christian Brauner
3b9f84fd23
ttys: ensure container_ttys= env variable is set correctly
...
Fixes : #4088
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-02-22 12:20:15 +01:00
Christian Brauner
96a30fe95b
Merge pull request #4087 from tenforward/japanese
...
doc: Fix reverse allowlist/denylist in Japanese man page
2022-02-21 14:32:10 +01:00
KATOH Yasufumi
302a87291c
doc: Fix reverse allowlist/denylist in Japanese man page
...
Update for commit 2965130c45
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2022-02-21 22:17:36 +09:00
Stéphane Graber
fd115a7359
Merge pull request #4085 from brauner/2022-02-20.cgroup.fixes
...
cgroups: fixes
2022-02-20 14:53:07 -05:00
Christian Brauner
f7abb27245
cgroups: log fd of newly created cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-02-20 15:52:10 +01:00
Christian Brauner
c090dbedbd
cgroups: check that opened file descriptor is a cgroup filesystem
...
Link: https://discuss.linuxcontainers.org/t/lxd-4-23-unable-to-start-nested-containers/13416
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-02-20 15:47:28 +01:00
Christian Brauner
cc07e2d6c0
Merge pull request #4078 from stgraber/master
...
lxc-checkconfig: Fix bashism
2022-02-03 07:08:40 +01:00
Stéphane Graber
2965130c45
doc: Fix reverse allowlist/denylist
...
Reported at: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1957934
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-02-02 21:28:58 -05:00
Stéphane Graber
903b1996b9
lxc-checkconfig: Fix bashism
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-02-02 21:11:09 -05:00
Stéphane Graber
73bc39ac8c
Merge pull request #4077 from terceiro/lxc-net-on-lxc
...
lxc-net: don't start by default inside lxc
2022-02-02 13:35:09 -05:00
Antonio Terceiro
b9dd36af0c
lxc-net: don't start by default inside lxc
...
When lxc is installed inside an lxc container, trying to bring up
lxc-net with the default parameters will conflict with the networking
setup for lxc on the host. This breaks all networking inside the
container where lxc is installed.
Signed-off-by: Antonio Terceiro <terceiro@debian.org>
2022-02-02 15:14:09 -03:00
Stéphane Graber
97592484fa
Merge pull request #4069 from brauner/2021-01-21.fixes
...
lxccontainer: allow xdev when creating the container dir
2022-01-21 07:47:07 -05:00
Christian Brauner
1238fee01b
lxccontainer: allow xdev when creating the container dir
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-21 09:44:01 +01:00
Christian Brauner
a368b91a90
Merge pull request #4065 from stgraber/master
...
github: Clear default ACL on /home
2022-01-20 18:06:53 +01:00
Stéphane Graber
4188864e22
github: Clear default ACL on /home
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-01-20 11:31:24 -05:00
Stéphane Graber
55d6e49efe
Merge pull request #4066 from brauner/2022-01-18.fixes.2
...
conf, lxccontainer, build: fixes
2022-01-20 08:43:50 -05:00
Christian Brauner
8c1c30368a
github: add systemd-coredump
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:58:58 +01:00
Christian Brauner
a434e4d4f3
github: more detailed compilation instructions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:58:58 +01:00
Christian Brauner
617efa73e1
github: log system info
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:58:58 +01:00
Christian Brauner
0fd92707a5
github: ensure system liblxc is wiped
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:59 +01:00
Christian Brauner
e53abc4196
lxccontainer: properly wrap lxcapi_create()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:59 +01:00
Christian Brauner
e27637b7b9
build: simplify thread local storage handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:59 +01:00
Christian Brauner
f7d3ef8380
build: only enable LTO for regular builds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:59 +01:00
Christian Brauner
c123aa042a
lxccontainer: simplify partial file creation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:59 +01:00
Christian Brauner
0e375b104b
lxccontainer: improve create_partial()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:58 +01:00
Christian Brauner
07ea844f4e
lxccontainer: improve do_lxcapi_create()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:58 +01:00
Christian Brauner
78ffe01108
lxccontainer: improve do_lxcapi_save_config()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:58 +01:00
Christian Brauner
e5af72a666
conf: log termination status
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:58 +01:00
Christian Brauner
e0f6f149d5
conf: improve userns_exec_mapped_root()
...
As we do in all other places, first drop groups, then use
setres{g,u}id().
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-20 12:12:58 +01:00
Stéphane Graber
73ff048d66
Merge pull request #4063 from simondeziel/gnupg
...
github: stop installing gnupg now that it's unused
2022-01-18 10:00:27 -05:00
Simon Deziel
aec7c9c2fa
github: stop installing gnupg now that it's unused
...
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2022-01-18 09:53:45 -05:00
Christian Brauner
8128bbef4d
Merge pull request #4062 from stgraber/master
...
lxc-download: Rely on HTTPS only
2022-01-18 15:24:41 +01:00
Stéphane Graber
5852026304
lxc-download: Rely on HTTPS only
...
GPG has been a major source of issues over the years with various
attacks on the key network as well as client side issues making it hard
to retrieve our keys.
Back when we introduced the image server, SSL certificates were still
expensive and annoying to setup, so not something we'd have expected
potential mirrors to setup for us. They were also issued for multiple
years, making a compromise of such a certificate quite problematic.
But things have changed since, we now have completely free, very easily
deployable SSL certificates everywhere with the majority of those being
shortlived and with good reporting of issued certificates.
With that, we can now deprecate the GPG validation, disable the fallback
to non-HTTPS download and rely on our indices being accurate because
they've been downloaded from a server with a valid certificate.
This puts LXC more in line with what LXD has done since the beginning
and should offer a more reliable user experience.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-01-17 21:15:53 -05:00
Stéphane Graber
0d27a21656
Merge pull request #4058 from brauner/2022-01-13.fixes
...
cgroups: improvements
2022-01-14 18:03:58 -05:00
Stéphane Graber
10a2878e0d
Merge pull request #4059 from DevinNorgarb/patch-1
...
Update README.md: Fix broken link (403 Forbidden)
2022-01-14 11:30:18 -05:00
Devin Norgarb
5e7448b57b
Update README.md: Fix broken link (403 Forbidden)
...
Signed-off-by: Devin Norgarb dnorgarb@gmail.com
2022-01-14 18:04:16 +02:00
Christian Brauner
d979b58c38
attach: don't pointlessly call cgroup_init()
...
We can let attach detect that it is running on a cgroup layout without
writable cgroup hierarchies. In that case attach can finish early and
doesn't need to run the heavy-handed cgroup parsing code.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-13 18:51:00 +01:00
Christian Brauner
575704fe80
commands: log command during file descriptor retrieval
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-13 17:42:17 +01:00
Stéphane Graber
e3d53aeaf2
Merge pull request #4057 from Dmole/patch-2
...
lxc-checkconfig.in: CONFIG_NF_NAT_IPV4
2022-01-12 15:36:53 -05:00
Tim
5017adb35a
lxc-checkconfig.in: CONFIG_NF_NAT_IPV4 was removed from the kernel 2019-03-03
...
Signed-off-by: Tim L <elatllat@gmail.com>
2022-01-12 09:55:25 -05:00
Stéphane Graber
544606ead3
Merge pull request #4054 from hallyn/2022-01-09/trivial
...
(trivial) Fix error message, failure was connect not bind
2022-01-09 23:16:17 +01:00
Serge Hallyn
8fd8c1586b
(trivial) Fix error message, failure was connect not bind
...
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2022-01-09 10:16:02 -06:00
Wolfgang Bumiller
02e1f71011
Merge pull request #4053 from brauner/2022-01-07.fixes
...
seccomp: close seccomp notifier fd in cleanup handler
2022-01-07 14:19:10 +01:00
Christian Brauner
24707291b8
seccomp: close seccomp notifier fd in cleanup handler
...
Reported-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-07 13:42:33 +01:00
Stéphane Graber
2ac414d567
Merge pull request #4047 from brauner/2021-12-10.fixes
...
seccomp: only guard seccomp notify behind HAVE_DECL_SECCOMP_NOTIFY_FD
2021-12-10 12:14:11 -05:00
Christian Brauner
331ef062be
seccomp: only guard seccomp notify behind HAVE_DECL_SECCOMP_NOTIFY_FD
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-12-10 17:05:11 +01:00
Stéphane Graber
2750663619
Merge pull request #4043 from brauner/2021-12-06.fixes
...
api-extensions: don't advertise seccomp notify support if it's not co…
2021-12-08 10:59:43 -05:00
Christian Brauner
3eacbe106b
api-extensions: don't advertise seccomp notify support if it's not compiled in
...
Link: https://discuss.linuxcontainers.org/t/runtimeerror-failed-to-read-zi-bytes-from-dev-urandom
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-12-08 10:41:59 +01:00
Christian Brauner
ce72172592
Merge pull request #4042 from Blub/2021-12-03/two-sysfs-instances-main
...
use 2 sysfs instances for sys:mixed
2021-12-03 15:46:29 +01:00
Wolfgang Bumiller
53b2f3d5da
use 2 sysfs instances for sys:mixed
...
In order to facilitate this, the default mount list's
'destination' may now be NULL to mean that the source should
be unmounted instead.
Here's what we need to do:
1) Ensure the first sysfs mount point is writable.
2) Mount a read-only sysfs on /sys
3) Bind devices/virtual/net *writably* into /sys
We use /proc/sys as a staging directory for the first sysfs
mount in read-write mode, then mount /sys r/o. Afterwards we
bind the r/w devices/virtual/net and unmount the staging
/proc/sys mount point.
The staging directory would not be required with the new
mount API, but this way we can support the old API and keep
the general workflow in the `default_mounts`.
Once we drop support for the old mount API, the
default_mounts table could just get a subdirectory field to
mount subdirectories directly.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-03 12:47:00 +01:00
Stéphane Graber
9873fb06d8
Revert "api: ->save_config() doesn't need to create container dir"
...
This reverts commit 2fde07c399
.
We need to investigate this in more detail but this commit is breaking
LXD, causing startup to fail with:
lxc foo 20211130202833.906 INFO conf - conf.c:run_script_argv:336 - Executing script "/bin/mount -t shiftfs -o passthrough=3 "/lxc-ci/build/tmp.WemmpzWGYz/go/src/github.com/lxc/lxd/test/tmp.Cli/0To/containers/foo/rootfs" "/lxc-ci/build/tmp.WemmpzWGYz/go/src/github.com/lxc/lxd/test/tmp.Cli/0To/containers/foo/rootfs"" for container "foo"
lxc foo 20211130202833.912 ERROR conf - conf.c:run_buffer:321 - Script exited with status 32
lxc foo 20211130202833.912 ERROR conf - conf.c:lxc_setup_rootfs_prepare_root:3947 - Failed to run pre-mount hooks
lxc foo 20211130202833.912 ERROR conf - conf.c:lxc_setup:4317 - Failed to setup rootfs
lxc foo 20211130202833.912 ERROR start - start.c:do_start:1275 - Failed to setup container "foo"
Not entirely sure why we're seeing things blow up as the directory
definitely exists (and contains a valid rootfs) but this was caused by
today's liblxc update.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-11-30 17:39:34 -05:00
Christian Brauner
030e1aaad5
Merge pull request #4039 from tych0/config-no-container-dir
...
api: ->save_config() doesn't need to create container dir
2021-11-29 17:26:06 +01:00
Christian Brauner
6a9cbecdaa
Merge pull request #4040 from tych0/fix-cgroup-warning
...
cgroups: fix compiler warning
2021-11-29 17:25:45 +01:00
Tycho Andersen
2fde07c399
api: ->save_config() doesn't need to create container dir
...
If we're saving the config file to somewhere that's *not* the container
dir, we don't need to create the container dir. Let's not do this and
thus not require its parent to exist, which can be confusing, especially in
light of the sparse logging through these functions.
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-11-29 08:55:31 -05:00
Tycho Andersen
2b113b55c7
cgroups: fix compiler warning
...
I get:
In file included from cgroups/cgfsng.c:42:
In function 'cpuset1_cpus_initialize',
inlined from 'cpuset1_initialize' at cgroups/cgfsng.c:658:7,
inlined from '__cgroup_tree_create.constprop' at cgroups/cgfsng.c:723:26:
./log.h:376:9: error: '%s' directive argument is null [-Werror=format-overflow=]
376 | LXC_ERROR(&locinfo, format, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./log.h:457:17: note: in expansion of macro 'ERROR'
457 | ERROR("%s - " format, ptr, ##__VA_ARGS__); \
| ^~~~~
./log.h:491:17: note: in expansion of macro 'SYSERROR'
491 | SYSERROR(format, ##__VA_ARGS__); \
| ^~~~~~~~
cgroups/cgfsng.c:585:24: note: in expansion of macro 'log_error_errno'
585 | return log_error_errno(false, errno, "Failed to read file \"%s\"", fpath);
| ^~~~~~~~~~~~~~~
it turns out here that fpath is not used, so let's get rid of it and just
render the dfd+pathname directly.
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-11-29 08:40:30 -05:00
Christian Brauner
7cf6f28ed8
Merge pull request #4035 from Blub/revert-vfork
...
Revert "initutils: use vfork() in lxc_container_init()"
2021-11-13 23:24:12 +01:00
Wolfgang Bumiller
84cf067565
Revert "initutils: use vfork() in lxc_container_init()"
...
This reverts commit d65e5e492f
.
With vfork the child process modifies the parent's memory,
so the calls to `signal`, `fprintf` and regular `exit` may
be dangerous and might cause conflicting states in the
parent.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-13 19:44:48 +01:00
Stéphane Graber
94e9dc283b
Merge pull request #4033 from brauner/2021-11-09.fixes
...
macro: ensure necessary io_uring flags are defined
2021-11-09 09:48:37 -05:00
Christian Brauner
54e21c7e90
macro: ensure necessary io_uring flags are defined
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-09 14:11:18 +01:00
Christian Brauner
d6bd3ab9ee
Merge pull request #4032 from joanbm/master
...
autotools: Avoid multiple liblxc.so with --enable-pam
2021-11-08 19:41:47 +01:00
Joan Bruguera
d19c1aa67d
autotools: Avoid multiple liblxc.so with --enable-pam
...
When installing LXC with the default options, a single non-symlink liblxc.so*
(e.g. liblxc.so.1.7.0) file is created:
```
$ ./autogen.sh && ./configure && make && \
rm -rf "$HOME/lxci" && make DESTDIR="$HOME/lxci" install && \
stat -c%N "$HOME/lxci/usr/local/lib/liblxc.so"*
[...]
'/home/someone/lxci/usr/local/lib/liblxc.so' -> 'liblxc.so.1'
'/home/someone/lxci/usr/local/lib/liblxc.so.1' -> 'liblxc.so.1.7.0'
'/home/someone/lxci/usr/local/lib/liblxc.so.1.7.0'
```
However, when automake>=1.16.5, and the `--enable-pam` option is used, two
non-symlink liblxc.so* (e.g. liblxc.so.1.0.0 and liblxc.so.1.7.0) are
erroneously created:
```
$ ./autogen.sh && ./configure --enable-pam && make && \
rm -rf "$HOME/lxci" && make DESTDIR="$HOME/lxci" install && \
stat -c%N "$HOME/lxci/usr/local/lib/liblxc.so"*
[...]
'/home/someone/lxci/usr/local/lib/liblxc.so' -> 'liblxc.so.1.0.0'
'/home/someone/lxci/usr/local/lib/liblxc.so.1' -> 'liblxc.so.1.0.0'
'/home/someone/lxci/usr/local/lib/liblxc.so.1.0.0'
'/home/someone/lxci/usr/local/lib/liblxc.so.1.7.0'
```
This is due to infighting between libtool's and LXC's versioning:
libtool creates liblxc.so.1.0.0, then LXC's `install-exec-local` hook in
`Makefile.am` moves it to liblxc.so.1.7.0. However, with `--enable-pam`, the
`install-libLTLIBRARIES` target is re-triggered after `install-pamLTLIBRARIES`,
which will create liblxc.so.1.0.0 again.
The bigger problem here is that the install for the pam_cgfs library is done on
the `data` phase of the automake install process instead of the `exec` phase
(https://www.gnu.org/software/automake/manual/html_node/The-Two-Parts-of-Install.html ),
which gives `install-libLTLIBRARIES` a chance to run again after the
`install-exec-local` / `install-exec-hook` targets have already run.
To fix this, we add an "exec_" prefix to the pam_cgfs library to make it run
during the `exec` phase (see link above). We also consolidate the various hooks
in the `install-exec-hook` target, which runs after the whole install, avoiding
needing to manually specify the dependencies like in `install-exec-local`.
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2021-11-07 17:40:35 +01:00
Stéphane Graber
2cac683cad
Merge pull request #4030 from brauner/2021-11-04.fixes
...
conf: lxc.proc.* and lxc.sysctl.* fixes and tests
2021-11-04 11:28:03 -04:00
Christian Brauner
5c9baf458d
build: refuse to compile with unsupported liburing version
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 15:48:54 +01:00
Christian Brauner
20acdbb8c2
tests: add lxc.proc.* test
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 15:17:02 +01:00
Christian Brauner
b8eb6ca709
tests: add lxc.sysctls.* test
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 15:17:02 +01:00
Christian Brauner
2c7c983bee
test: improve logging helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 14:08:56 +01:00
Christian Brauner
4e29ef3cf0
conf: improve logging setting sysctl and /proc/<pid>/ parameters
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 14:08:56 +01:00
Christian Brauner
1d81fffe86
conf: apply /proc/sys and /proc/<pid>/ parameters
...
When porting to the new list type we added an accidental ! when checking
whether the list is empty.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-04 11:26:43 +01:00
Stéphane Graber
b77a9f8353
Merge pull request #4028 from brauner/2021-11-02.fixes
...
start: fixes
2021-11-02 10:06:45 -04:00
Christian Brauner
e49c56d66e
tests: include config.h
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-02 11:14:59 +01:00
Christian Brauner
5bd35027d3
build: move _FILE_OFFSET_BITS to common option
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-02 11:14:58 +01:00
Christian Brauner
b0dec2ced0
start: log signal name and number
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-02 11:14:58 +01:00
Christian Brauner
ea0e384ff5
process_utils: add signal_name() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-02 10:58:35 +01:00
Stéphane Graber
399ee880ac
Merge pull request #4025 from brauner/2021-10-30.fixes
...
build: fixes
2021-11-01 10:33:51 -04:00
Christian Brauner
752b64325e
build: improve liburing support detection
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-30 17:54:39 +02:00
Christian Brauner
e29412c07f
mainloop: make ifdefs easier to follow
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-30 17:38:37 +02:00
Stéphane Graber
43b1b87972
Merge pull request #4024 from simondeziel/no-which
...
Replace remaining occurences of 'which' with 'command -v'
2021-10-28 17:49:37 -04:00
Simon Deziel
af0ab1854c
Replace last occurence of 'which' with 'command -v'
...
The later is builtin and POSIX compliant.
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2021-10-28 17:10:05 -04:00
Stéphane Graber
09a4a38d6e
Merge pull request #4021 from diederikdehaas/replace-which-in-tests-too
...
Replace 'which' with 'command -v' in tests too
2021-10-28 15:32:01 -04:00
Stéphane Graber
0344de5b47
Merge pull request #4023 from diederikdehaas/fix-SC2006
...
Replace backticks with $() construct
2021-10-28 15:31:53 -04:00
Diederik de Haas
ac46b35693
Replace deprecated backticks with $() construct
...
See https://github.com/koalaman/shellcheck/wiki/SC2006 for details.
Not only uses this the recommended construct, it also makes the code
more uniform as in many other places the $() construct was already used.
Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
2021-10-28 20:15:29 +02:00
Stéphane Graber
7f71fbfd76
Merge pull request #4020 from brauner/2021-10-28.fixes
...
build & mainloop: fixes
2021-10-28 14:01:46 -04:00
Stéphane Graber
6e8843d148
Merge pull request #4018 from brauner/2021-10-28.fixes.2
...
confile: don't use path_simplify() on lxc.{execute,init}.cmd
2021-10-28 13:07:49 -04:00
Diederik de Haas
4c69af0c37
Replace 'which' with 'command -v' in tests too
...
Forgot to modify and include the tests in previous PR, so do that now.
Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
2021-10-28 18:25:37 +02:00
Christian Brauner
4449c5b25c
Merge pull request #4019 from diederikdehaas/replace-which-with-command-v
...
Replace 'which' with 'command -v'
2021-10-28 18:06:17 +02:00
Christian Brauner
a585382b97
start: check event loop type before closing fd
...
Since this is a union we might otherwise stomp on io_uring mmap()ed
memory.
Fixes : #4016
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-28 17:39:42 +02:00
Christian Brauner
aac3f106ff
mainloop: make sure that descr->ring is allocated
...
This is future proofing more than anything else.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-28 17:39:11 +02:00
Diederik de Haas
7a7671655a
Replace 'which' with 'command -v'
...
The 'which' command is deprecated on Debian Sid as it is not POSIX
compliant and it's behavior is therefor not consistent, so replace it
with 'command -v' which is POSIX compliant.
See https://stackoverflow.com/a/677212 for details.
Also replaced a use of backticks (`) as that is deprecated as well.
See https://github.com/koalaman/shellcheck/wiki/SC2006 for details.
Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
2021-10-28 17:27:08 +02:00
Christian Brauner
747bc634c5
build: add io-uring-event-loop option
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-28 17:07:27 +02:00
Christian Brauner
860ab93303
build: add static libcap to output
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-28 17:07:14 +02:00
Christian Brauner
51d40b684c
confile: don't use path_simplify() on lxc.{execute,init}.cmd
...
Fixes : #4015
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-28 16:53:14 +02:00
Christian Brauner
8dff29c6c7
Merge pull request #4013 from stgraber/master
...
AUTHORS: Update to point to git history
2021-10-25 15:11:06 +02:00
Stéphane Graber
5d8c30856e
AUTHORS: Update to point to git history
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-10-25 08:53:58 -04:00
Stéphane Graber
16210a56b6
Merge pull request #4010 from brauner/2021-10-23.fixes
...
conf: handle kernels without or not using SMT
2021-10-24 01:41:36 -04:00
Christian Brauner
f3d90fca4a
conf: handle kernels without or not using SMT
...
On kernel not enabling or not using SMT core scheduling will return with
ENODEV. Handle such kernels.
Link: https://github.com/lxc/lxd/issues/9419
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-23 19:23:06 +02:00
Christian Brauner
d6818a3459
Merge pull request #4008 from tenforward/japanese
...
doc: Update Japanese lxc.container.conf(5) and common options
2021-10-23 10:29:06 +02:00
KATOH Yasufumi
9fe946bcc6
doc: fix typo in English lxc.container.conf(5)
...
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-10-23 15:26:26 +09:00
KATOH Yasufumi
9093e17958
doc: Add lxc.sched.core to Japanese lxc.container.conf(5)
...
Update for commit 09996a4
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-10-23 15:18:00 +09:00
KATOH Yasufumi
cc6a34b9da
doc: add way to specify broadcast address to Japanese lxc.container.conf(5)
...
Update for commit 5686798
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-10-23 14:53:58 +09:00
KATOH Yasufumi
4ced441ef9
doc: add loglevels to ja and ko common options
...
Update for commit 44b87e8
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-10-23 14:45:13 +09:00
Christian Brauner
41687b4d08
Merge pull request #4006 from coledishington/master
...
Make number of rx and tx queues configurable for veths
2021-10-22 19:30:05 +02:00
Cole Dishington
be538b8b27
Make number of rx and tx queues configurable for veths
...
Distribute traffic over cpu cores of container by configuring more
than 1 tx/rx queue.
Signed-off-by: Cole Dishington <Cole.Dishington@alliedtelesis.co.nz>
2021-10-22 15:23:38 +13:00
Stéphane Graber
0cbc89cef7
Merge pull request #4005 from brauner/2021-10-21.fixes
...
conf: allow users to specify that they want a cgroup2 layout on a hybrid host
2021-10-21 10:59:19 -04:00
Christian Brauner
d90d30072c
conf: add cgroup2, cgroup2:ro, cgroup2:force, cgroup2:ro:force options
...
We keep running into situations where we want to pre-mount a pure
cgroup2 layout regardless of the layout of the host.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-21 16:40:16 +02:00
Christian Brauner
62054cf35e
conf: make it more obvious how auto-mount flags are defined
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-21 15:52:15 +02:00
Stéphane Graber
94e0a5292f
Merge pull request #4004 from brauner/2021-10-20.fixes.2
...
criu: support restoring containers with pre-created veth devices
2021-10-20 09:51:49 -04:00
Christian Brauner
0109a13d53
criu: support restoring containers with pre-created veth devices
...
We did th CRIU and kernel work but for some reason we never did push the
LXC work.
Link: cdb0d42702
commit cdb0d427020f ("net: allow restoring of precreated veth devices")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-20 14:52:18 +02:00
Stéphane Graber
2db3d91eea
Merge pull request #4003 from brauner/2021-10-19.fixes
...
conf: verify that rootfs is stable after setting up mounts
2021-10-19 11:24:26 -04:00
Christian Brauner
4f2af104b8
conf: verify that rootfs is stable after setting up mounts
...
Apparently some users changed their rootfs via their lxc.mount.entry
entries. Let's not allow that as that can cause confusion during
container setup. So lets verify that the rootfs is stable after setup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-19 16:59:41 +02:00
Stéphane Graber
7af27b3290
Merge pull request #4002 from xypron/riscv64
...
Riscv64
2021-10-19 10:58:23 -04:00
Heinrich Schuchardt
0a2ffe123c
README.md: mention RISC-V architecture
...
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-19 13:21:51 +02:00
Heinrich Schuchardt
07459c88d5
Add riscv64 to --arch parameter values
...
lxc-attach uses an --arch parameter. 'riscv64' should be a usable value.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-10-19 13:18:02 +02:00
Stéphane Graber
81738fe0fc
Merge pull request #4000 from brauner/2021-10-18.fixes
...
conf: fixes
2021-10-18 10:01:24 -04:00
Christian Brauner
5c6eb4169a
conf: don't fail umount2()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-18 12:07:37 +02:00
Christian Brauner
65d832931b
conf: fix coding style
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-18 11:46:16 +02:00
Stéphane Graber
27d9212bf8
Merge pull request #3997 from brauner/2021-10-15.fixes
...
log: fixes
2021-10-15 09:19:47 -04:00
Christian Brauner
a031a4e14f
caps: ensure \0-termination
...
Fixes: Coverity 1492865
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-15 11:29:27 +02:00
Christian Brauner
bf2af3e72a
attach: improve error logging
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-15 10:06:48 +02:00
Christian Brauner
d8487b3081
af_unix: replace log_error_errno()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-15 09:59:28 +02:00
Stéphane Graber
1c39a913df
Merge pull request #3996 from tych0/fix-criu-log
...
criu: fix error message
2021-10-14 13:02:36 -04:00
Tycho Andersen
bdb8aeda72
criu: fix error message
...
as of 59d8a539d1
("criu: massage exec_criu()") I see:
In file included from criu.c:22:
criu.c: In function 'exec_criu':
log.h:376:2: error: '%s' directive argument is null [-Werror=format-overflow=]
376 | LXC_ERROR(&locinfo, format, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
log.h:457:3: note: in expansion of macro 'ERROR'
457 | ERROR("%s - " format, ptr, ##__VA_ARGS__); \
| ^~~~~
log.h:491:3: note: in expansion of macro 'SYSERROR'
491 | SYSERROR(format, ##__VA_ARGS__); \
| ^~~~~~~~
criu.c:325:11: note: in expansion of macro 'log_error_errno'
325 | return log_error_errno(-ENOMEM, ENOMEM, "Failed to remove extraneous slashes from \"%s\"", tmp);
| ^~~~~~~~~~~~~~~
it looks like we should be logging the string that failed, vs. tmp here.
(my log was taken from stable-4.0, but the same issue exists on master it
seems.)
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-10-14 10:41:36 -06:00
Stéphane Graber
b2668c872f
Merge pull request #3995 from brauner/2021-10-13.fixes
...
tree-wide: capability tests and fixes
2021-10-14 10:38:18 -04:00
Christian Brauner
8a0de7e7cc
test: fix nested capability tests
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 14:03:49 +02:00
Christian Brauner
401b1364b3
attach: improve error logging for drop_capabilities()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 13:26:15 +02:00
Christian Brauner
09f2a3ef8a
tests: expand capability tests
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 11:17:15 +02:00
Christian Brauner
7418b27f12
tree-wide: use __u32 for capabilities
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 11:04:06 +02:00
Christian Brauner
c5e7fbcadb
cgroups: use __u32 for cpumasks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-13 18:30:00 +02:00
Stéphane Graber
f64fa52667
Merge pull request #3994 from brauner/2021-10-12.fixes
...
conf: improve and fix lxc.cap.keep
2021-10-13 09:25:59 -04:00
Christian Brauner
623f47b00c
conf: improve capability handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-13 13:38:14 +02:00
Christian Brauner
634b43e1f2
tests: add test for lxc.cap.keep
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-13 13:08:01 +02:00
Christian Brauner
cafcd2a751
conf: fix lxc.cap.keep behavior
...
Fixes: ##3993
Fixes: 20ab75789e
("conf: simplify and port caps to new list type")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-12 16:33:14 +02:00
Stéphane Graber
8305ff8ab0
Merge pull request #3992 from brauner/2021-10-11.fixes
...
terminal: log at warning message
2021-10-11 10:30:46 -04:00
Christian Brauner
0cf017f071
terminal: log at warning message
...
The lxc_devpts_terminal() helper is called in contexts where it can fail
due to various reasons but where we safely fallback to allocating
terminal devices on the host. Logging error messages irritates users so
just log warning messages.
Link: https://discuss.linuxcontainers.org/t/lxc-attach-error-failed-to-open-terminal-multiplexer-device
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-11 15:22:52 +02:00
Stéphane Graber
15f29e6fb7
Merge pull request #3988 from brauner/2021-10-04.fixes
...
log: improve %m handling on musl
2021-10-04 09:14:18 -04:00
Christian Brauner
316b8d0589
log: improve %m handling on musl
...
Fixes : #3961
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-04 11:24:19 +02:00
Stéphane Graber
d63b84d89b
Merge pull request #3987 from brauner/2021-10-01.fixes
...
start: make failure to apply core scheduling fatal
2021-10-01 10:33:23 -04:00
Christian Brauner
ffd98e8c2e
start: make failure to apply core scheduling fatal
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-01 15:35:03 +02:00
Stéphane Graber
b8b2e1f331
Merge pull request #3986 from brauner/2021-10-01.fixes
...
lxc: core scheduling tweaks
2021-10-01 08:52:01 -04:00
Christian Brauner
f18a595926
start: use core scheduling error helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-01 10:14:08 +02:00
Christian Brauner
565b6e92d3
start: don't fail when core scheduling isn't supported
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-01 10:12:43 +02:00
Christian Brauner
47bfecf510
syscall_wrappers: fix core scheduling creation helper naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-01 10:12:17 +02:00
Stéphane Graber
15e9cc882f
Merge pull request #3985 from brauner/2021-09-30.fixes.2
...
tree-wide: cast to core scheduling cookie to llu
2021-09-30 17:17:07 -04:00
Christian Brauner
2e9aa14628
tree-wide: cast to core scheduling cookie to llu
...
Link: https://launchpadlibrarian.net/561086365/buildlog_ubuntu-focal-ppc64el.lxc_1%3A4.0.10+master~20210930-1812-0ubuntu1~focal_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-30 22:48:29 +02:00
Stéphane Graber
187560436a
Merge pull request #3984 from brauner/2021-09-29.core_scheduling
...
lxc: core scheduling support
2021-09-30 13:56:25 -04:00
Christian Brauner
c958a332d2
attach: handle core scheduling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-30 17:43:22 +02:00
Stéphane Graber
177f5c95dc
Merge pull request #3983 from brauner/2021-09-29.fixes
...
build: compiler attribute improvements
2021-09-29 12:45:09 -04:00
Christian Brauner
09996a4821
lxc: add lxc.sched.core
...
Core scheduling defines if the container payload is marked as being
schedulable on the same core. Doing so will cause the kernel scheduler
to ensure that tasks that are not in the same group never run
simultaneously on a core. This can serve as an extra security measure to
prevent the container payload from using cross hyper thread attacks.
The only allowed values are 0 and 1. Set this to 1 to create a core
scheduling domain for the container or 0 to not create one. If not set
explicitly no core scheduling domain will be created for the container.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-29 14:07:41 +02:00
Christian Brauner
b371ad51bb
initutils: add missing prctl include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-29 13:16:05 +02:00
Christian Brauner
ae13cb3b1b
build: compiler attribute improvements
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-29 10:17:33 +02:00
Christian Brauner
6187bcb810
Merge pull request #3982 from stgraber/master
...
github: Drop 16.04 tests
2021-09-28 23:09:44 +02:00
Stéphane Graber
b502fdabad
Merge pull request #3981 from brauner/2021-09-28.fixes
...
build: check whether compiler supports nonnull and returns_nonnull at…
2021-09-28 16:58:59 -04:00
Stéphane Graber
afef261bdf
github: Drop 16.04 tests
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-09-28 16:58:44 -04:00
Christian Brauner
5c26176d58
build: check whether compiler supports nonnull and returns_nonnull attributes
...
Fixes : #3980
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-28 11:49:26 +02:00
Stéphane Graber
553b7a0332
Merge pull request #3979 from brauner/2021-09-27.fixes
...
build: add commands, hooks, and templates
2021-09-27 09:39:39 -04:00
Christian Brauner
7af71c9416
hooks: fix quoting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:51:18 +02:00
Christian Brauner
3cc0ec841e
templates: don't double quote
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:42:22 +02:00
Christian Brauner
7172b98c77
build: add templates
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:39:10 +02:00
Christian Brauner
c597905e2f
build: fix remaining HAVE_* generations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:22:12 +02:00
Christian Brauner
34498deaa3
tree-wide: fix HAVE_* checks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:19:23 +02:00
Christian Brauner
afdad1798e
cmds: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:09:17 +02:00
Christian Brauner
98775a4cc9
cmds: fix integer conversions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:07:51 +02:00
Christian Brauner
69f5d68a5c
lxc-monitord: use {} around ;
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:03:20 +02:00
Christian Brauner
72f1c44ab2
build: add cmd builds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 12:03:04 +02:00
Christian Brauner
659611a36d
build: add hooks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 11:39:52 +02:00
Christian Brauner
75e9b2e604
build: build hooks directly in their folder
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-27 10:48:29 +02:00
Stéphane Graber
498ef0b7a1
Merge pull request #3978 from brauner/2021-09-23.fixes
...
build: improve meson build
2021-09-23 17:14:05 -04:00
Christian Brauner
db4af8c57e
build: improve meson build
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-23 14:05:24 +02:00
Stéphane Graber
ad447e353d
Merge pull request #3977 from brauner/2021-09-16.fixes
...
build: fixes
2021-09-16 10:45:44 -04:00
Christian Brauner
8d9420ff8a
build: use dummy config data
...
to avoid having to rely on newer meson features.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 16:04:33 +02:00
Christian Brauner
66d7d50394
build: expand default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 15:59:49 +02:00
Christian Brauner
d0a16061ae
build: add commands
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 15:56:56 +02:00
Christian Brauner
ce88b6df3a
build: split netns_ifaddrs into separate sources
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 15:56:53 +02:00
Christian Brauner
bfcece94b6
hooks: use cloexec everywhere
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 14:45:39 +02:00
Christian Brauner
0ca597fba9
build: fix tools build
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 14:45:39 +02:00
Christian Brauner
26a6b71917
build: fix hook program build
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-16 14:45:36 +02:00
Stéphane Graber
df5dc54910
Merge pull request #3976 from stgraber/master
...
Don't include internal headers in external library headers
2021-09-15 23:43:52 -04:00
Stéphane Graber
38386b4794
Don't include internal headers in external library headers
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-09-15 23:05:47 -04:00
Stéphane Graber
4eff7bcdeb
Merge pull request #3974 from brauner/2021-09-15.fixes.2
...
tools: use correct include for Android
2021-09-15 15:15:41 -04:00
Christian Brauner
402f6adb5c
tools: use correct include for Android
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 20:26:11 +02:00
Stéphane Graber
cf5599324d
Merge pull request #3972 from brauner/2021-09-15.fixes
...
build: ensure all relevant calls are checked for availability at buil…
2021-09-15 10:15:53 -04:00
Christian Brauner
25dff4d158
build: support lto
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:42:04 +02:00
Christian Brauner
a9502f5dc9
cgroups: fix declarations and headers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:28:50 +02:00
Christian Brauner
df0834edba
network: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 10:12:41 +02:00
Christian Brauner
7a7f9a1453
build: ensure all relevant calls are checked for availability at build time
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-15 09:08:15 +02:00
Stéphane Graber
e758399067
Merge pull request #3966 from denisfa/improve-bash-completion-ext
...
Improve bash completion - part 2.
2021-09-14 23:33:57 -04:00
Stéphane Graber
9985804066
Merge pull request #3963 from brauner/2021-09-03.build
...
build: add basic meson support
2021-09-14 22:41:55 -04:00
Christian Brauner
ea6da2577b
build: show more detailed information
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 11:01:59 +02:00
Christian Brauner
e282c460af
build: record meson version
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:34:05 +02:00
Christian Brauner
589e116754
build: use correct minimal meson version requirement
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:23:37 +02:00
Christian Brauner
ec5d2163f3
build: remove pointless prefixdir validation
...
Meson will handle this internall and treat a non-absolute path as an
error.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-14 10:03:12 +02:00
Stéphane Graber
efbe49c674
Merge pull request #3968 from brauner/2021-09-03.fixes.2
...
tests: fix config file tests
2021-09-13 08:41:41 -04:00
Stéphane Graber
332a0a8f47
Merge pull request #3967 from brauner/2021-09-03.fixes
...
log: fix cross-compilation with %m modifier
2021-09-13 08:37:25 -04:00
Christian Brauner
b967f9e8d5
tests: fix config file tests
...
Link: https://bugs.launchpad.net/bugs/1943441
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 13:59:42 +02:00
Christian Brauner
8a046c4c56
log: fix cross-compilation with %m modifier
...
Fixes : #3961
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 12:30:52 +02:00
Christian Brauner
bf1f3470fd
build: set more variables and print summary
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 11:21:23 +02:00
Christian Brauner
dcfe4e135d
build: add more global config variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 11:03:34 +02:00
Christian Brauner
455dae78dc
build: set diagnostic colours directly in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:15:01 +02:00
Christian Brauner
1531f8d53d
build: add single option directly to static library
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:14:45 +02:00
Christian Brauner
4ad3a929d9
build: remove unneeded variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:09:45 +02:00
Christian Brauner
c6ea1dec85
build: use common dependencies variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:05:48 +02:00
Christian Brauner
e8ef4deae0
build: libdir and bindir are the default for shared libraries and executables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 10:01:46 +02:00
Christian Brauner
4ce4aac494
build: set find_library('libcap', require : false)
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:58:44 +02:00
Christian Brauner
305490ba8e
build: -fPIC and -shared are handled automatically
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:57:53 +02:00
Christian Brauner
e4384f1cbb
build: use dependency() where possible
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:54:17 +02:00
Christian Brauner
5e0a302b1e
build: set as-needed in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:44:32 +02:00
Christian Brauner
98f3b52712
build: set pie in default_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-13 09:43:29 +02:00
Edênis Freindorfer Azevedo
d9be2feb09
Fix lxc-cgroup
smart completion.
...
Also make bash function more readable for itself.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-08 10:40:49 -03:00
Edênis Freindorfer Azevedo
b3dcb19407
Refactor __lxc_check_name_present()
.
...
Print name of container found, if any.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
c227466673
Check completion for prefixes names.
...
If a name is a prefix of another word available for completion, adjust
to show all words with given prefix.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
83ca245532
Add __lxc_cgroup_state_object()
.
...
Support cgroup state-object completion values for `lxc-cgroup`.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
d36b3a3a9a
Update _lxc_usernsexec
.
...
Not really much can be done for this function, as `-m` requires an ID
mapping that has to be manually input, since it will use
`/etc/sub{g,u}id` if not specified.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
2b86aa4c23
Add completion for lxc-copy
param --fssize
.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
a33d86d20b
Add __lxc_get_selinux_contexts()
.
...
List SElinux contexts available. Not clear if this could be only for
root or if normal user with `sudo` is also supported.
Using `Fedora34` for basic testing.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
4cd0915e76
Refactor __lxc_groups()
to __lxc_get_groups()
.
...
Make code logic be more clear to what it is being done.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:24:06 -03:00
Edênis Freindorfer Azevedo
f73bcca529
Another round of more bash-like syntax.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
b73b4ec7fb
Fix lxc-create
completion.
...
Do not append a name of an existing container.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
d72a39a528
Add support for comma as a completion word.
...
For `lxc-ls --groups` and `lxc-autostart --groups`.
Support leading comma, trailing comma, embedded double comma.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
66e8c08985
Refactor __lxc_piped_args
.
...
Use bash functions for common array operations. Keep code logic somewhat
easy to read for bug hunting.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
53431db944
Fix lxc-snapshot
completion.
...
For options `-r,--restore` and `-d,--destroy`, we need the container
name to create the list of completion values.
Therefore, it is needed to scan the current command line to check if
there is a container name available.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:57 -03:00
Edênis Freindorfer Azevedo
8617586740
Use more bash-like syntax.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-07 22:23:46 -03:00
Edênis Freindorfer Azevedo
6139460643
Add support for container composed names.
...
When a container name has whitespace in it
(e.g. created by `lxc-create -t download -n "arch linux"` ),
the completion for other commands should be able to work by adding a
backslash to escape it.
Although it may be interesting to support names between quotes, this
would probably means to have to add quotes to all names. Might not be
interesting just due to an edge case.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
8e4c68e67a
Add completion output for lxc-ls --fancy-format
.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
8aa4490505
Improve name completion handling.
...
Use regex to handle short option `-n`, since short options can be
combined (e.g. `-nd`) as long as at max one requires an argument.
Also consider the case when the arg for the long option is not given
together with `--name=`.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
db8b9df555
Add compopt
call to __lxc_piped_args
.
...
On pair with how other functions do it. Also, be smarter about adding
whitespace when there are no more completions available for the
parameter.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
2173e808ca
Use --running
instead of --active
.
...
Commands block if container is frozen.
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Edênis Freindorfer Azevedo
4246469f8b
Fill missing commands on name completion.
...
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2021-09-06 17:00:32 -03:00
Christian Brauner
297e5f9693
build: add tools to meson
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:09 +02:00
Christian Brauner
9b9d56e6e8
build: add meson skeleton
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:09 +02:00
Christian Brauner
784839ae18
build: make sure _GNU_SOURCE is set
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:08 +02:00
Christian Brauner
914f275f2e
lxc: remove "version.h" inclusion
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 19:06:08 +02:00
Christian Brauner
f7edcf9439
tests: include "version.h"
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 18:04:56 +02:00
Christian Brauner
1160ce891d
tree-wide: fix config.h inclusion
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:53:38 +02:00
Christian Brauner
09618fb8ab
tools: fix build warnings
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:30:16 +02:00
Christian Brauner
12ae2a33c6
tree-wide: fix lxc header inclusion
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:16 +02:00
Christian Brauner
924c626a94
caps: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
f614b9f43d
tools/lxc_start: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
5de879e6a5
arguments: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
ab908541fa
initutils: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
30cf580be5
log: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
443dd10a08
initutils: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
481f03ef25
conf: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
b4e5e90b8b
string_utils: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:15 +02:00
Christian Brauner
b53f80d4de
arguments: fix includes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 17:28:12 +02:00
Christian Brauner
60a8b99b89
commands_utils: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
5e0e7af42a
file_utils: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
d535a483c9
monitor: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
b608dc2f93
nl: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
59366a6156
uuid: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
14551c8c82
seccomp: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
360df02a57
lxcmntent: fix fallthrough
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
49bdee73fc
netns_ifaddrs: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
a15c360949
start: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:43 +02:00
Christian Brauner
8f76aa9766
utils: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
8703bf5bdb
terminal: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
652a1f4ba5
lxccontainer: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
9a06467860
network: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
cdb4f412ff
tree-wide: fix public lxc header inclusions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
fd80f8c0fd
commands: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
402770b630
criu: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
6c7c4a01ab
confile_utils: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:42 +02:00
Christian Brauner
5eac34d508
tree-wide: fix attach header inclusion
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:41 +02:00
Christian Brauner
622d344d17
conf: fix array initalization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:41 +02:00
Christian Brauner
1e03cbb1a7
conf: fix struct mount_attr initalization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:41 +02:00
Christian Brauner
a5e92f5dff
string_utils: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:41 +02:00
Christian Brauner
02d477ccc6
conf: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:01 +02:00
Christian Brauner
961878dac1
lsm: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:01 +02:00
Christian Brauner
7e5a9e11e4
attach: fix helper declarations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:01 +02:00
Christian Brauner
2048ac1a8e
storage: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:01:01 +02:00
Christian Brauner
15b9e2b099
confile: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 13:00:58 +02:00
Christian Brauner
45ef2e0c69
cgroups: fix integer comparisons
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 09:47:34 +02:00
Christian Brauner
4ee86fdad6
syscall_wrapper: fix pivot_root() declaration
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 09:47:34 +02:00
Christian Brauner
58db1a61c8
build: add src/include to build and simplify header inclusions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-03 09:25:56 +02:00
Stéphane Graber
074c356087
Merge pull request #3962 from brauner/2021-09-02.fixes
...
tree-wide: build fixes
2021-09-02 13:57:28 -04:00
Christian Brauner
646b75b515
tree-wide: fix build
...
Fixes : #3960
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-02 19:10:07 +02:00
Christian Brauner
2d7f5dcd9a
include: make all functions __hidden
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-02 15:57:05 +02:00
Stéphane Graber
9265ae82df
Merge pull request #3959 from brauner/2021-09-01.fixes
...
configure: add sanitizer flags to LDFLAGS as well
2021-09-01 11:57:58 -04:00
Christian Brauner
37acd20e44
configure: add sanitizer flags to LDFLAGS as well
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-09-01 09:46:58 +02:00
Stéphane Graber
4d23944a90
Merge pull request #3957 from brauner/2021-08-27.list.2
...
conf: port more types to new list type
2021-08-30 16:44:37 -04:00
Christian Brauner
75910e0755
lxccontainer: don't pass NULL pointer
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 18:05:29 +02:00
Christian Brauner
4a0d9c9972
lxccontainer: fail when container can't be loaded
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 17:55:09 +02:00
Christian Brauner
89ad5d7bf0
lxccontainer: remove useless {}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 15:21:53 +02:00
Christian Brauner
b7e1e6febb
lxccontainer: use free_disarm() in list_all_containers()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 15:19:25 +02:00
Christian Brauner
922c335290
lxc-usernsexec: small tweaks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 14:44:37 +02:00
Christian Brauner
d696c45e73
tree-wide: fix list_entry()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-30 14:44:37 +02:00
Christian Brauner
7044717861
Merge pull request #3954 from blenk92/fix-attach-c2
...
attach: Fix -c option v2 :-D
2021-08-30 14:19:30 +02:00
Maximilian Blenk
9becf309a8
attach: Fix -c command
...
Currently, the -c command (to set the selinux context) seems to be
broken because the passed context is ignored and always overwritten by
the context specified in the config file. The intention behind the -c
imho was to be able to manually overwrite this behavior. This patch
ensures that the selinux context will be set if passed via the command
line.
Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
2021-08-30 13:06:35 +02:00
Christian Brauner
1f7dd3d5a0
lxccontainer: tweak some array handling helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 16:45:37 +02:00
Christian Brauner
d993287e4f
lxccontainer: improve add_to_clist()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 16:00:45 +02:00
Christian Brauner
587fc64e6e
lxccontainer: improve add_to_array()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 15:59:39 +02:00
Christian Brauner
ffb2a35f0b
conf: port groups to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 15:44:04 +02:00
Christian Brauner
5090de3e62
conf: port hooks to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 15:06:08 +02:00
Christian Brauner
1fb1e6676f
conf: port apparmor to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 14:52:18 +02:00
Stéphane Graber
6446bf47d3
Merge pull request #3956 from brauner/2021-08-27.list
...
conf: port more types to new list type
2021-08-27 08:45:14 -04:00
Christian Brauner
be0bc4d1cf
conf: port mounts to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 13:08:09 +02:00
Christian Brauner
82134f19ce
cgroups: fix bpf device list
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 11:15:19 +02:00
Christian Brauner
6bf0c06bdd
network: port ipv6 routes to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 10:37:51 +02:00
Christian Brauner
303707f67b
network: port ipv4 routes to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 10:30:55 +02:00
Christian Brauner
bca286f2d7
cgroups: fix cgroup settings sorting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-27 10:17:01 +02:00
Stéphane Graber
8ab50a9bfc
Merge pull request #3955 from brauner/2021-08-26.list.2
...
conf: port more types to new list type
2021-08-26 16:28:58 -04:00
Christian Brauner
7946305703
lxccontainer: align initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 21:46:58 +02:00
Christian Brauner
05a54a64de
tree-wide: s/ipv{4,6}_list/ipv{4,6}_addresses/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 21:39:38 +02:00
Christian Brauner
cd32fc7300
network: port ipv6 addresses to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 21:37:35 +02:00
Stéphane Graber
e356020443
Merge pull request #3953 from brauner/2021-08-26.list
...
conf: port more types to new list type
2021-08-26 13:19:31 -04:00
Christian Brauner
2ec31bbde7
network: port ipv4 to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 18:21:54 +02:00
Stéphane Graber
19202d882b
Merge pull request #3952 from brauner/2021-08-25.list.2
...
conf: port more types to new list type
2021-08-26 10:53:06 -04:00
Christian Brauner
20ab75789e
conf: simplify and port caps to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 15:25:28 +02:00
Christian Brauner
badf09ec16
cgroup: remove unneeded forward declaration
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 14:19:53 +02:00
Christian Brauner
9ab399dfcf
terminal: remove unused struct member
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 14:19:14 +02:00
Christian Brauner
c294a68d13
conf: port environment to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 14:16:53 +02:00
Christian Brauner
0ef1dbb17b
conf: remove unused variables
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 13:38:07 +02:00
Christian Brauner
2ff1170b42
conf: switch to parse_mount_attrs() even for legacy mount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 11:11:08 +02:00
Christian Brauner
6b48a57529
conf: support recursive propagation options properly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 11:06:52 +02:00
Christian Brauner
3eb2323041
conf: rework recursive mount option handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 10:47:47 +02:00
Christian Brauner
e73af35bba
rootfs: remove "options" member
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 10:27:38 +02:00
Christian Brauner
091f611c7c
conf: remove unused mountflags nember
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 10:17:21 +02:00
Christian Brauner
0589d744f6
conf: port id_map to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 09:47:47 +02:00
Christian Brauner
c9dbb8edf9
conf: port cgroup settings to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 09:47:47 +02:00
Christian Brauner
91d04bf9db
conf: port procs to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-26 09:47:39 +02:00
Christian Brauner
ba9f93472d
conf: port sysctls to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 18:49:49 +02:00
Christian Brauner
223797c313
conf: port rlimits to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 18:38:06 +02:00
Stéphane Graber
610c93b735
Merge pull request #3950 from brauner/2021-08-25.list
...
tree-wide: introduce new list type and port network handling to it
2021-08-25 12:29:14 -04:00
Christian Brauner
d2e75eba7e
conf: port state_clients to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 15:30:01 +02:00
Christian Brauner
2345ad43f0
mainloop: port handlers to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 15:19:25 +02:00
Christian Brauner
93de768ea3
cgroups: port bpf devices to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 14:28:06 +02:00
Christian Brauner
87d0990c1a
tree-wide: port network handling to new list type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 13:25:03 +02:00
Christian Brauner
4780b5e7f4
list: add new kernel-based list implementation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-25 13:24:51 +02:00
Stéphane Graber
e91d7f22f1
Merge pull request #3949 from brauner/2021-08-24.attach
...
tools: lxc-attach fixes
2021-08-24 23:56:17 -04:00
Stéphane Graber
fc1625fb23
Merge pull request #3948 from brauner/2021-08-24.fixes
...
confile: return negative errno everywhere
2021-08-24 08:29:49 -04:00
Maximilian Blenk
8c5c30d175
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>
2021-08-24 10:01:11 +02:00
Christian Brauner
d253a09f9b
confile: rework lxc_fill_elevated_privileges()
...
Cc: Maximilian Blenk <Maximilian.Blenk@bmw.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-24 09:58:47 +02:00
Christian Brauner
d34bbcb71a
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>
2021-08-24 09:58:25 +02:00
Christian Brauner
7cde4e411a
tools: align struct initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-24 09:57:44 +02:00
Christian Brauner
647df91d9a
tools: fix variable declarations in lxc-attach
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-24 09:36:34 +02:00
Maximilian Blenk
b445fcb114
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>
2021-08-24 09:20:02 +02:00
Christian Brauner
b28be01f5c
confile: return negative errno everywhere
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-24 09:13:36 +02:00
Christian Brauner
a0738fa00b
Merge pull request #3947 from blenk92/fix-missing-seccomp
...
config: enable seccomp profile only when compiled with libseccomp
2021-08-24 09:07:48 +02:00
Maximilian Blenk
3d46e1d1f8
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>
2021-08-24 01:17:32 +02:00
Stéphane Graber
f1b5286c65
Merge pull request #3943 from brauner/2021-08-19.fixes
...
seccomp: fix complication when !HAVE_DECL_SECCOMP_NOTIFY_FD
2021-08-19 15:18:07 -04:00
Christian Brauner
c16d194abf
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>
2021-08-19 10:47:31 +02:00
Stéphane Graber
ba4339b677
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
2021-08-17 12:45:57 -04:00
Christian Brauner
41ed9db898
tests: use busybox in lxc-test-usernic.in
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 17:35:48 +02:00
Christian Brauner
6c321ceada
tests: use busybox in lxc-test-unpriv
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 17:35:48 +02:00
Christian Brauner
f6a53ad2c5
tests: use busybox in lxc-test-no-new-privs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 17:35:48 +02:00
Christian Brauner
bc84935552
test: use busybox in lxc-test-autostart
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 13:51:28 +02:00
Christian Brauner
adb14537d2
test: use busybox in lxc-test-apparmor-mount
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 13:51:27 +02:00
Christian Brauner
acd792c965
test: use busybox in lxc-test-apparmor-generated
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 13:51:27 +02:00
Christian Brauner
fd0349a7a0
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>
2021-08-17 13:51:27 +02:00
Christian Brauner
03585adc0e
conf: allow for tty allocation even when container did not request separate devpts instance
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 13:51:27 +02:00
Christian Brauner
b081cb55e4
busybox: simplify
...
Start relying on autodev for busybox template and wipe all the device
creation.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 13:50:58 +02:00
Christian Brauner
8829829deb
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>
2021-08-17 13:49:56 +02:00
Christian Brauner
803839b8b9
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>
2021-08-17 11:39:17 +02:00
Christian Brauner
d06abe2f9c
file_utils: add same_device() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-17 11:39:17 +02:00
Stéphane Graber
72c6d3a56d
Merge pull request #3938 from brauner/2021-08-16.fixes
...
cgroups: simplify offline and isolated cpumask handling
2021-08-16 12:35:46 -04:00
Christian Brauner
12a0f27dfe
Merge pull request #3939 from Cypresslin/fix-test-exec-bit
...
tests: set lxc-test-automount/createconfig/snapdeps as executable
2021-08-16 12:06:16 +02:00
Po-Hsu Lin
02f00bdc3e
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>
2021-08-16 17:34:20 +08:00
Christian Brauner
4d8f68fb97
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>
2021-08-16 11:11:43 +02:00
Christian Brauner
0627ffc0c6
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>
2021-08-16 10:56:51 +02:00
Stéphane Graber
6f76b9e528
Merge pull request #3937 from brauner/2021-08-13.fixes
...
cgroups: cpumask fixes
2021-08-14 11:12:27 -04:00
Christian Brauner
f5bc57d23c
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>
2021-08-14 00:39:03 +02:00
Christian Brauner
21e84b0205
cgroups: fix comments in cpuset1_initialize()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-13 21:37:02 +02:00
Christian Brauner
f6949b6993
Revert "cgroups: fix cpu bitmasks"
...
This reverts commit e0f7296a6d
.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-13 21:35:30 +02:00
Christian Brauner
fb40641cac
Merge pull request #3934 from brauner/2021-08-12.fixes
...
cgroups: cpumask fixes
2021-08-12 10:12:45 +02:00
Christian Brauner
7e80755d0c
cgroups: s/calloc/zalloc/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-12 09:00:00 +02:00
Jim Ferrigno
e0f7296a6d
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>
2021-08-12 08:56:04 +02:00
Stéphane Graber
cf92aaac1c
Merge pull request #3899 from denisfa/master
...
Improve bash completion experience.
2021-08-11 13:42:18 -04:00
Stéphane Graber
ef10e680d5
Merge pull request #3932 from brauner/2021-08-11.fixes
...
mainloop: further io_uring fixes
2021-08-11 13:22:48 -04:00
Christian Brauner
82abff81b6
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>
2021-08-11 17:47:39 +02:00
Christian Brauner
c9d1f58725
mainloop: add comments about multishot and oneshot cleanup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-11 17:47:39 +02:00
Christian Brauner
e5e7c954c5
mainloop: s/handler_name/name/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-11 17:47:39 +02:00
Stéphane Graber
34a16b88c6
Merge pull request #3931 from brauner/2021-08-11.fixes
...
memory_utils: make cleanup handler as unused
2021-08-11 10:58:21 -04:00
Christian Brauner
96348aa8ab
mainloop: move variables into tighter scope
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-11 15:52:12 +02:00
Christian Brauner
f7050a2d87
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>
2021-08-11 15:43:18 +02:00
Stéphane Graber
d5b6db61e2
Merge pull request #3930 from brauner/2021-08-10.fixes
...
mainloop: io_uring cleanup handling fixes
2021-08-11 09:08:09 -04:00
Christian Brauner
4f142001a8
mainloop: fix io_uring cleanup handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-11 11:03:13 +02:00
Christian Brauner
cba2278a10
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>
2021-08-10 17:57:26 +02:00
Christian Brauner
80aa5876b3
mainloop: minor fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-10 17:42:41 +02:00
Christian Brauner
fa21f71fef
Merge pull request #3928 from simondeziel/download-user-agent
...
lxc-download: customize the user-agent to include LXC package version and compat level
2021-08-10 17:09:06 +02:00
Christian Brauner
4c56d112a6
Merge pull request #3929 from tych0/fix-sys-poll-warning
...
mainloop: s,sys/poll,poll
2021-08-10 17:07:19 +02:00
Tycho Andersen
1551ac0791
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>
2021-08-10 08:45:21 -06:00
Simon Deziel
dcc08eb562
lxc-download: add LXC version/compat level to user-agent
...
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2021-08-10 10:35:48 -04:00
Stéphane Graber
a399d7ead0
Merge pull request #3924 from brauner/2021-06-04.io_uring
...
mainloop: io_uring support
2021-08-10 10:01:55 -04:00
Christian Brauner
543d2f838c
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>
2021-08-10 14:33:48 +02:00
Christian Brauner
5dab527cb7
Merge pull request #3927 from tomponline/tp-nic-address-broadcast
...
doc: Adds mention of ability to specify manual IPv4 broadcast address
2021-08-10 13:03:10 +02:00
Thomas Parrott
5686798d8e
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>
2021-08-10 11:32:30 +01:00
Christian Brauner
3298b37d53
tree-wide: s/lxc_epoll_descr/lxc_async_descr/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-10 10:03:13 +02:00
Christian Brauner
d2022f30eb
conf: log session keyring failure on WARN level
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-10 10:03:13 +02:00
Christian Brauner
0d8d13be20
cgroups: log at warning instead of error level
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-10 10:03:12 +02:00
Christian Brauner
ea3c3688e1
Merge pull request #3926 from stgraber/master
...
doc/api-extensions: Grammar fix
2021-08-09 19:41:40 +02:00
Stéphane Graber
58795066dc
doc/api-extensions: Grammar fix
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-08-09 13:40:49 -04:00
Stéphane Graber
99ada0efc9
Merge pull request #3925 from brauner/2021-08-09.fixes
...
lsm/apparmor: small fixes
2021-08-09 10:25:07 -04:00
Christian Brauner
a36e286bea
lsm/apparmor: use cleanup macro
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-09 15:59:26 +02:00
Christian Brauner
0e8effda05
lsm/apparmor: log failure to write AppArmor profile
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-09 15:58:53 +02:00
Stéphane Graber
f14d72ba0f
Merge pull request #3923 from brauner/2021-08-05.fixes
...
network: fix container with empty network namespaces
2021-08-05 11:41:23 -04:00
Christian Brauner
43e2a96494
network: fix container with empty network namespaces
...
Fixes : #3922
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-05 16:16:33 +02:00
Stéphane Graber
b0a16da45a
Merge pull request #3921 from brauner/2021-08-03.fixes
...
conf: rootfs mount option fixes
2021-08-03 10:02:27 -04:00
Christian Brauner
587b2dff94
tests: add test for rootfs mount options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-03 14:48:51 +02:00
Christian Brauner
704cadd524
conf: allow mount options for rootfs when using new mount api
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-03 13:16:45 +02:00
Christian Brauner
8cf6a64675
mount_utils: make some mount helpers static inline
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-03 12:51:24 +02:00
Christian Brauner
0f43436cbe
conf: let parse_vfs_attr() handle legacy mount flags as well
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-03 12:19:49 +02:00
Christian Brauner
777827cb3a
conf: log failure to create tty mountpoint
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-03 09:22:46 +02:00
Stéphane Graber
fa89ed65fa
Merge pull request #3920 from brauner/2021-08-02.fixes
...
mount_utils: introduce mount_at()
2021-08-02 14:33:37 -04:00
Christian Brauner
b35f8f7ef5
conf: refactor lxc_recv_ttys_from_child()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-02 19:21:08 +02:00
Christian Brauner
caaa223bc0
conf: fix logging in lxc_idmapped_mounts_child()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-02 18:47:44 +02:00
Christian Brauner
8b0ccdaaf3
mount_utils: introduce mount_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-08-02 15:30:03 +02:00
Stéphane Graber
1b8f92fe74
Merge pull request #3919 from brauner/2021-07-31.devpts
...
terminal: handle kernel without TIOCGPTPEER
2021-07-31 10:54:25 -04:00
Christian Brauner
64ac925fb1
terminal: fail on unknown error during TIOCGPTPEER
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-31 10:19:57 +02:00
Christian Brauner
23cc33cd90
terminal: move native terminal allocation from error logging to info
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-31 10:17:36 +02:00
Christian Brauner
18129d9471
conf: handle kernels without TIOCGPTPEER
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-31 10:14:39 +02:00
Stéphane Graber
81f0bf03ab
Merge pull request #3918 from brauner/2021-07-30.devpts
...
conf: rework console setup
2021-07-30 10:42:39 -04:00
Christian Brauner
9f77617b2e
start: allow containers to use a native console
...
After all of the previous rework we can make it possible for a container
to use a console allocated from the container's devpts instance.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 15:24:22 +02:00
Christian Brauner
4dcf0c43d6
terminal: remove unused argument from lxc_devpts_terminal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 13:49:51 +02:00
Christian Brauner
d94a7f0911
conf: rework console setup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 13:31:03 +02:00
Christian Brauner
9910185a80
file_utils: add open_at_same()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 13:02:01 +02:00
Christian Brauner
f6370f2ac2
conf: use mount_fd() during console mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 09:40:40 +02:00
Christian Brauner
af0cf9b759
conf: use mount_fd() in lxc_setup_dev_console()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 09:27:54 +02:00
Christian Brauner
84f8f9e470
conf: use mount_fd() helper when mounting ttys
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 09:20:22 +02:00
Christian Brauner
b370ffcf7e
mount_utils: add mount_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 09:19:32 +02:00
Christian Brauner
d926c261b3
conf: stash pty_nr in struct lxc_terminal
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-30 09:07:50 +02:00
Stéphane Graber
cd7bd1fdd8
Merge pull request #3916 from brauner/2021-07-29.fixes
...
conf: move remaining setup before pivot root
2021-07-29 13:26:19 -04:00
Christian Brauner
6a2ca1b4dc
conf: move lxc_create_ttys() before pivot root
...
This is the last setup step that occured after pivot root.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 19:00:32 +02:00
Christian Brauner
4655bdd112
terminal: split out lxc_devpts_terminal() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 18:58:46 +02:00
Stéphane Graber
85fdf33f4e
Merge pull request #3915 from brauner/2021-07-29.fixes
...
string_utils: cast __s64 to long long signed int
2021-07-29 12:42:39 -04:00
Christian Brauner
e39f333336
string_utils: cast __s64 to long long signed int
...
Link: https://launchpadlibrarian.net/550723147/buildlog_snap_ubuntu_focal_ppc64el_lxd-latest-edge_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 18:25:19 +02:00
Stéphane Graber
3f4530847b
Merge pull request #3914 from brauner/2021-07-29.devpts
...
devpts: move setup before pivot root
2021-07-29 12:20:23 -04:00
Christian Brauner
96a980e1af
conf: merge devpts setup and move before pivot root
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:54:46 +02:00
Christian Brauner
cb01e31126
terminal: don't use ttyname_r() for native terminal allocation
...
Since we can call that function from another mount namespace we need to
do this manually.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:49:17 +02:00
Christian Brauner
c146c54eee
conf: add and use mount_beneath_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:49:17 +02:00
Christian Brauner
d27ae9992a
conf: update comment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:41:00 +02:00
Christian Brauner
068534278e
conf: use a relative path in symlinkat()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:41:00 +02:00
Christian Brauner
42c0d0568f
conf: s/lxc_setup_devpts_parent/lxc_recv_devpts_from_child/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:41:00 +02:00
Christian Brauner
f30fc74d07
conf: attach devpts mount directly when new mount api can be used
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:40:57 +02:00
Christian Brauner
a32e275f25
conf: set source property for devpts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:39:04 +02:00
Christian Brauner
87dfb724ea
conf: surface failures to setup console
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-29 15:36:21 +02:00
Stéphane Graber
9dcca2d5e0
Merge pull request #3912 from brauner/2021-07-28.devpts
...
conf: devpts rework
2021-07-28 16:48:18 -04:00
Christian Brauner
52da248213
Merge pull request #3913 from stgraber/master
...
Fix typos
2021-07-28 21:49:14 +02:00
Stéphane Graber
10fe481d5f
Fix typos
...
This fixes all typos identified by lintian.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-07-28 15:14:38 -04:00
Christian Brauner
7294a26d3d
conf: ensure devpts_fd is set to -EBADF
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-28 18:40:14 +02:00
Christian Brauner
ecfc18270e
terminal: ttyname_r() returns an error number on failure
...
In other words, how inconsistent can an API be?
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-28 18:40:13 +02:00
Christian Brauner
289b707bd1
conf: use new mount api for devpts setup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-28 18:40:13 +02:00
Christian Brauner
f10866f0d5
Merge pull request #3910 from petris/tty_enxio
...
lxc_setup_ttys: Handle existing ttyN file without underlying device
2021-07-22 09:24:15 +02:00
Christian Brauner
b9327b7f92
Merge pull request #3909 from petris/bpf_enosys_warn
...
bpf: simplify detection if BPF is supported
2021-07-21 15:25:36 +02:00
Christian Brauner
669953fbd1
Merge pull request #3911 from siv0/fix_legacy_cgroup_devices
...
Fix legacy cgroup devices
2021-07-20 17:57:42 +02:00
Petr Malat
7bf85dd20e
bpf: bpf_devices_cgroup_supported() should check if bpf() is available
...
bpf_devices_cgroup_supported() tries to load a simple BPF program to
test if BPF works. This is problematic because the function used to load
the program - bpf_program_load_kernel() - emits an error to the log if
BPF is not enabled in the kernel although device controller is not
requested in the configuration. Users could interpret that as a problem.
Make bpf_devices_cgroup_supported() check if the BPF syscall is available
before calling bpf_program_load_kernel(). We can do it by passing a NULL
pointer instead of the syscall argument as the kernel returns either
ENOSYS, when the syscall is not implemented or EFAULT, when it is
implemented.
Signed-off-by: Petr Malat <oss@malat.biz>
2021-07-20 17:51:23 +02:00
Petr Malat
128655e765
lxc_setup_ttys: Handle existing ttyN file without underlying device
...
If a device file is opened and there isn't the underlying device,
the open call fails with ENXIO, but the path can be opened with
O_PATH, which is enough for mounting over the device file.
Generalize this idea and use O_PATH for all cases when the file
is there. One still must check for both ENXIO and EEXIST as it's
unspecified what error is reported if multiple error conditions
occur at the same time.
Signed-off-by: Petr Malat <oss@malat.biz>
2021-07-20 15:43:24 +02:00
Stoiko Ivanov
eece10d519
cgroups: remove unneeded variables from cgroup_tree_create
...
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-20 12:06:27 +02:00
Stoiko Ivanov
60052c3be7
cgroups: populate hierarchy for device cgroup
...
With the changes introduced in:
b7b1e3a34c
the hierarchy-struct did not have the path_lim set anymore, which is
needed by setup_limits_legacy (->cg_legacy_set_data->lxc_write_openat)
to actually access the cgroup directory.
The issue can be reproduced with a container config having
```
lxc.cgroup.devices.deny = a
```
(or any lxc.cgroup.devices entry) set on a system booted with
systemd.unified_cgroup_hierarchy=0.
This affects all privileged containers on PVE (due to the default
devices.deny entry).
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-07-20 12:04:35 +02:00
Stéphane Graber
0a75530661
Merge pull request #3908 from brauner/2021-07-15.fixes.4
...
terminal: fix error handling
2021-07-15 16:14:07 -04:00
Christian Brauner
7a31655917
terminal: fix error handling
...
Fixes: f382bcc6d8
("terminal: log TIOCGPTPEER failure less alarmingly")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 22:09:31 +02:00
Stéphane Graber
8cff10d6a8
Merge pull request #3907 from brauner/2021-07-15.fixes.3
...
terminal: log TIOCGPTPEER failure less alarmingly
2021-07-15 13:19:26 -04:00
Stéphane Graber
93e2548209
Merge pull request #3906 from brauner/2021-07-15.fixes.2
...
grammar fixes
2021-07-15 12:48:14 -04:00
Christian Brauner
95103b6095
af_unix: report error when no fd is to be sent
...
Fixes : #3624
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 18:47:27 +02:00
Christian Brauner
f382bcc6d8
terminal: log TIOCGPTPEER failure less alarmingly
...
This is not a fatal error and the fallback codepath is equally safe.
When we use TIOCGPTPEER we're using a stashed fd to the container's
devpts mount's ptmx device and allocating a new fd non-path based
through this ioctl. If this ioctl can't be used we're falling back to
allocating a pts device from the host's devpts mount's ptmx device which
is path-based but is not under control of the container and so that's
safe. The difference is just that the first method gets you a nice
native terminal with all the pleasantries of having tty and friends
working whereas the latter method does not.
Fixes : #3625
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 18:37:22 +02:00
Christian Brauner
1d500fed48
sync: fix log message
...
Fixes : #3875
Suggested-by: Hank.shi <shk242673@163.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 18:18:25 +02:00
Christian Brauner
77093b7ccf
start: fix logging message
...
Fixes : #3875
Suggested-by: Hank.shi <shk242673@163.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 18:16:39 +02:00
Stéphane Graber
984f5f0bc5
Merge pull request #3905 from brauner/2021-07-15.fixes
...
initutils: include pthread.h
2021-07-15 08:58:57 -04:00
Christian Brauner
d461a40845
initutils: include pthread.h
...
Otherwise we might end up with implicit function declaration warnings.
Link: https://jenkins.linuxcontainers.org/job/lxc-build-android/8915/console
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-15 10:37:47 +02:00
Stéphane Graber
b2a311c2df
Merge pull request #3904 from hallyn/2021-07-14/mantypo
...
doc/common_options: add trace and alert loglevels
2021-07-15 00:47:44 -04:00
Serge Hallyn
44b87e816b
doc/common_options: add trace and alert loglevels
...
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-07-14 22:17:40 -05:00
Stéphane Graber
68963becaa
Merge pull request #3900 from brauner/2021-07-08.fixes
...
file_utils: surface ENOENT when falling back to openat()
2021-07-08 12:10:00 -04:00
Christian Brauner
ebb79ad32a
file_utils: surface ENOENT when falling back to openat()
...
Link: https://discuss.linuxcontainers.org/t/error-failed-to-retrieve-pid-of-executing-child-process
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-08 14:49:26 +02:00
Edênis Freindorfer Azevedo
35a5efc917
Improve bash completion.
...
Use as much as possible from each command `--help` for completion.
Some options require a long list of completions that should be dumped by
some command option. These are not added here yet.
Examples of those are: `lxc-info --config`, `lxc-execute --define` and
`lxc-start --define`.
Signed-off-by: Edenis Freindorfer Azevedo <edenisfa@gmail.com>
2021-07-06 22:50:24 -03:00
Edênis Freindorfer Azevedo
7d55228595
Create rules to add/remove symlinks for bash completion.
...
By default, there is no out-of-the-box bash completion for lxc tools.
This is due to dynamic loading of completions, that requires the
completion filename to be the same as the command (e.g. `lxc-start`
expects a completion filename `lxc-start`). But all commands are in file
`lxc`, which is not read.
Signed-off-by: Edenis Freindorfer Azevedo <edenisfa@gmail.com>
2021-07-06 22:50:24 -03:00
Edênis Freindorfer Azevedo
f8fae86f13
Fix typo on documentation for lxc-{attach,execute}
.
...
According to `[1]`, `lxc-attach` uses `-u,-g` instead of `--u,--g`.
According to `[2]`, `lxc-execute` uses `-u,-g` instead of `--u,--g`.
- [1] https://github.com/lxc/lxc/blob/stable-4.0/src/lxc/tools/lxc_attach.c#L131-L132
- [2] https://github.com/lxc/lxc/blob/stable-4.0/src/lxc/tools/lxc_execute.c#L59-L60
Signed-off-by: Edenis Freindorfer Azevedo <edenisfa@gmail.com>
2021-07-06 22:50:24 -03:00
Edênis Freindorfer Azevedo
98632d6ae0
Fix typo on documentation for lxc-autostart
.
...
According to `[1,2]`, this command has `--groups` instead of `--group`.
- [1] https://github.com/lxc/lxc/blob/stable-4.0/src/lxc/tools/lxc_autostart.c#L64
- [2] https://github.com/lxc/lxc/blob/stable-4.0/src/lxc/tools/lxc_autostart.c#L84
Signed-off-by: Edenis Freindorfer Azevedo <edenisfa@gmail.com>
2021-07-06 22:50:24 -03:00
Christian Brauner
78598e2b30
Merge pull request #3896 from Blub/include-userns-config-dir
...
RFC: conf: userns.conf: include userns.conf.d
2021-07-05 17:25:24 +02:00
Stéphane Graber
483f5b4f3d
Merge pull request #3897 from brauner/2021-07-05.fixes
...
lxc-unshare: fixes
2021-07-05 08:49:08 -04:00
Christian Brauner
a1ac26802c
lxc_unshare: fix network device handling
...
We were passing the wrong PID. Fix this!
Link: https://discuss.linuxcontainers.org/t/problem-with-moving-interface-new-network-namespace-in-lxc-unshare
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-05 12:19:31 +02:00
Christian Brauner
ecd92dffbc
lxc_unshare: make mount table private
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-05 12:11:42 +02:00
Wolfgang Bumiller
dc73e0f0cb
confile: allow including nonexisting directories
...
If an include directive ends with a trailing slash, we now
always assume it is a directory and do not treat the
non-existence as an error.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-05 10:53:41 +02:00
Wolfgang Bumiller
9508fc2727
conf: userns.conf: include userns.conf.d
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-07-05 09:02:36 +02:00
Stéphane Graber
b235962c17
Merge pull request #3895 from tenforward/japanese
...
Update Japanese lxc.container.conf(5)
2021-07-04 23:36:01 -04:00
KATOH Yasufumi
d47d8b6d4d
doc: Fix typo in English lxc.container.conf(5)
...
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-07-05 12:00:32 +09:00
KATOH Yasufumi
caf30f2731
doc: Add new idmap= option to Japanese lxc.container.conf(5)
...
Update for commit 1852be9048
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-07-05 11:54:43 +09:00
KATOH Yasufumi
27bf2abc68
doc: Append description of net type field
...
Update for commit 320061b34f
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-07-05 11:23:49 +09:00
KATOH Yasufumi
5793ff9bd2
doc: Add eBPF-based device controller semantics to Japanese man page
...
Update for commit 5025f3a690
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2021-07-05 11:23:35 +09:00
Stéphane Graber
a0f38dbf0b
Merge pull request #3891 from brauner/2021-07-01.fixes
...
cgroups: handle funky cgroup layouts
2021-07-01 10:23:24 -04:00
Stéphane Graber
d31bfd247d
Merge pull request #3892 from brauner/2021-07-01.fixes.2
...
terminal: ensure newlines are turned into newlines+carriage return fo…
2021-07-01 08:56:59 -04:00
Stéphane Graber
161b0ff427
Merge pull request #3893 from brauner/2021-07-01.fixes.3
...
cmd/lxc-checkconfig: list cgroup namespaces and rename confusing ns_c…
2021-07-01 08:51:44 -04:00
Christian Brauner
d1073415db
cmd/lxc-checkconfig: list cgroup namespaces and rename confusing ns_cgroup entry
...
Link: https://discuss.linuxcontainers.org/t/cgroup-namespace-required-in-lxc-checkconfig-and-config-cgroup-ns
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-01 13:40:18 +02:00
Christian Brauner
9027547494
terminal: ensure newlines are turned into newlines+carriage return for terminal output
...
Fixes : #3879
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-01 10:23:47 +02:00
Christian Brauner
f4afdfbe65
cgroups: handle funky cgroup layouts
...
Old versions of Docker emulate a cgroup namespace by bind-mounting the
container's cgroup over the corresponding controller:
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime master:11 - cgroup cgroup rw,xattr,name=systemd
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime master:15 - cgroup cgroup rw,net_cls,net_prio
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime master:16 - cgroup cgroup rw,cpu,cpuacct
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime master:17 - cgroup cgroup rw,memory
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime master:18 - cgroup cgroup rw,devices
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime master:19 - cgroup cgroup rw,hugetlb
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime master:20 - cgroup cgroup rw,perf_event
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime master:21 - cgroup cgroup rw,cpuset
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime master:22 - cgroup cgroup rw,blkio
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime master:23 - cgroup cgroup rw,pids
/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod7d4424e6_bb13_42f4_a47a_45a4828bf54d.slice/docker-d0b3604b67ac7930dd34ba3a796627e3e4717d12309e90a4afe3f38b6816ac98.scope /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime master:24 - cgroup cgroup rw,freezer
New versions of LXC always stash a file descriptor for the root of the
cgroup mount at /sys/fs/cgroup and then resolve the current cgroup
parsed from /proc/{1,self}/cgroup relative to that file descriptor. This
doesn't work when the caller's cgroup is mouned over the controllers.
Older versions of LXC simply counted such layouts as having no cgroups
available for delegation at all and moved on provided no cgroup limits
were requested. But mainline LXC would fail such layouts. While I would
argue that failing such layouts is the semantically clean approach we
shouldn't regress users so make mainline LXC treat such cgroup layouts
as having no cgroups available for delegation.
Fixes : #3890
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-07-01 09:57:09 +02:00
Stéphane Graber
e751379640
Merge pull request #3888 from brauner/2021-06-30.fixes
...
Improve read-only /sys with read-write /sys/devices/virtual/net
2021-06-30 10:30:27 -04:00
Christian Brauner
d777ffccff
tests: add tests for read-only /sys with read-write /sys/devices/virtual/net
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-30 13:58:27 +02:00
Christian Brauner
cb4889abc8
conf: improve read-only /sys with read-write /sys/devices/virtual/net
...
Some tools require /sys/devices/virtual/net to be read-write. At the
same time we want all other parts of /sys to be read-only. To do this we
created a layout where we hade a read-only instance of sysfs mounted on
top of a read-write instance of sysfs:
`-/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
`-/sys sysfs sysfs ro,nosuid,nodev,noexec,relatime
|-/sys/devices/virtual/net sysfs sysfs rw,relatime
| `-/sys/devices/virtual/net sysfs[/devices/virtual/net] sysfs rw,nosuid,nodev,noexec,relatime
This causes issues for systemd services that create a separate mount
namespace as they get confused to what mount options need to be
respected.
Simplify our mounting logic so we end up with a single read-only mount
of sysfs on /sys and a read-write bind-mount of /sys/devices/virtual/net:
├─/sys sysfs sysfs ro,nosuid,nodev,noexec,relatime
│ ├─/sys/devices/virtual/net sysfs[/devices/virtual/net] sysfs rw,nosuid,nodev,noexec,relatime
Link: systemd/systemd#20032
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-30 13:22:15 +02:00
Christian Brauner
fda9bfb721
Merge pull request #3887 from simondeziel/closedir
...
initutils: close dirfd in error path
2021-06-30 12:56:03 +02:00
Simon Deziel
9884f0a64b
initutils: close dirfd in error path
...
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
2021-06-29 11:50:09 -04:00
Christian Brauner
804f3e2a12
Merge pull request #3885 from tych0/dont-exec-execute
...
execute: don't exec init, call it
2021-06-29 16:08:19 +02:00
Christian Brauner
734a677ed2
execute: ensure parent is notified about child exec and close all unneeded fds
...
lxc_container_init() creates the container payload process as it's child
so lxc_container_init() itself never really exits and thus the parent
isn't notified about the child exec'ing since the sync file descriptor
is never closed. Make sure it's closed to notify the parent about the
child's exec.
In addition we're currently leaking all file descriptors associated with
the handler into the stub init. Make sure that all file descriptors
other than stderr are closed.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-29 11:20:55 +02:00
Christian Brauner
a1150aa174
network: log network devices while sending
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-29 10:39:38 +02:00
Christian Brauner
d65e5e492f
initutils: use vfork() in lxc_container_init()
...
We can let the child finish calling exec before continuing in the
parent.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-29 10:39:38 +02:00
Tycho Andersen
96294efb35
execute: don't exec init, call it
...
Instead of having a statically linked init that we put on the host fs
somewhere via packaging, have to either bind mount in or detect fexecve()
functionality, let's just call it as a library function. This way we don't
have to do any of that.
This also fixes up a bunch of conditions from:
if (quiet)
fprintf(stderr, "log message");
to
if (!quiet)
fprintf(stderr, "log message");
:)
and it drops all the code for fexecve() detection and bind mounting our
init in, since we no longer need any of that.
A couple other thoughts:
* I left the lxc-init binary in since we ship it, so someone could be using
it outside of the internal uses.
* There are lots of unused arguments to lxc-init (including presumably
--quiet, since nobody noticed the above); those may be part of the API
though and so we don't want to drop them.
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-06-29 10:39:36 +02:00
Wolfgang Bumiller
f1c64634c4
Merge pull request #3877 from tomasz-blaszczak-red/fix-crash-after-remove-from-array
...
remove_from_array() causes a crash
2021-06-29 08:54:43 +02:00
Tomasz Blaszczak
bc5f0449c0
When an item is added to an array, then the array is realloc()ed (to size+1),
...
and the item is copied (strdup()) to the array.
Thus, when an item is removed from an array, memory allocated for that item
should be freed, successive items should be left-shifted and the array
realloc()ed again (size-1).
Additional changes:
- If strdup() fails in add_to_array(), then an array should be
realloc()ed again to original size.
- Initialize an array in list_all_containers().
Signed-off-by: Tomasz Blaszczak <tomasz.blaszczak@consult.red>
2021-06-29 08:20:51 +02:00
Wolfgang Bumiller
5e3ec98927
Merge pull request #3884 from brauner/2021-06-28.fixes
...
cgroups: verify that hierarchies are non-empty
2021-06-28 12:32:11 +02:00
Christian Brauner
414fbacca9
cgroups: verify that hierarchies are non-empty
...
Fixes : #3881
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-28 09:44:20 +02:00
Christian Brauner
0aa47c8fe2
Merge pull request #3882 from stgraber/master
...
lxc-download: Switch GPG server
2021-06-28 09:39:50 +02:00
Stéphane Graber
f2a5d95d00
lxc-download: Switch GPG server
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-06-27 23:42:52 -04:00
Tomasz Blaszczak
5364ae41aa
Resize array in remove_from_array() and fix a crash
...
When an item is added to an array, then the array is realloc()ed (to size+1),
and the item is copied (strdup()) to the array.
Thus, when an item is removed from an array, allocated memory pointed by
the item (not the item itself) should be freed, successive items should
be left-shifted and the array realloc()ed again (size-1).
Additional changes:
- Initialize an array in list_all_containers().
Signed-off-by: Tomasz Blaszczak <tomasz.blaszczak@consult.red>
2021-06-25 13:16:24 +02:00
Tomasz Blaszczak
fe444ea6bc
When an item is added to an array, then the array is realloc()ed (to size+1),
...
and the item is copied (strdup()) to the array.
Thus, when an item is removed from an array, memory allocated for that item
should be freed, successive items should be left-shifted and the array
realloc()ed again (size-1).
Additional changes:
- If strdup() fails in add_to_array(), then an array should be
realloc()ed again to original size.
- Initialize an array in list_all_containers().
Signed-off-by: Tomasz Blaszczak <tomasz.blaszczak@consult.red>
2021-06-23 10:41:39 +02:00
Stéphane Graber
2ccc8081d2
Merge pull request #3870 from brauner/2021-06-16.fixes
...
cgroups: use stable ordering for co-mounted v1 controllers
2021-06-16 08:42:55 -04:00
Christian Brauner
91d0151d89
cgroups: use stable ordering for co-mounted v1 controllers
...
Fixes : #3703
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-16 10:03:42 +02:00
Stéphane Graber
b103a2ceec
Merge pull request #3867 from brauner/2021-06-14.fixes
...
remove problematic terminology
2021-06-14 13:41:50 -04:00
Christian Brauner
b7b227cc01
tree-wide: replace problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:26:24 +02:00
Christian Brauner
8de0119d48
tree-wide: replace problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:25:39 +02:00
Christian Brauner
f48e807159
tree-wide: replace problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:21:44 +02:00
Christian Brauner
4f6c7312ef
tree-wide: remove problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:15:43 +02:00
Christian Brauner
1c01dc2c5e
seccomp: replace problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:14:26 +02:00
Christian Brauner
af6a5f3add
common.conf: replace problematic terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 17:13:00 +02:00
Christian Brauner
a065524e28
Merge pull request #3865 from brauner/2021-06-14.listen_fds
...
Add support for LISTEN_FDS environment variable.
2021-06-14 13:29:20 +02:00
Ruben Jenster
46abf21981
Add support for LISTEN_FDS environment variable.
...
The LISTEN_FDS environment variable defines the number of
file descriptors that should be inherited by the container,
in addition to stdio.
The LISTEN_FDS environment variable is defined in the OCI spec
and used to support socket activation.
Refs #3845
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-14 11:58:24 +02:00
Christian Brauner
51bbca901b
Merge pull request #3864 from lifeng68/master
...
string utils: Make sure don't return uninitialized memory.
2021-06-14 11:34:14 +02:00
LiFeng
47f5be06a4
string utils: Make sure don't return uninitialized memory.
...
The function lxc_string_split_quoted and lxc_string_split_and_trim use
realloc to reduce the memory. But the result may be NULL, the the
returned memory will be uninitialized
Signed-off-by: LiFeng <lifeng68@huawei.com>
2021-06-12 14:56:04 +08:00
Stéphane Graber
a197d2fb5b
Merge pull request #3861 from brauner/2021-06-08.fixes.2
...
api_extensions: introduce idmapped_mounts_v2 api extension
2021-06-08 10:46:00 -04:00
Christian Brauner
3df13023b0
api_extensions: introduce idmapped_mounts_v2 api extension
...
This indicates that LXC supports idmapping the rootfs and
idmapped lxc.mount.entry entries.
Link: https://github.com/lxc/lxd/issues/8870
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-08 15:59:13 +02:00
Stéphane Graber
2384faa223
Merge pull request #3860 from brauner/2021-06-08.fixes
...
tools/lxc_autostart: fix failed count
2021-06-08 09:21:35 -04:00
Christian Brauner
2f7828f699
tools/lxc_autostart: fix failed count
...
Don't include skipped containers in the failed count.
Fixes : #3857
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-08 15:01:02 +02:00
Stéphane Graber
81ec0d7ebf
Merge pull request #3856 from brauner/2021-06-07.fixes
...
lsm/apparmor: actually report an error when we fail to wire AppArmor …
2021-06-07 10:31:32 -04:00
Christian Brauner
fd697cc0e9
lsm/apparmor: actually report an error when we fail to wire AppArmor profile
...
Link: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1931064
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-07 15:38:10 +02:00
Stéphane Graber
4e92ee3b5d
Merge pull request #3854 from brauner/2021-06-03.fixes
...
lxc: add lpthread to lxc.pc
2021-06-03 11:21:35 -04:00
Christian Brauner
c2a7a6977b
lxc: add lpthread to lxc.pc
...
Fixes : #3853
Suggested-by: Tycho Andersen <tycho@tycho.pizza>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-06-03 15:50:20 +02:00
Stéphane Graber
ca5843e1bc
Merge pull request #3852 from pablofsf/lxc-net-nftables
...
Update lxc-net to support nftables
2021-05-28 16:28:57 -04:00
Pablo Correa Gómez
7f4386f096
Update lxc-net to support nftables
...
Closes #3093
Closes #3602
Add support for nftables firewall rules if `nft` command line
interface is available in the system
Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
2021-05-28 14:33:23 +02:00
Stéphane Graber
6805cc3666
Merge pull request #3851 from brauner/2021-05-25.fixes
...
fixes
2021-05-25 09:56:43 -04:00
Christian Brauner
4db0514d56
network: please broken compilers
...
Some users report that compilation fails because of reports that this
variable can be used uninitialized. Initialize it to silence the
compiler.
Fixes: https://github.com/lxc/lxc/issues/3850
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-25 14:24:01 +02:00
Christian Brauner
f07ba4f991
Merge pull request #3849 from stgraber/master
...
README: Update IRC
2021-05-25 09:01:34 +02:00
Stéphane Graber
c49b9f61b2
README: Update IRC
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-05-24 12:13:20 -04:00
Stéphane Graber
90bb9fb2ab
Merge pull request #3848 from brauner/2021-05-21.fixes
...
start: rework fd synchronization
2021-05-21 12:25:56 -04:00
Christian Brauner
6bc4165d3c
start: simplify startup synchronization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:58:01 +02:00
Christian Brauner
8945dad0dd
start: reorder START_SYNC_POST_CONFIGURE
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Christian Brauner
46a3bf0778
start: use barrier instead of wake/wait pair
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Christian Brauner
2df612d422
conf: use explicit signage in bit field
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Christian Brauner
111ed96e9c
conf: move file descriptor synchronization with parent into single function
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Christian Brauner
493ae3fe7e
conf: move file descriptor synchronization with child into single function
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Christian Brauner
98db769c83
cgroups: rework check whether legacy hierarchy is writable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-21 17:27:58 +02:00
Stéphane Graber
ddd51bd187
Merge pull request #3846 from brauner/2021-05-19.fixes
...
conf: fix mount option parsing
2021-05-19 14:09:14 -04:00
Christian Brauner
380fcc0863
conf: fix mount option parsing
...
Fixes: Coverity 1484906
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-19 17:38:20 +02:00
Stéphane Graber
e2e70bd5a2
Merge pull request #3843 from brauner/2021-05-17.idmapped.lxc.mount.entry
...
conf: support idmapped lxc.mount.entry entries
2021-05-19 09:55:26 -04:00
Christian Brauner
df5e747dc9
confile: free mount data
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-19 14:21:52 +02:00
Christian Brauner
5a782dca99
conf: add sequence when setting up idmapped mounts
...
Make sure we catch any weird behavior.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-19 14:21:52 +02:00
Christian Brauner
1b82d72144
conf: support idmapped lxc.mount.entry entries
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-19 14:21:51 +02:00
Christian Brauner
966dad2494
Merge pull request #3844 from CecilHarvey/master
...
Skip rootfs pinning for read-only file system.
2021-05-18 21:37:14 +02:00
Wei Mingzhi
e859a5ee2c
Skip rootfs pinning for read-only file system.
...
Signed-off-by: Wei Mingzhi <weimingzhi@baidu.com>
2021-05-18 20:37:52 +08:00
Christian Brauner
1e4bce2c14
conf: rename struct mount_opt flag member s/flag/legacy_flag/
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-17 12:44:20 +02:00
Christian Brauner
d94eb39059
tree-wide: s/parse_mntopts/parse_mntopts_legacy/
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-17 12:40:08 +02:00
Stéphane Graber
73936a0d5c
Merge pull request #3842 from brauner/2021-05-14.fixes
...
start: move idmapped mount setup later
2021-05-14 13:49:18 -04:00
Christian Brauner
e4564b7ef9
start: move idmapped mount setup later
...
At the prior location we we're placed between sending and receiving
networking information over the data socket causing the startup to fail.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-14 19:00:14 +02:00
Stéphane Graber
5b70f02efc
Merge pull request #3840 from brauner/2021-05-12.fixes.rootfs
...
conf: fix containers without rootfs
2021-05-12 09:03:33 -04:00
Christian Brauner
c119f0185b
conf: tweak rootfs handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-12 10:23:55 +02:00
Christian Brauner
f6c5aab0c0
conf: don't unmount procfs and sysfs
...
Fixes : #3838
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-12 10:23:51 +02:00
Christian Brauner
89606dfb31
conf: allow xdev when setting up /dev
...
Fixes : #3838
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-12 10:23:14 +02:00
Stéphane Graber
3bd21f4e39
Merge pull request #3837 from brauner/2021-05-10.fixes.cgroup
...
cgroups: clean up cgroup_ops on initialization error
2021-05-11 08:51:27 -04:00
Christian Brauner
e3d78fdc8c
cgroups: clean up cgroup_ops on initialization error
...
Fixes : #3836
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-11 09:05:03 +02:00
Stéphane Graber
fb6991e5e7
Merge pull request #3826 from brauner/2021-05-04.fuzz.cgroup
...
oss-fuzz: add basic cgroup_init()/cgroup_exit() fuzzing
2021-05-10 12:12:56 -04:00
Stéphane Graber
bff268e79a
Merge pull request #3834 from brauner/2021-05-10.fixes
...
tests: fix lxc-test-arch-parse for make dist
2021-05-10 11:25:51 -04:00
Christian Brauner
4fb70d07da
tests: fix lxc-test-arch-parse for make dist
...
Fixes: https://jenkins.linuxcontainers.org/job/lxc-build-tarballs/2762/console
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-10 17:13:10 +02:00
Stéphane Graber
ccd43350da
Merge pull request #3833 from brauner/2021-05-09.fixes
...
confile: re-add aarch64 architecture
2021-05-09 13:03:17 -04:00
Christian Brauner
90658f1604
tests: add tests for supported architectures
...
Ensure that we detect all supported architectures and don't regress
recognizing them.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-09 16:26:53 +02:00
Christian Brauner
cae2b16fda
confile: re-add aarch64 architecture
...
Apparenty we dropped this when we cleaned up architecture handling.
Fixes : #3832
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-09 15:45:42 +02:00
Christian Brauner
1910c22889
Merge pull request #3831 from sjuxax/zfs-fix
...
Skip rootfs pinning for ZFS roots.
2021-05-09 14:28:23 +02:00
Jeff Cook
0dd4788a84
Reflow ZFS check to follow the style of the overlayfs return.
...
Per https://github.com/lxc/lxc/pull/3831#discussion_r628865713
Signed-off-by: Jeff Cook <jeff@jeffcook.io>
2021-05-09 05:40:17 -06:00
Jeff Cook
4bc6ecbfb7
Skip rootfs pinning for ZFS roots.
...
Signed-off-by: Jeff Cook <jeff@jeffcook.io>
2021-05-08 21:18:54 -06:00
Stéphane Graber
5b508c3713
Merge pull request #3829 from brauner/2021-05-07.fixes
...
doc: document new idmap= option for lxc.rootfs.options
2021-05-07 11:52:05 -04:00
Christian Brauner
1852be9048
doc: document new idmap= option for lxc.rootfs.options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-07 17:27:06 +02:00
Stéphane Graber
ce86ae557a
Merge pull request #3827 from brauner/2021-05-06.cap_setfcap
...
conf: handle kernels with CAP_SETFCAP
2021-05-06 12:42:23 -04:00
Christian Brauner
86c780115a
conf: handle kernels with CAP_SETFCAP
...
LXC is being very clever and sometimes maps the caller's uid into the
child userns. This means that the caller can technically write fscaps
that are valid in the ancestor userns (which can be a security issue in
some scenarios) so newer kernels require CAP_SETFCAP to do this. Until
newuidmap/newgidmap are updated to account for this simply write the
mapping directly in this case.
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-06 18:16:45 +02:00
Christian Brauner
7495196098
oss-fuzz: add basic cgroup_init()/cgroup_exit() fuzzing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 18:47:13 +02:00
Stéphane Graber
78af4d9c90
Merge pull request #3825 from brauner/2021-05-04.fixes
...
lxc.arch fixes
2021-05-04 10:54:52 -04:00
Christian Brauner
3a88181962
attach: introduce explicit personality macro
...
Introduce LXC_ATTACH_DETECT_PERSONALITY to make it explicit what is
happening instead of using -1.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 16:16:36 +02:00
Christian Brauner
64a04c848a
conf: add personality_t
...
Catch errors in personality handling better.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 16:09:48 +02:00
Christian Brauner
7fd384d11b
attach_options: unbreak header
...
In a moment of idioticity I switch -1 with 0xffffffff in the header
definition but we use -1 to autodetect.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:43:38 +02:00
Christian Brauner
7c43fa56e7
conf: rework lxc_config_parse_arch()
...
Fix architecture parsing. So far we couldn't really differ between "want
default architecture" and "failed to parse requested architecture"
because the -1 return value means both. Fix this by using the return
value only to indicate success or failure and return the parsed
personality in a return argument.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:28:49 +02:00
Christian Brauner
9c601e1f99
conf: tweak setup_personality()
...
Use the dedicated LXC_ARCH_UNCHANGED macro everywhere instead of relying
on -1 being correct.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:28:48 +02:00
Christian Brauner
3860899204
tree-wide: make personality codepaths unconditional
...
Now that we have the infra to make personality handling unconitional
remove the ifndefs everywhere.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:27:44 +02:00
Christian Brauner
3857c4ebf0
syscalls: wrap personality syscall if undefined
...
There's no need to making personality handling conditional as it has
been around for such a long time that only weird systems wouldn't have
support for it. And especially if the user requested a specific
personality to be set but the system doesn't support the personality
syscall we should loudly fail instead of moving on.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:15:28 +02:00
Christian Brauner
1d74176da2
commands: log at debug not info level when receiving file descriptors
...
Don't spam the logs because we do receive a lot of file descriptors.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:15:08 +02:00
Christian Brauner
5f2a6ec4e1
confile: make per_name struct static
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-04 15:14:09 +02:00
Christian Brauner
13723cb9e5
Merge pull request #3823 from evverx/gcc-11-workaround
...
string_utils: get around GCC-11 false positives
2021-05-04 05:10:35 +02:00
Stéphane Graber
3176d82e3a
Merge pull request #3824 from evverx/sanitizers-follow-ups
...
github: remove the dh-* packages
2021-05-03 19:59:44 -04:00
Evgeny Vereshchagin
6d345aa40d
string_utils: get around GCC-11 false positives
...
by getting rid of stpncpy
Tested with gcc (GCC) 11.1.1 20210428 (Red Hat 11.1.1-1)
Closes https://github.com/lxc/lxc/issues/3752
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-05-03 23:07:20 +00:00
Evgeny Vereshchagin
bfb24cf0fd
github: also pass the j option to make
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-05-03 22:35:19 +00:00
Evgeny Vereshchagin
72f83931b3
github: remove the dh-* packages
...
We don't build any packages there so it seems we don't need
those packages any more. Apart from that, it should make the
script work on Ubuntu Hirsute where dh-systemd was merged into
debhelper and is no longer available.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-05-03 22:33:17 +00:00
Stéphane Graber
705b2c32d1
Merge pull request #3819 from dev-aaront-org/console-mode-messages
...
conf: fix console chmod error log messages
2021-05-03 08:03:25 -04:00
Christian Brauner
58f5195d67
Merge pull request #3822 from stgraber/master
...
github: Run apt-get update in sanitizer test
2021-05-03 14:03:14 +02:00
Stéphane Graber
4919245709
Merge pull request #3820 from brauner/2021-05-03.lxc_monitord.log
...
lxc_monitord: remove monitord log
2021-05-03 08:03:03 -04:00
Stéphane Graber
5687858702
github: Run apt-get update in sanitizer test
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-05-03 08:02:14 -04:00
Christian Brauner
8ee2f36fc3
lxc_monitord: remove monitord log
...
The tool is effectively unused with current master so removing the log
should be ok by now. Let's remove the log to avoid issues such as #3747 .
Fixes #3747
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-05-03 08:59:02 +02:00
Christian Brauner
86deb111ae
Merge pull request #3818 from evverx/disable-logs-on-oss-fuzz
...
oss-fuzz: always turn off logging on OSS-Fuzz
2021-05-01 08:29:20 +02:00
Aaron Thompson
07020e481a
conf: fix console chmod error log messages
...
Signed-off-by: Aaron Thompson <dev@aaront.org>
2021-05-01 01:20:14 +00:00
Stéphane Graber
122413ad4e
Merge pull request #3817 from brauner/2021-04-30.fixes
...
cgroups: fix fallback attach codepath
2021-04-30 10:03:58 -04:00
Christian Brauner
112ccbc913
cgroups: fix fallback attach codepath
...
When we attach to an old server the server can return ENOSYS instead of
ENOCGROUP2 which causes LXC to abort the attach unnecessary. Fix this!
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-30 15:49:39 +02:00
Stéphane Graber
b75c91deeb
Merge pull request #3816 from brauner/2021-04-30/fixes
...
storage: fix dup_cloexec() call
2021-04-30 08:45:18 -04:00
Evgeny Vereshchagin
a390325fdf
oss-fuzz: always turn off logging on OSS-Fuzz
...
Apparently /proc/self/cmd can't be used (reliably) on OSS-Fuzz to figure out
whether the code is run inside the fuzz targets, which causes the
fuzz targets to fill the filesystem with log files.
Related: https://github.com/google/oss-fuzz/issues/5509
Should address https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33835
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-30 11:19:21 +00:00
Christian Brauner
2570cdf3fe
storage: fix dup_cloexec() call
...
Fixes: Coverity 1477399
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-30 10:35:06 +02:00
Stéphane Graber
7a2bd5db2c
Merge pull request #3814 from brauner/2021-04-28.fixes
...
api-extensions: add entry for idmapped_mounts
2021-04-28 09:52:30 -04:00
Christian Brauner
fa3a003464
api-extensions: add entry for idmapped_mounts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 15:39:37 +02:00
Stéphane Graber
6d93802001
Merge pull request #3812 from brauner/2021-04-28.fixes
...
storage/dir: cleanup mount code
2021-04-28 08:57:16 -04:00
Christian Brauner
94363265bd
Merge pull request #3802 from evverx/build-system-fuzzers
...
oss-fuzz: switch to --enable-fuzzers
2021-04-28 11:59:26 +02:00
Christian Brauner
60dc8124d8
storage/dir: cleanup mount code
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:33:37 +02:00
Christian Brauner
a246068620
storage/dir: remove error handling down
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:27:58 +02:00
Christian Brauner
b6234735b2
storage/dir: source can't be empty
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:26:59 +02:00
Christian Brauner
196a800af5
storage/dir: use "source" and "target" as terms
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:26:11 +02:00
Christian Brauner
31278920a8
storage/dir: retrieve proper source path later
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:24:15 +02:00
Christian Brauner
e2e3c93878
storage/dir: use clear error messages
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:23:03 +02:00
Christian Brauner
0b2e168841
storage/dir: bdev->dest can't be empty
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-28 11:21:03 +02:00
Christian Brauner
0476883131
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>
2021-04-28 11:19:47 +02:00
Stéphane Graber
8f7b7b8d42
Merge pull request #3811 from brauner/2021-04-25.idmapped_mounts.rootfs
...
rootfs rework
2021-04-27 18:42:41 -04:00
Evgeny Vereshchagin
a10327e7d8
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>
2021-04-27 00:34:22 +00:00
Evgeny Vereshchagin
aa96786737
tests: run the fuzzers along with the other tests
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-26 21:41:54 +00:00
Evgeny Vereshchagin
4a6af91855
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>
2021-04-26 19:57:56 +00:00
Evgeny Vereshchagin
1667e14e07
ci: switch to --enable-fuzzers
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-26 19:57:56 +00:00
Evgeny Vereshchagin
38718ccca0
build-system: add --enable-fuzzers
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-26 19:57:56 +00:00
Christian Brauner
4b875ef96a
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>
2021-04-25 13:55:50 +02:00
Christian Brauner
239f29c92d
conf: s/lxc_rootfs_prepare/lxc_rootfs_init/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-25 13:55:49 +02:00
Christian Brauner
423374e953
conf: move all mount options into struct lxc_mount_options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-25 13:55:49 +02:00
Christian Brauner
4e86cad35b
conf: stash lxc_storage into lxc_rootfs and bind to its lifetime
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-25 13:55:49 +02:00
Stéphane Graber
b9f3cd48ec
Merge pull request #3810 from brauner/2021-04-24.fixes
...
configure: fix function detection
2021-04-24 13:48:56 -04:00
Christian Brauner
305b3b9c14
configure: fix function detection
...
Fixes : #3809
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-24 11:19:53 +02:00
Stéphane Graber
6e66aa5b3e
Merge pull request #3808 from brauner/2021-04-23.fixes
...
dir: fix rootfs mounting
2021-04-23 08:48:51 -04:00
Christian Brauner
9e21bb6f56
dir: fix rootfs mounting
...
We need to be able to lookup symlinks and allow xdev.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-23 11:29:47 +02:00
Christian Brauner
6ecffe66c2
Merge pull request #3807 from evverx/seccom-leak
...
seccomp: init and destroy notifier.cookie
2021-04-23 06:58:33 +02:00
Stéphane Graber
e3d404cb57
Merge pull request #3805 from brauner/2021-04-22.fixes.3
...
mntopt fixes
2021-04-22 16:40:27 -04:00
Christian Brauner
2e5c468aa5
conf: don't overrun dest buffer in parse_lxc_mntopts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 21:09:12 +02:00
Christian Brauner
d97d9e9ff9
conf: better naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 20:55:46 +02:00
Stéphane Graber
5a65643b19
Merge pull request #3804 from brauner/2021-04-22.fixes.2
...
getsubopt: use correct include
2021-04-22 08:59:16 -04:00
Christian Brauner
d38f448a8e
getsubopt: use correct include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 14:39:37 +02:00
Stéphane Graber
1cb6974419
Merge pull request #3803 from brauner/2021-04-22.fixes
...
include fixes for Bionic
2021-04-22 07:40:21 -04:00
Christian Brauner
317410da66
Makefile: fix strchrnul() inclusion
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 12:10:56 +02:00
Christian Brauner
60933dae08
conf: include strchrnul for platforms that don't support it
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 09:45:13 +02:00
Christian Brauner
535bc5aac2
strchrnul: include header
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-22 09:44:07 +02:00
Stéphane Graber
c11af9735f
Merge pull request #3709 from brauner/2021-03-17/idmapped_mounts_v2
...
Initial support for idmapped mounts
2021-04-21 20:05:12 -04:00
Christian Brauner
fa8e75f009
conf: don't allow idmapped lxc.mount.{entry,fstab} just yet
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:07:35 +02:00
Christian Brauner
8e05f35018
conf: tweak parse_lxc_mntopts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:07:35 +02:00
Christian Brauner
389eb7c6da
apparmor: handle on-exec
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:07:34 +02:00
Christian Brauner
2533995e79
attach: use correct lxc_namespace_t type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:07:34 +02:00
Christian Brauner
f620ed4433
attach: visually separate pids from fds during initalization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:07:32 +02:00
Christian Brauner
657ed14a98
conf: verify that the rootfs can support idmapped mounts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
26ad2c6f3a
start: documented idmapped mounts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
d347d35633
mount_utils: add two detached mount helpers
...
They'll come in handy in the future.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
e26cf56313
conf: support idmapping directories
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
d4e07569bb
mount_utils: add helper to determine whether new mount api supports bind mounts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
79defd8833
storage: keep a reference to lxc_rootfs in lxc_storage
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:59 +02:00
Christian Brauner
031e0285fa
mount_utils: add support for mount_setattr() syscall
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:58 +02:00
Christian Brauner
16fcdacc24
confile: parse idmap=<path> mount option for rootfs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:58 +02:00
Christian Brauner
f6815906a1
conf: add first, trivial support for idmapped mounts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:58 +02:00
Christian Brauner
0b932f9ded
conf: rework lxc specific mount option parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-21 10:05:58 +02:00
Christian Brauner
12cf9f5a56
Merge pull request #3801 from evverx/san-tweaks
...
ci: make use of --enable-sanitizers instead of CFLAGS
2021-04-21 07:27:31 +02:00
Christian Brauner
6622f6514c
Merge pull request #3800 from evverx/gh3796
...
Revert "ci: get around https://github.com/lxc/lxc/issues/3796 "
2021-04-19 17:19:18 +02:00
Christian Brauner
77d2bd1a44
Merge pull request #3787 from evverx/san-build
...
ci: an attempt to run the tests under ASan/UBsan
2021-04-19 13:46:14 +02:00
Christian Brauner
dc117b6ba9
Merge pull request #3799 from evverx/apparmor-bytes
...
apparmor: turn bytes into null-terminated strings before calling strcspn
2021-04-18 20:00:10 +02:00
Stéphane Graber
44990884f5
Merge pull request #3790 from brauner/2021-04-15.fixes
...
lxc_clone & configure fix
2021-04-17 12:58:09 -04:00
Christian Brauner
3698c4914d
commands: don't needlessly allocate
...
Fixes : #3796
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-17 18:28:42 +02:00
Christian Brauner
95dfbd4272
Merge pull request #3797 from evverx/pass-on-asan
...
tests: pass on ASAN/UBSAN options to several tests
2021-04-17 17:42:36 +02:00
Christian Brauner
431c1c05e6
process_utils: free stack after return
...
Fixes : #3789
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-17 17:26:30 +02:00
Christian Brauner
cdfa8f13f2
configure: fix sanitizer compilation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-17 17:26:30 +02:00
Christian Brauner
6f527abc65
error_utils: add missing macro.h include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-17 17:26:30 +02:00
Christian Brauner
00f224bbbf
Merge pull request #3794 from evverx/gh3791
...
tests: stop cutting off right square brackets in share_ns
2021-04-16 13:41:09 +02:00
Christian Brauner
d5ec7f1eba
Merge pull request #3793 from evverx/busybox-test
...
tests: switch to the "busybox" template in lxc-test-checkpoint-restore
2021-04-16 00:13:15 +02:00
Evgeny Vereshchagin
5dd07023cb
seccomp: init and destroy notifier.cookie
...
It's a follow-up to 84cf6d259b
Closes https://github.com/lxc/lxc/issues/3806
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-15 07:09:10 +00:00
Stéphane Graber
fdc56afe56
Merge pull request #3785 from brauner/2021-04-14.fixes
...
lxccontainer: fix container creation error paths
2021-04-14 11:05:53 -04:00
Christian Brauner
ff3f956a5e
Merge pull request #3784 from evverx/attach-memleak
...
tests: fix a memory leak in attach
2021-04-14 16:14:56 +02:00
Christian Brauner
190f83db41
lxccontainer: fix container creation error paths
...
Fixes : #3782
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-14 16:12:45 +02:00
Evgeny Vereshchagin
d480165a4b
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>
2021-04-14 00:47:46 +00:00
Evgeny Vereshchagin
a0befb8416
ci: get rid of the -static-libasan stopgap
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-14 00:47:45 +00:00
Evgeny Vereshchagin
bab29e095d
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>
2021-04-13 23:03:47 +00:00
Evgeny Vereshchagin
9a31ce8632
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>
2021-04-13 23:03:47 +00:00
Christian Brauner
c4142ec2a0
Merge pull request #3783 from evverx/cgpath-memleak2
...
tests: fix a memory leak in cgpath
2021-04-13 17:20:47 +02:00
Evgeny Vereshchagin
b421532e51
ci: make use of --enable-sanitizers instead of CFLAGS
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-13 14:45:29 +00:00
Christian Brauner
ca52b7ff13
Merge pull request #3781 from evverx/lxcpath-memleak
...
tests: fix a memory leak in lxcpath
2021-04-13 14:32:19 +02:00
Christian Brauner
274615f9e3
Merge pull request #3780 from evverx/cgpath-mem-leak
...
tests: fix a memory leak in cgpath
2021-04-13 14:14:30 +02:00
Evgeny Vereshchagin
940195775d
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>
2021-04-13 06:23:03 +00:00
Evgeny Vereshchagin
03478622cb
Revert "ci: get around https://github.com/lxc/lxc/issues/3796 "
...
This reverts commit 44818e893e
.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-13 06:06:29 +00:00
Evgeny Vereshchagin
a1093fdeda
ci: build with -Wall -Werror
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
2a5b9cd6a2
ci: turn on strict_string_checks
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
44818e893e
ci: get around https://github.com/lxc/lxc/issues/3796
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
935dc9a046
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>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
335a140542
ci: get around https://github.com/lxc/lxc/issues/3788
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
02c7e7afe2
ci: get around https://github.com/lxc/lxc/issues/3798
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
8f1500a92a
ci: switch to lxc-exercise from the lxc-ci repository
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 23:20:38 +00:00
Evgeny Vereshchagin
7b8b83572b
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>
2021-04-12 23:20:29 +00:00
Evgeny Vereshchagin
5a0720a91e
ci: an attempt to run the tests under ASan/UBsan
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-12 22:14:15 +00:00
Evgeny Vereshchagin
699e7f889f
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>
2021-04-12 21:39:28 +00:00
Stéphane Graber
aeff7df6e4
Merge pull request #3779 from brauner/2021-04-12/attach_fixes
...
attach: fixes
2021-04-12 13:20:03 -04:00
Christian Brauner
09a83db55b
Revert "rexec: mark all fds as close-on-exec if possible"
...
This reverts commit 531d36ad00
.
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>
2021-04-12 17:50:39 +02:00
Christian Brauner
0b8e876fbd
attach: don't return early when calculating namespaces via pidfd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-12 17:48:40 +02:00
Stéphane Graber
d32dcd01e7
Merge pull request #3778 from brauner/2021-04-12/fixes
...
conf: idmaptool fixes
2021-04-12 09:28:50 -04:00
Christian Brauner
a864a2e105
conf: don't report success when idmaptools lack all privilege
...
Fixes : #3777
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-12 14:00:27 +02:00
Christian Brauner
83cb736218
conf: simplify idmaptool_on_path_and_privileged()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-12 09:44:40 +02:00
Evgeny Vereshchagin
5f850cf9d8
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>
2021-04-12 02:21:07 +00:00
Evgeny Vereshchagin
11ead2c46a
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>
2021-04-11 15:07:47 +00:00
Evgeny Vereshchagin
73dc93dbce
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>
2021-04-11 10:40:10 +00:00
Evgeny Vereshchagin
621c7cc739
tests: fix a memory leak in attach
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-10 12:31:02 +00:00
Evgeny Vereshchagin
f80950eeef
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>
2021-04-10 07:36:21 +00:00
Evgeny Vereshchagin
4cd72b693c
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>
2021-04-10 04:45:46 +00:00
Evgeny Vereshchagin
5a9fae9e7f
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>
2021-04-10 02:09:09 +00:00
Stéphane Graber
965502a09c
Merge pull request #3775 from brauner/2021-04-07/fixes
...
confile: make lxc_get_config() and lxc_get_config_net() always return…
2021-04-07 12:06:02 -04:00
Christian Brauner
6773e10851
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>
2021-04-07 16:52:38 +02:00
Christian Brauner
33c0a5466e
Merge pull request #3774 from stgraber/master
...
github: Try to fix action naming
2021-04-07 16:34:52 +02:00
Stéphane Graber
7e8b9b04f2
github: Try to fix action naming
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-04-07 10:34:02 -04:00
Stéphane Graber
f0c6219acb
Merge pull request #3773 from brauner/2021-04-06/fixes_2
...
confile & log: fixes
2021-04-07 08:04:51 -04:00
Christian Brauner
ae393e1328
confile: enforce maximum subkey length
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-07 09:38:36 +02:00
Christian Brauner
c3cef319e3
log: add error_ret()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-07 09:38:36 +02:00
Christian Brauner
0a3b86f90c
macro: ensure ret_errno() always returns negative
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-07 09:38:27 +02:00
Christian Brauner
9d984c3fb5
Merge pull request #3763 from evverx/fuzz-lxc-define-load
...
oss-fuzz: fuzz lxc_config_define_add and lxc_config_define_load
2021-04-07 09:33:59 +02:00
Stéphane Graber
ace51ce88d
Merge pull request #3772 from merlin1991/master
...
templates/*.in: fixed PATH handling with spaces
2021-04-06 10:43:59 -04:00
Christian Ratzenhofer
655d10ed7f
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>
2021-04-06 14:43:11 +02:00
Stéphane Graber
093bfcc83c
Merge pull request #3771 from brauner/2021-04-06/fixes
...
conf: fix setups where /dev is outside of LXC's control
2021-04-06 08:18:32 -04:00
Christian Brauner
e2c8dbd8bc
log: ensure we always return negative errno
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-06 10:34:31 +02:00
Christian Brauner
1f0a3b6e48
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>
2021-04-06 10:30:38 +02:00
Stéphane Graber
d75ddd9b1b
Merge pull request #3766 from brauner/2021-04-02/fixes_2
...
lsm: fixes
2021-04-02 12:03:41 -04:00
Christian Brauner
8f899a4a12
confile: complain when LXC is built without AppArmor support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-02 16:32:54 +02:00
Christian Brauner
d6df2b8fdf
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>
2021-04-02 16:18:29 +02:00
Stéphane Graber
6fde9fb187
Merge pull request #3764 from brauner/2021-04-02/fixes
...
confile: fix lxc.namespace.share.[identifier]
2021-04-02 08:47:53 -04:00
Christian Brauner
057d2caecb
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>
2021-04-02 12:05:58 +02:00
Stéphane Graber
8aa602556a
Merge pull request #3762 from brauner/2021-03-31/fixes
...
fixes: Makefile, lxc-user-nic, simplify get_network_config_ops()
2021-04-01 08:39:43 -04:00
Christian Brauner
7707b0e06e
confile: simplify get_network_config_ops()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-01 11:08:13 +02:00
Christian Brauner
59f5a10311
string_utils: use restrict for lxc_safe_int64_residual()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-01 11:08:13 +02:00
Christian Brauner
90e69d7178
string_utils: ensure that errno is set on return
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-01 11:08:11 +02:00
Christian Brauner
5fba37a134
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>
2021-04-01 10:27:40 +02:00
Christian Brauner
68dd0ea545
lxc_user_nic: cleanup get_alloted()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-01 10:27:40 +02:00
Christian Brauner
4c7de7c5ee
lxc_user_nic: cleanup append_alloted()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-01 10:27:38 +02:00
Christian Brauner
b405dec645
Merge pull request #3760 from evverx/reject-giant-configs
...
oss-fuzz: reject giant configs early
2021-04-01 08:01:59 +02:00
Evgeny Vereshchagin
55376ebd14
cifuzz: fuzz longer
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-01 01:25:26 +00:00
Evgeny Vereshchagin
1a46f8537e
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>
2021-04-01 01:25:26 +00:00
Evgeny Vereshchagin
e8694d9a22
oss-fuzz: fuzz lxc_config_define_add and lxc_config_define_load
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-01 01:25:09 +00:00
Christian Brauner
f5312e35d3
Merge pull request #3759 from evverx/san-compatible
...
build-system: make it compatible with ASan/UBsan/Msan
2021-03-31 22:03:07 +02:00
Stéphane Graber
6dcd23e2bd
Merge pull request #3758 from brauner/2021-03-31/fixes
...
confile: cap to last bit in set_config_net_ipv4_address()
2021-03-31 13:36:04 -04:00
Christian Brauner
365136359f
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>
2021-03-31 10:54:28 +02:00
Christian Brauner
ea35e2ccda
Merge pull request #3755 from evverx/lxc-net
...
oss-fuzz.sh: put the "lxc.net" keys to the seed corpus as well
2021-03-30 20:50:52 +02:00
Stéphane Graber
21e9bead12
Merge pull request #3756 from brauner/2021-03-30/fixes_3
...
string_utils: switch to path_simplify()
2021-03-30 12:58:28 -04:00
Christian Brauner
28e54be15f
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>
2021-03-30 17:20:51 +02:00
Stéphane Graber
ec6de2c3e7
Merge pull request #3754 from brauner/2021-03-30/fixes_2
...
confile: don't jump into the global table twice
2021-03-30 08:31:41 -04:00
Christian Brauner
0abcc213e2
confile: don't jump into the global table twice
...
instead move networking keys into a subtable. This avoids even just the
remote danger of recursion and also speeds up config parsing.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-30 12:51:54 +02:00
Evgeny Vereshchagin
e7e0343fd9
oss-fuzz: reject giant configs early
...
It should help the fuzzer to avoid running into timeouts
like https://oss-fuzz.com/testcase-detail/5132999948632064 .
Hopefully, once this is merged OSS-Fuzz will report only
infinite loops as timeouts.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 07:26:39 +00:00
Evgeny Vereshchagin
792a48b180
build-system: make it compatible with ASan/UBsan/MSan
...
Closes: https://github.com/lxc/lxc/issues/3727
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 06:09:35 +00:00
Evgeny Vereshchagin
b31484bd1b
ci: enable PAM
...
to make sure pam_cgfs is buildable with ASan/UBsan too
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 04:22:46 +00:00
Evgeny Vereshchagin
7bf9dc49e7
ci: also build with ASan/UBsan
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 04:22:46 +00:00
Evgeny Vereshchagin
49ffe5da49
oss-fuzz.sh: get rid of the sed "no-undefined" kludge
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 04:22:46 +00:00
Evgeny Vereshchagin
85d70be752
ci: stop passing --enable-ubsan
...
It's just a follow-up to 5f40423627
(where --enable-ubsan
was removed).
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-30 03:35:50 +00:00
Stéphane Graber
dce56ec228
Merge pull request #3750 from brauner/2021-03-29/fixes_2
...
autotools: remove --enable-{asan,ubsan} in favor of --enable-sanitizers
2021-03-29 13:11:25 -04:00
Christian Brauner
fb33b35c88
Merge pull request #3751 from tomponline/tp-nic-ordering
...
doc: Documented that net type field must come before other options on the net device
2021-03-29 18:29:57 +02:00
Thomas Parrott
320061b34f
doc: Documented that net type field must come before other options on the net device
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2021-03-29 17:20:42 +01:00
Christian Brauner
73c852f7d6
README: remove Travis and add Github actions badge
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 18:05:39 +02:00
Christian Brauner
5f40423627
autotools: remove --enable-{asan,ubsan} in favor of --enable-sanitizers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 17:35:59 +02:00
Stéphane Graber
d96134fa74
Merge pull request #3749 from brauner/2021-03-29/fixes
...
compiler: fix thread_local detection
2021-03-29 10:45:46 -04:00
Christian Brauner
86624ee4a5
Merge pull request #3746 from evverx/CIFuzz-unblock-msan
...
CIFuzz: turn on MSan
2021-03-29 16:06:16 +02:00
Christian Brauner
448439729d
compiler: fix thread_local detection
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 16:03:57 +02:00
Stéphane Graber
be43adcda9
Merge pull request #3748 from brauner/2021-03-29/fixes
...
fixes & config key validation
2021-03-29 08:13:08 -04:00
Evgeny Vereshchagin
593f13bf0a
oss-fuzz.sh: put the "lxc.net" keys in the seed corpus as well
...
It's just a follow-up to 0abcc213e2
(where the "lxc.net" keys
were moved from config_jump_table to config_jump_table_net)
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-29 11:49:01 +00:00
Christian Brauner
ea60ca9565
lxccontainer: ensure second parameter to bsearch is never NULL
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 13:32:00 +02:00
Christian Brauner
52ce85046b
conf: fix thread_local support detection
...
Our detection for TLS wasn't working. Fix it.
Fixes: https://github.com/lxc/lxd/issues/8327
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 13:32:00 +02:00
Christian Brauner
2d676c005c
tests: add another test for garbage config key
...
where a valid key has trailing garbage at the end before the "=".
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:34:33 +02:00
Christian Brauner
cea88c47ac
tests: fix two false negatives in parse_config_file()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:33:33 +02:00
Christian Brauner
f0383b96e0
confile: cleanup set_config_net_script_down()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:26:12 +02:00
Christian Brauner
040b3e1d24
confile: cleanup set_config_net_script_up()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:26:11 +02:00
Christian Brauner
6d0297b9ae
confile: cleanup set_config_net_mtu()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:26:11 +02:00
Christian Brauner
a8b7aefc15
confile: cleanup set_config_net_hwaddr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:26:11 +02:00
Christian Brauner
8d508eaa9b
confile: clear netdev on network type change
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32584
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 12:26:11 +02:00
Christian Brauner
12babd78e3
confile: vet keys more aggressively
...
Enforce an exact match for all keys where we now the subkeys must match
exactly.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 10:19:30 +02:00
Christian Brauner
d21e950059
confile: safely clean previous value in set_config_net_ipv4_gateway()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32586
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 10:07:39 +02:00
Christian Brauner
e0f420d5ae
confile: safely clean previous value in set_config_net_ipv6_gateway()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32610
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 10:07:39 +02:00
Christian Brauner
cc19bc5406
Merge pull request #3745 from evverx/ubsan-msan-support
...
oss-fuzz/cifuzz: a couple of follow-up commits
2021-03-28 23:16:45 +02:00
Christian Brauner
94d05c50c9
Merge pull request #3744 from evverx/oss-fuzz-32596
...
confile_utils: fix a signed integer overflow
2021-03-28 19:20:49 +02:00
Stéphane Graber
db62570f0f
Merge pull request #3743 from brauner/2021-03-27/fixes_3
...
oss-fuzz: fixes
2021-03-28 12:35:16 -04:00
Evgeny Vereshchagin
f6727edbf7
string_utils: work around an MSan false positive
...
MSan doesn't instrument stpncpy (https://github.com/google/sanitizers/issues/926 ),
which causes the fuzzer to fail with:
```
$ cat ../minimized-from-740f56329efc60eab59b8194132b712a873e88a3
lxc.console.size=123
$ ./out/fuzz-lxc-config-read ../minimized-from-740f56329efc60eab59b8194132b712a873e88a3
INFO: Seed: 3561494591
INFO: Loaded 1 modules (18795 inline 8-bit counters): 18795 [0x866b98, 0x86b503),
INFO: Loaded 1 PC tables (18795 PCs): 18795 [0x86b508,0x8b4bb8),
./out/fuzz-lxc-config-read: Running 1 inputs 1 time(s) each.
Running: ../minimized-from-740f56329efc60eab59b8194132b712a873e88a3
==850885==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x6b3e7f in parse_byte_size_string /home/vagrant/lxc/src/lxc/string_utils.c:912:6
#1 0x550991 in set_config_console_size /home/vagrant/lxc/src/lxc/confile.c:2483:8
#2 0x5346e2 in parse_line /home/vagrant/lxc/src/lxc/confile.c:2962:9
#3 0x64b3cd in lxc_file_for_each_line_mmap /home/vagrant/lxc/src/lxc/parse.c:125:9
#4 0x53340c in lxc_config_read /home/vagrant/lxc/src/lxc/confile.c:3039:9
#5 0x4e7ec2 in LLVMFuzzerTestOneInput /home/vagrant/lxc/src/tests/fuzz-lxc-config-read.c:23:2
#6 0x44ad2c in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x44ad2c)
#7 0x42ca4d in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x42ca4d)
#8 0x433af0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x433af0)
#9 0x423ff6 in main (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x423ff6)
#10 0x7f79bdc89081 in __libc_start_main (/lib64/libc.so.6+0x27081)
#11 0x42402d in _start (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x42402d)
Uninitialized value was created by an allocation of 'dup' in the stack frame of function 'parse_byte_size_string'
#0 0x6b3330 in parse_byte_size_string /home/vagrant/lxc/src/lxc/string_utils.c:901
SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/vagrant/lxc/src/lxc/string_utils.c:912:6 in parse_byte_size_string
Exiting
```
Closes https://oss-fuzz.com/testcase-detail/5829890470445056
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-28 16:05:29 +00:00
Evgeny Vereshchagin
cf0f7aba41
cifuzz: turn on MSan
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-28 16:05:13 +00:00
Christian Brauner
4c5479d21e
string_utils: handle overflow correct in parse_byte_size_string()
...
This takes the overflow handling code from the kernel.
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32549
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-28 11:55:13 +02:00
Evgeny Vereshchagin
a6fa6772e1
cifuzz: turn on UBsan
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-28 06:53:44 +00:00
Evgeny Vereshchagin
745d60487b
oss-fuzz.sh: take SANITIZER into account
...
to make it possible to build the fuzzer with UBSan and MSan locally
```
$ SANITIZER=undefined ./src/tests/oss-fuzz.sh
$ printf 'lxc.signal.stop=sigrtmax-020000000020' >oss-fuzz-32596
$ UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 ./out/fuzz-lxc-config-read oss-fuzz-32596
INFO: Seed: 595864277
INFO: Loaded 1 modules (61553 inline 8-bit counters): 61553 [0x80a1b0, 0x819221),
INFO: Loaded 1 PC tables (61553 PCs): 61553 [0x819228,0x909938),
./out/fuzz-lxc-config-read: Running 1 inputs 1 time(s) each.
Running: oss-fuzz-32596
confile_utils.c:1051:20: runtime error: signed integer overflow: 64 - -2147483632 cannot be represented in type 'int'
#0 0x51799a in rt_sig_num /home/vagrant/lxc/src/lxc/confile_utils.c:1051:20
#1 0x517268 in sig_parse /home/vagrant/lxc/src/lxc/confile_utils.c:1069:11
#2 0x500ca4 in set_config_signal_stop /home/vagrant/lxc/src/lxc/confile.c:1738:10
#3 0x4b8c7c in parse_line /home/vagrant/lxc/src/lxc/confile.c:2962:9
#4 0x5a5eb0 in lxc_file_for_each_line_mmap /home/vagrant/lxc/src/lxc/parse.c:125:9
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-28 06:52:01 +00:00
Evgeny Vereshchagin
e6b35fbfb6
confile_utils: fix a signed integer overflow
...
This was triggered by the following chain of conversions:
lxc_safe_uint("020000000020") -> 2147483664 (uint)
sig_num(2147483664 (uint)) -> -2147483632 (int)
64 - -2147483632 cannot be represented in type 'int'
Closes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32596
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-28 05:41:34 +00:00
Christian Brauner
405b28a4de
confile: don't leak memory in case multiple shmounts are set
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32503
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 20:59:15 +01:00
Christian Brauner
79d2f54fd5
confile: add missing prefix validation
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32488
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 20:49:19 +01:00
Stéphane Graber
d734e61169
Merge pull request #3741 from brauner/2021-03-27/fixes_2
...
confile_utils: free list during lxc_remove_nic_by_idx()
2021-03-27 14:32:51 -04:00
Christian Brauner
9a096e987e
confile_utils: free list during lxc_remove_nic_by_idx()
...
Reported-by: Evgeny Vereshchagin <evvers@ya.ru>
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32484
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 18:42:24 +01:00
Stéphane Graber
cc98c47021
Merge pull request #3739 from brauner/2021-03-27/fixes
...
oss-fuzz: fixes
2021-03-27 11:48:18 -04:00
Evgeny Vereshchagin
b2606302de
ci: turn on ASan on CIFuzz
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-27 14:35:48 +01:00
Christian Brauner
1504790389
confile: prevent recursion when parsing networks
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32558
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32484
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 14:31:50 +01:00
Evgeny Vereshchagin
f6848c5fbc
confile: fix a memory leak in set_config_net_hwaddr
...
It was found by ClusterFuzz in https://oss-fuzz.com/testcase-detail/4747480244813824
but hasn't been reported on Monorail
(https://bugs.chromium.org/p/oss-fuzz/ ) yet
```
$ cat minimized-from-1a18983c13ce64e8a3bd0f699a97d25beb21481e
lxc.net.0.hwaddr=0
lxc.net.0.hwaddr=4
./out/fuzz-lxc-config-read minimized-from-1a18983c13ce64e8a3bd0f699a97d25beb21481e
INFO: Seed: 1473396311
INFO: Loaded 1 modules (18821 inline 8-bit counters): 18821 [0x885fa0, 0x88a925),
INFO: Loaded 1 PC tables (18821 PCs): 18821 [0x88a928,0x8d4178),
./out/fuzz-lxc-config-read: Running 1 inputs 1 time(s) each.
Running: minimized-from-1a18983c13ce64e8a3bd0f699a97d25beb21481e
=================================================================
==226185==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 2 byte(s) in 1 object(s) allocated from:
#0 0x4d25d7 in strdup (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x4d25d7)
#1 0x58e48f in set_config_net_hwaddr /home/vagrant/lxc/src/lxc/confile.c:654:14
#2 0x59af3b in set_config_net_nic /home/vagrant/lxc/src/lxc/confile.c:5276:9
#3 0x571c29 in parse_line /home/vagrant/lxc/src/lxc/confile.c:2958:9
#4 0x61b0b2 in lxc_file_for_each_line_mmap /home/vagrant/lxc/src/lxc/parse.c:125:9
#5 0x5710ed in lxc_config_read /home/vagrant/lxc/src/lxc/confile.c:3035:9
#6 0x542cd6 in LLVMFuzzerTestOneInput /home/vagrant/lxc/src/tests/fuzz-lxc-config-read.c:23:2
#7 0x449e8c in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x449e8c)
#8 0x42bbad in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x42bbad)
#9 0x432c50 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x432c50)
#10 0x423136 in main (/home/vagrant/lxc/out/fuzz-lxc-config-read+0x423136)
#11 0x7f2cbb992081 in __libc_start_main (/lib64/libc.so.6+0x27081)
SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-27 14:31:37 +01:00
Christian Brauner
299ddd1663
confile: improve network vetting
...
Move all input sanity checks up and add two missing checks for the
correct network type when using veth-vlan and vlan network types.
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32513
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 14:31:37 +01:00
Christian Brauner
bbc9892535
confile: use correct check for too large network lists
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32558
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 08:09:56 +01:00
Christian Brauner
6a52a513f9
confile: make string calculations in get_network_config_ops() more obvious
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 08:09:09 +01:00
Christian Brauner
ced5587c03
conf: coding style cleanups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 07:56:22 +01:00
Christian Brauner
25ed0305b1
confile_utils: free network list items
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32484
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 07:52:33 +01:00
Christian Brauner
cc36133d43
conf: reinitialize lists
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 07:52:10 +01:00
Christian Brauner
c45833e39c
string_utils: always memset buf in lxc_safe_int64_residual()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32482
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-27 07:14:56 +01:00
Stéphane Graber
6a374b65e7
Merge pull request #3738 from brauner/2021-03-26/fixes_3
...
oss-fuzz: fixes
2021-03-26 18:22:30 -04:00
Christian Brauner
5837aa8448
confile: fix returns in set_config_net_veth_vlan_tagged_id()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32494
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 23:02:59 +01:00
Christian Brauner
631d271533
confile: fix setting prlimits
...
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32532
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 22:58:01 +01:00
Christian Brauner
59bc24cd0d
conf: don't leak list
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 22:57:58 +01:00
Stéphane Graber
8c70a4080b
Merge pull request #3736 from brauner/2021-03-26/fixes_3
...
oss-fuzz: fixes
2021-03-26 17:52:57 -04:00
Christian Brauner
06fdc710a8
log: avoid regressions for relative log paths
...
We need to allow relative log paths.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 22:32:18 +01:00
Christian Brauner
b2480b2950
string_utils: fix parse_byte_size_string()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32475
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 22:28:36 +01:00
Christian Brauner
0b73eb0590
confile_utils: improve network parser
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 22:28:36 +01:00
Christian Brauner
6583a65090
Merge pull request #3737 from evverx/oss-fuzz-fixes
...
oss-fuzz: a few follow-up commits
2021-03-26 20:45:39 +01:00
Christian Brauner
647d0e011a
Merge pull request #3731 from samboyles1/master
...
network: handle name collisions when returning interfaces to host
2021-03-26 17:18:08 +01:00
Stéphane Graber
627c766cba
Merge pull request #3735 from brauner/2021-03-26/fixes_2
...
oss-fuzz: fixes
2021-03-26 12:00:04 -04:00
Christian Brauner
786467cbdd
conf: prevent UAF in lxc_clear_limits()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32532
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 16:42:57 +01:00
Christian Brauner
b8e539f448
confile_utils: fix real-time signal parsing
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32521
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 16:38:49 +01:00
Christian Brauner
c04f422182
confile: don't leak memory when overwriting lxc.rootfs.options
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32473
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 16:02:04 +01:00
Christian Brauner
e50319aaaf
Merge pull request #3733 from evverx/move-from-oss-fuzz
...
oss-fuzz: make it possible to build the fuzzer without docker
2021-03-26 15:35:37 +01:00
Stéphane Graber
6a3b579505
Merge pull request #3734 from brauner/2021-03-26/fixes_2
...
confile: be stricter in config helpers
2021-03-26 10:30:47 -04:00
Christian Brauner
d60ba56821
confile: be stricter in config helpers
...
We never call these helper without an initialized config afaict but
since we're now exposing these two functions to oss-fuzz directly in a
way we never do to users so let's be stricter about it.
Inspired-by: #3733
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 15:11:08 +01:00
Stéphane Graber
0912bf6b77
Merge pull request #3732 from brauner/2021-03-26/fixes
...
log: dont create log file for fuzz builds
2021-03-26 08:26:41 -04:00
Christian Brauner
2f6d309983
log: handle empty log name
...
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32491
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 12:21:48 +01:00
Christian Brauner
e459cf6831
log: don't create directories for fuzz builds
...
Fixes : #3730
Fixes: https://github.com/google/oss-fuzz/issues/5509
Suggested-by: Evgeny Vereshchagin <evvers@ya.ru>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 11:52:54 +01:00
Christian Brauner
a30a4efae5
log: dont create log file for fuzz builds
...
Fixes : #3730
Fixes: https://github.com/google/oss-fuzz/issues/5509
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-26 09:20:56 +01:00
Evgeny Vereshchagin
98f9e64d33
fuzz: generate all the config keys and add them to the seed corpus
...
It should help to cover more code faster
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-26 05:49:19 +00:00
Evgeny Vereshchagin
77d755ce04
README: add OSS-Fuzz/CIFuzz badges
...
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-26 05:20:51 +00:00
Evgeny Vereshchagin
f329f022a9
fuzz: create tmpfiles in /tmp
...
It's mostly a cosmetic change that should prevent the fuzzer
from cluttering the "$OUT" directory (which OSS-Fuzz uses to
build docker images):
```
Step #44 : Already have image: gcr.io/oss-fuzz/lxc
Step #44 : adding: fuzz-lxc-config-read (deflated 67%)
Step #44 : adding: fuzz-lxc-config-read-WBWKxN (deflated 32%)
Step #44 : adding: fuzz-lxc-config-read_seed_corpus.zip (stored 0%)
Step #44 : adding: honggfuzz (deflated 66%)
Step #44 : adding: llvm-symbolizer (deflated 65%)
```
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-26 05:20:07 +00:00
Sam Boyles
bb301db761
network: handle name collisions when returning physical interfaces to host
...
Reviewed-by: Blair Steven <blair.steven@alliedtelesis.co.nz>
Signed-off-by: Sam Boyles <sam.boyles@alliedtelesis.co.nz>
2021-03-26 15:27:07 +13:00
Evgeny Vereshchagin
dec64820a3
oss-fuzz: make it possible to build the fuzzer without docker
...
With this patch applied the fuzz target can be built (with ASan)
and run with
```
./src/tests/oss-fuzz.sh
./out/fuzz-lxc-config-read doc/examples/
```
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32475 can be
reproduced by running
```
$ echo "lxc.console.buffer.size=d" >oss-fuzz-32475
$ ./out/fuzz-lxc-config-read ./oss-fuzz-32475
INFO: Seed: 1044753468
INFO: Loaded 1 modules (18770 inline 8-bit counters): 18770 [0x883cc0, 0x888612),
INFO: Loaded 1 PC tables (18770 PCs): 18770 [0x888618,0x8d1b38),
./out/fuzz-lxc-config-read: Running 1 inputs 1 time(s) each.
Running: oss-fuzz-32475
=================================================================
==2052097==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffcca063e7f at pc 0x000000659e0d bp 0x7ffcca063e30 sp 0x7ffcca063e28
READ of size 1 at 0x7ffcca063e7f thread T0
...
```
I'll point OSS-Fuzz to the build script once this patch is merged.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-26 01:11:23 +00:00
Stéphane Graber
27df252817
Merge pull request #3729 from brauner/2021-03-25/fixes_3
...
oss-fuzz: fixes
2021-03-25 19:17:37 -04:00
Christian Brauner
b8e43ef0bd
conf: use lxc_list_new() everywhere
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:49:37 +01:00
Christian Brauner
642751ccd0
confile: use lxc_list_new() everywhere
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:38:24 +01:00
Christian Brauner
89d34eb2ed
list: add lxc_list_new() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:33:12 +01:00
Christian Brauner
c461b9c7ed
confile_utils: delete netdev from list
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32478
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:22:53 +01:00
Christian Brauner
4a2c9b4023
conf: reinitialize sysctl list after clearing it
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32474
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:10:57 +01:00
Christian Brauner
b5fdc164e3
confile: fix set_config_sysctl()
...
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32487
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 23:07:22 +01:00
Christian Brauner
65c5bc571b
Merge pull request #3726 from evverx/cifuzz
...
ci: turn on CIFuzz
2021-03-25 16:45:02 +01:00
Christian Brauner
854e6c5c01
Merge pull request #3725 from evverx/se_keyring_context_memory_leak
...
conf: fix a memory leak
2021-03-25 15:51:19 +01:00
Stéphane Graber
3c9c460953
Merge pull request #3724 from brauner/2021-03-25/fixes
...
confile_utils: don't free netdev twice
2021-03-25 08:26:55 -04:00
Evgeny Vereshchagin
4117b26a0e
ci: turn on CIFuzz
...
Now that lxc has been integrated into OSS-Fuzz it should be
possible to start using https://google.github.io/oss-fuzz/getting-started/continuous-integration/
(mostly to make sure that the project is buildable there).
It should help to keep the integration in more or less good shape.
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-25 09:40:51 +00:00
Evgeny Vereshchagin
1ed59e6d8d
conf: fix a memory leak
...
It was triggered by passing "lxc.selinux.context.keyring=xroot" to the
fuzz target introduced in https://github.com/google/oss-fuzz/pull/5498
```
=================================================================
==22==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 6 byte(s) in 1 object(s) allocated from:
#0 0x538ca4 in __strdup /src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:468:3
#1 0x5c40e8 in set_config_string_item /src/lxc/src/lxc/confile_utils.c:635:14
#2 0x44394e in set_config_selinux_context_keyring /src/lxc/src/lxc/confile.c:1596:9
#3 0x5af955 in parse_line /src/lxc/src/lxc/confile.c:2953:9
#4 0x4475cd in lxc_file_for_each_line_mmap /src/lxc/src/lxc/parse.c:125:9
#5 0x5af24f in lxc_config_read /src/lxc/src/lxc/confile.c:3024:9
#6 0x580b04 in LLVMFuzzerTestOneInput /src/fuzz-lxc-config-read.c:36:2
#7 0x483643 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
#8 0x46d4a2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
#9 0x4732ea in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
#10 0x49f022 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#11 0x7f16d09b883f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
```
This is a follow-up to https://github.com/lxc/lxc/commit/4fef78bc332a2d186dca6f
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-03-25 09:09:07 +00:00
Christian Brauner
5b1030e26c
confile_utils: don't free netdev twice
...
lxc_free_netdev() will already free the list element.
Fixes: https://github.com/google/oss-fuzz/pull/5498
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 08:23:25 +01:00
Stéphane Graber
38b4b216bb
Merge pull request #3720 from brauner/2021-03-23/fixes
...
strchrnul: fix copy-paste braino
2021-03-23 08:53:36 -04:00
Christian Brauner
10bf1adb43
strchrnul: fix copy-paste braino
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-23 11:34:57 +01:00
Stéphane Graber
678d600f50
Merge pull request #3719 from brauner/2021-03-22/fixes
...
strchrnul: ignore increased required alignment warning
2021-03-22 08:53:52 -04:00
Christian Brauner
09c3ee1390
strchrnul: ignore increased required alignment warning
...
Fixes: https://jenkins.linuxcontainers.org/view/LXC/job/lxc-build-android/7949/console
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-22 10:10:36 +01:00
Stéphane Graber
1d358fe9c0
Merge pull request #3718 from brauner/2021-03-21/fixes_2
...
configure: fix strchrnul conditiona compilation
2021-03-21 11:22:17 -04:00
Christian Brauner
7e4ea7bffd
configure: fix strchrnul conditiona compilation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-21 16:04:35 +01:00
Stéphane Graber
3e7605b397
Merge pull request #3717 from brauner/2021-03-21/fixes
...
include: fix typo
2021-03-21 08:48:50 -04:00
Christian Brauner
5582dd63c3
include: fix typo
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-21 10:08:15 +01:00
Stéphane Graber
f62beebe22
Merge pull request #3716 from brauner/2021-03-19/fixes
...
string_utils: provide a version of strchrnul() in case it's not avail…
2021-03-20 14:56:27 -04:00
Christian Brauner
88cf3229fe
string_utils: provide a version of strchrnul() in case it's not available
...
This should only happen on Android.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-20 12:34:36 +01:00
Stéphane Graber
1718e6d601
Merge pull request #3715 from brauner/2021-03-18/fixes
...
rexec: don't close stderr
2021-03-18 08:43:28 -04:00
Christian Brauner
b75c1e611d
rexec: don't close stderr
...
Otherwise we'll fail to attach to containers later on.
Fixes: https://discuss.linuxcontainers.org/t/error-failed-to-retrieve-pid-of-executing-child-process
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-18 12:12:05 +01:00
Christian Brauner
45580870b0
Merge pull request #3712 from stgraber/master
...
github: Fix invalid syntax for coverity
2021-03-17 21:19:48 +01:00
Stéphane Graber
7b89a43d04
github: Fix invalid syntax for coverity
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-03-17 16:18:07 -04:00
Christian Brauner
e38b519e34
Merge pull request #3711 from stgraber/master
...
Switch to Github actions
2021-03-17 20:58:05 +01:00
Stéphane Graber
4bc1dabe06
Switch to Github actions
...
Travis-CI has been a disaster lately with us running out of credits or
their system thinking we're out of credit anyway...
So with Jenkins now covering arm64, let's move the rest of the CI to
Github Actions instead.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-03-17 15:55:58 -04:00
Stéphane Graber
4fece28fa1
Merge pull request #3710 from brauner/2021-03-17/fixes
...
macro: define __aligned_u64 to handle kernels without such support
2021-03-17 14:52:11 -04:00
Christian Brauner
b1abf15db2
macro: define __aligned_u64 to handle kernels without such support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-17 19:28:26 +01:00
Stéphane Graber
0f1caf26d5
Merge pull request #3708 from brauner/2021-03-17/fixes
...
cgroups: ignore unused controllers
2021-03-17 08:40:27 -04:00
Christian Brauner
6159413bc9
cgroups: ignore unused controllers
...
Someone might have created a name=<controller> controller after the
container has started and so the container doesn't make use of this
controller.
Link: https://github.com/lxc/lxd/issues/8577
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-17 09:24:56 +01:00
Stéphane Graber
f62764977d
Merge pull request #3707 from brauner/2021-03-09/fixes
...
conf: automount fixes
2021-03-09 12:03:00 -05:00
Christian Brauner
96f306e625
conf: add missing newline in lxc_mount_auto_mounts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 11:29:31 +01:00
Christian Brauner
0d33a38209
conf: simplify logging in lxc_mount_auto_mounts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 11:29:03 +01:00
Christian Brauner
75fca1ac47
conf: cleanup automounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 11:27:01 +01:00
Christian Brauner
95258e34b5
conf: ensure that procfs and sysfs are unmounted
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 11:26:13 +01:00
Christian Brauner
ed41e764e8
conf: simplify dependent mount logic
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 10:48:32 +01:00
Christian Brauner
3dd3fc3164
conf: tweak comment about transient procfs mount
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-09 09:56:26 +01:00
Stéphane Graber
90b7adcc5e
Merge pull request #3706 from brauner/2021-03-05/fix_aarch64
...
start: handle CLONE_PIDFD on arm64
2021-03-05 16:46:09 -05:00
Christian Brauner
abd80bded6
start: handle CLONE_PIDFD on arm64
...
Reported-by: Ondrej Kubik <ondrej.kubik@canonical.com>
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-05 19:58:26 +01:00
Stéphane Graber
673ce312c5
Merge pull request #3705 from brauner/fixes
...
attach_options: header improvements
2021-03-05 07:45:54 -05:00
Christian Brauner
6df53e842d
attach_options: add explicit defines for all enums
...
This makes it easier to detect support for various features at compile
time.
Enables: https://github.com/lxc/go-lxc/pull/149
Fixes: https://launchpadlibrarian.net/526273274/buildlog_snap_ubuntu_bionic_i386_lxd-4.0-edge_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-05 10:41:35 +01:00
Christian Brauner
a84c81bfee
attach_options: fix whitespace error in LXC_ATTACH_NO_NEW_PRIVS
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-05 10:14:27 +01:00
Christian Brauner
42b245e3c8
attach_options: explicitly number enums
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-05 10:13:04 +01:00
Christian Brauner
94ce9fb80f
Merge pull request #3704 from tych0/drop-empty-cgroup-check
...
cgroup: do not fail if there are no writable heirarchies
2021-03-02 23:10:40 +01:00
Tycho Andersen
1ecac3bfca
cgroup: do not fail if there are no writable heirarchies
...
This is a spiritual revert of 5c7b81439c
(it
doesn't add back any of the logs, just removes the bad check).
Not having writable hierarchies is not actually a problem:
1. if I remove this check, things work just fine; below is a successful log
of a run where there are no writable hierarchies
2. I believe the test for writability is slightly incorrect.
unified_hierarchy_delegated() and legacy_hierarchy_delegated() both test
the writability of $current_hierarchy/cgroup.procs. On my system, I
have:
~ cat /proc/self/cgroup
12:hugetlb:/
11:pids:/user.slice/user-1000.slice/session-c38.scope
10:memory:/user.slice/user-1000.slice/session-c38.scope
9:freezer:/user/tycho/0
8:cpuset:/
7:net_cls,net_prio:/
6:blkio:/user.slice
5:devices:/user.slice
4:rdma:/
3:cpu,cpuacct:/user.slice
2:perf_event:/
1:name=systemd:/user.slice/user-1000.slice/session-c38.scope
0::/user.slice/user-1000.slice/session-c38.scope
~ ls -al /sys/fs/cgroup/freezer/user/tycho/0/
total 0
drwxr-xr-x 2 tycho tycho 0 Feb 22 09:17 ./
drwxr-xr-x 3 root root 0 Mar 2 14:07 ../
-rw-r--r-- 1 root root 0 Mar 2 14:07 cgroup.clone_children
-rw-r--r-- 1 root root 0 Mar 2 14:09 cgroup.procs
-r--r--r-- 1 root root 0 Mar 2 14:07 freezer.parent_freezing
-r--r--r-- 1 root root 0 Mar 2 14:07 freezer.self_freezing
-rw-r--r-- 1 root root 0 Mar 2 14:07 freezer.state
-rw-r--r-- 1 root root 0 Mar 2 14:07 notify_on_release
-rw-r--r-- 1 root root 0 Mar 2 14:07 tasks
i.e. the cgroup.procs is not writable by me. but since the directory is
owned by me, it is actually usable in the way LXC would use it. When I
start an unprivileged container, it could make a subdirectory in whatever
current hierarchy I happen to be before applying rules.
In any case, let's just revert the bad check for now.
lxc 20210302210944.785 INFO confile - confile.c:set_config_idmaps:2151 - Read uid map: type u nsid 0 hostid 1000 range 1
lxc 20210302210944.785 INFO confile - confile.c:set_config_idmaps:2151 - Read uid map: type u nsid 1 hostid 100001 range 65535
lxc 20210302210944.785 INFO confile - confile.c:set_config_idmaps:2151 - Read uid map: type g nsid 0 hostid 1000 range 1
lxc 20210302210944.785 INFO confile - confile.c:set_config_idmaps:2151 - Read uid map: type g nsid 1 hostid 100001 range 65535
lxc 20210302210944.786 INFO conf - conf.c:userns_exec_mapped_root:4644 - Container root id is mapped to our uid
lxc 20210302210944.799 TRACE commands - commands.c:lxc_cmd:510 - Connection refused - Command "get_init_pid" failed to connect command socket
lxc base 20210302210944.801 TRACE commands - commands.c:lxc_server_init:2065 - Created abstract unix socket "lxc/9beb6bd65573affd/command"
lxc base 20210302210944.801 TRACE start - start.c:lxc_init_handler:726 - Unix domain socket 3 for command server is ready
lxc base 20210302210944.801 TRACE execute - execute.c:lxc_execute:97 - Doing lxc_execute
lxc base 20210302210944.801 WARN apparmor - lsm/apparmor.c:lsm_apparmor_ops_init:1268 - Per-container AppArmor profiles are disabled because the mac_admin capability is missing
lxc base 20210302210944.801 INFO lsm - lsm/lsm.c:lsm_init_static:40 - Initialized LSM security driver AppArmor
lxc base 20210302210944.801 TRACE start - start.c:lxc_init:750 - Initialized LSM
lxc base 20210302210944.801 TRACE start - start.c:lxc_serve_state_clients:448 - Set container state to STARTING
lxc base 20210302210944.801 TRACE start - start.c:lxc_serve_state_clients:451 - No state clients registered
lxc base 20210302210944.801 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn't set in the environment
lxc base 20210302210944.801 TRACE start - start.c:lxc_init:756 - Set container state to "STARTING"
lxc base 20210302210944.801 TRACE start - start.c:lxc_init:812 - Set environment variables
lxc base 20210302210944.801 TRACE start - start.c:lxc_init:817 - Ran pre-start hooks
lxc base 20210302210944.801 TRACE start - start.c:setup_signal_fd:341 - Created signal file descriptor 6
lxc base 20210302210944.801 TRACE start - start.c:lxc_init:826 - Set up signal fd
lxc base 20210302210944.803 INFO conf - conf.c:userns_exec_mapped_root:4644 - Container root id is mapped to our uid
lxc base 20210302210944.803 TRACE terminal - terminal.c:lxc_terminal_map_ids:859 - Chowned terminal 8((null))
lxc base 20210302210944.803 DEBUG terminal - terminal.c:lxc_terminal_peer_default:665 - No such device - The process does not have a controlling terminal
lxc base 20210302210944.803 TRACE start - start.c:lxc_init:834 - Created console
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:legacy_hierarchy_delegated:3076 - Permission denied - The cgroup.procs file is not writable, skipping legacy hierarchy
lxc base 20210302210944.803 INFO cgfsng - cgroups/cgfsng.c:unified_hierarchy_delegated:3066 - Permission denied - The cgroup.threads file is not writable, skipping unified hierarchy
lxc base 20210302210944.803 TRACE cgroup - cgroups/cgroup.c:cgroup_init:49 - Initialized cgroup driver cgfsng
lxc base 20210302210944.803 WARN cgroup - cgroups/cgroup.c:cgroup_init:58 - Unsupported cgroup layout
lxc base 20210302210944.803 TRACE start - start.c:lxc_init:841 - Initialized cgroup driver
lxc base 20210302210944.803 TRACE start - start.c:lxc_init:846 - Read seccomp policy
lxc base 20210302210944.803 TRACE start - start.c:lxc_init:853 - Initialized LSM
lxc base 20210302210944.803 INFO start - start.c:lxc_init:855 - Container "base" is initialized
lxc base 20210302210944.803 TRACE sync - sync.c:lxc_sync_init:141 - Initialized synchronization infrastructure
lxc base 20210302210944.803 TRACE conf - conf.c:lxc_rootfs_prepare:511 - Not pinning because container runs in user namespace
lxc base 20210302210944.804 TRACE start - start.c:lxc_spawn:1732 - Cloned child process 923788
lxc base 20210302210944.804 TRACE utils - utils.c:lxc_can_use_pidfd:1799 - Kernel supports pidfds
lxc base 20210302210944.804 INFO start - start.c:lxc_spawn:1748 - Cloned CLONE_NEWUSER
lxc base 20210302210944.804 INFO start - start.c:lxc_spawn:1748 - Cloned CLONE_NEWNS
lxc base 20210302210944.804 INFO start - start.c:lxc_spawn:1748 - Cloned CLONE_NEWPID
lxc base 20210302210944.804 INFO start - start.c:lxc_spawn:1748 - Cloned CLONE_NEWUTS
lxc base 20210302210944.804 INFO start - start.c:lxc_spawn:1748 - Cloned CLONE_NEWIPC
lxc base 20210302210944.804 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved user namespace via fd 15 and stashed path as user:/proc/923785/fd/15
lxc base 20210302210944.804 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved mnt namespace via fd 16 and stashed path as mnt:/proc/923785/fd/16
lxc base 20210302210944.804 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved pid namespace via fd 17 and stashed path as pid:/proc/923785/fd/17
lxc base 20210302210944.804 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved uts namespace via fd 18 and stashed path as uts:/proc/923785/fd/18
lxc base 20210302210944.804 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved ipc namespace via fd 19 and stashed path as ipc:/proc/923785/fd/19
lxc base 20210302210944.804 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2798 - The binary "/usr/bin/newuidmap" does have the setuid bit set
lxc base 20210302210944.804 DEBUG conf - conf.c:idmaptool_on_path_and_privileged:2798 - The binary "/usr/bin/newgidmap" does have the setuid bit set
lxc base 20210302210944.804 DEBUG conf - conf.c:lxc_map_ids:2866 - Functional newuidmap and newgidmap binary found
lxc base 20210302210944.813 TRACE sync - sync.c:lxc_sync_wait_parent:112 - Parent waiting for child with sequence startup
lxc base 20210302210944.825 TRACE conf - conf.c:lxc_map_ids:2936 - newuidmap wrote mapping "newuidmap 923788 0 1000 1 1 100001 65535"
lxc base 20210302210944.834 TRACE conf - conf.c:lxc_map_ids:2936 - newgidmap wrote mapping "newgidmap 923788 0 1000 1 1 100001 65535"
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_wake_child:124 - Child waking parent with sequence startup
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_wait_child:118 - Child waiting for parent with sequence configure
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_barrier_parent:92 - Child waking parent with sequence configure and waiting for sequence post-configure
lxc base 20210302210944.834 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved net namespace via fd 4 and stashed path as net:/proc/923785/fd/4
lxc base 20210302210944.834 WARN start - start.c:lxc_spawn:1821 - Operation not permitted - Failed to allocate new network namespace id
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_barrier_child:99 - Parent waking child with sequence post-configure and waiting with sequence cgroup
lxc base 20210302210944.834 NOTICE utils - utils.c:lxc_drop_groups:1345 - Dropped supplimentary groups
lxc base 20210302210944.834 NOTICE utils - utils.c:lxc_switch_uid_gid:1321 - Switched to gid 0
lxc base 20210302210944.834 NOTICE utils - utils.c:lxc_switch_uid_gid:1330 - Switched to uid 0
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_barrier_parent:92 - Child waking parent with sequence cgroup and waiting for sequence cgroup-unshare
lxc base 20210302210944.834 TRACE sync - sync.c:lxc_sync_barrier_child:99 - Parent waking child with sequence cgroup-unshare and waiting with sequence cgroup-limits
lxc base 20210302210944.834 INFO start - start.c:do_start:1196 - Unshared CLONE_NEWCGROUP
lxc base 20210302210944.834 TRACE conf - conf.c:turn_into_dependent_mounts:3192 - Turned all mount table entries into dependent mount
lxc base 20210302210944.834 DEBUG storage - storage/storage.c:get_storage_by_name:211 - Detected rootfs type "dir"
lxc base 20210302210944.835 TRACE dir - storage/dir.c:dir_mount:166 - Mounted "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/roots/base/rootfs" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot" with options "(null)", mount flags "0", and propagation flags "0"
lxc base 20210302210944.835 DEBUG conf - conf.c:lxc_mount_rootfs:1289 - Mounted rootfs "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/roots/base/rootfs" onto "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot" with options "(null)"
lxc base 20210302210944.835 INFO conf - conf.c:setup_utsname:732 - Set hostname to "base"
lxc base 20210302210944.835 INFO conf - conf.c:mount_autodev:1068 - Preparing "/dev"
lxc base 20210302210944.835 TRACE mount_utils - mount_utils.c:can_use_mount_api:486 - Kernel supports mount api
lxc base 20210302210944.835 TRACE mount_utils - mount_utils.c:__fs_prepare:158 - Finished initializing new tmpfs filesystem context 16
lxc base 20210302210944.835 TRACE mount_utils - mount_utils.c:fs_set_property:196 - Set "mode" to "0755" on filesystem context 16
lxc base 20210302210944.835 TRACE mount_utils - mount_utils.c:fs_set_property:196 - Set "size" to "500000" on filesystem context 16
lxc base 20210302210944.835 TRACE mount_utils - mount_utils.c:fs_attach:235 - Mounted 18 onto 17
lxc base 20210302210944.835 INFO conf - conf.c:mount_autodev:1128 - Prepared "/dev"
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2077 - Mounted "none" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/dev/shm" with filesystem type "tmpfs"
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2014 - Remounting "/sys" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/sys" to respect bind or remount options
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2033 - Flags for "/sys" were 4110, required extra flags are 14
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2077 - Mounted "/sys" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/sys" with filesystem type "none"
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2014 - Remounting "/etc/resolv.conf" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/etc/resolv.conf" to respect bind or remount options
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2033 - Flags for "/etc/resolv.conf" were 4110, required extra flags are 14
lxc base 20210302210944.835 DEBUG conf - conf.c:mount_entry:2077 - Mounted "/etc/resolv.conf" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/etc/resolv.conf" with filesystem type "none"
lxc base 20210302210944.836 DEBUG conf - conf.c:mount_entry:2014 - Remounting "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/imports/base" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/stacker" to respect bind or remount options
lxc base 20210302210944.836 DEBUG conf - conf.c:mount_entry:2033 - Flags for "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/imports/base" were 4096, required extra flags are 0
lxc base 20210302210944.836 DEBUG conf - conf.c:mount_entry:2077 - Mounted "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/imports/base" on "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot/stacker" with filesystem type "none"
lxc base 20210302210944.836 INFO conf - conf.c:lxc_fill_autodev:1165 - Populating "/dev"
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/full) to 16(full)
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/null) to 16(null)
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/random) to 16(random)
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/tty) to 16(tty)
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/urandom) to 16(urandom)
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_fill_autodev:1245 - Bind mounted host device 14(dev/zero) to 16(zero)
lxc base 20210302210944.836 INFO conf - conf.c:lxc_fill_autodev:1249 - Populated "/dev"
lxc base 20210302210944.836 INFO conf - conf.c:lxc_transient_proc:3044 - Caller's PID is 1; /proc/self points to 1
lxc base 20210302210944.836 TRACE conf - conf.c:lxc_transient_proc:3052 - Correct procfs instance mounted
lxc base 20210302210944.836 TRACE mount_utils - mount_utils.c:fd_bind_mount:289 - Attach detached mount 19 to filesystem at 20
lxc base 20210302210944.836 DEBUG conf - conf.c:lxc_setup_dev_console:1734 - Mounted pty device 8(/dev/pts/11) onto "/dev/console"
lxc base 20210302210944.839 TRACE conf - conf.c:lxc_pivot_root:1459 - Changed into new rootfs "/home/tycho/packages/stacker/stackertest-test_stacker_switching_privilege_modes_fails.Og4LqB/.stacker/rootfsPivot"
lxc base 20210302210944.839 DEBUG conf - conf.c:lxc_setup_devpts_child:1574 - Mount new devpts instance with options "gid=5,newinstance,ptmxmode=0666,mode=0620,max=1024"
lxc base 20210302210944.839 TRACE conf - conf.c:lxc_setup_devpts_child:1587 - Sent devpts file descriptor 8 to parent
lxc base 20210302210944.839 DEBUG conf - conf.c:lxc_setup_devpts_child:1602 - Created dummy "/dev/ptmx" file as bind mount target
lxc base 20210302210944.839 DEBUG conf - conf.c:lxc_setup_devpts_child:1607 - Bind mounted "/dev/pts/ptmx" to "/dev/ptmx"
lxc base 20210302210944.839 DEBUG conf - conf.c:setup_caps:2487 - Capabilities have been setup
lxc base 20210302210944.839 NOTICE conf - conf.c:lxc_setup:3576 - The container "base" is set up
lxc base 20210302210944.839 TRACE apparmor - lsm/apparmor.c:__apparmor_process_label_open:405 - On-exec not supported with AppArmor
lxc base 20210302210944.839 TRACE apparmor - lsm/apparmor.c:apparmor_process_label_set_at:1166 - Changing AppArmor profile on exec not supported
lxc base 20210302210944.839 INFO apparmor - lsm/apparmor.c:apparmor_process_label_set_at:1179 - Set AppArmor label to "lxc-container-default-cgns"
lxc base 20210302210944.839 INFO apparmor - lsm/apparmor.c:apparmor_process_label_set:1224 - Changed AppArmor profile to lxc-container-default-cgns
lxc base 20210302210944.842 TRACE sync - sync.c:lxc_sync_barrier_parent:92 - Child waking parent with sequence cgroup-limits and waiting for sequence ready-start
lxc base 20210302210944.842 TRACE start - start.c:lxc_spawn:1872 - Set up legacy device cgroup controller limits
lxc base 20210302210944.842 TRACE start - start.c:lxc_spawn:1878 - Set up cgroup2 device controller limits
lxc base 20210302210944.842 DEBUG start - start.c:lxc_try_preserve_namespace:139 - Preserved cgroup namespace via fd 10 and stashed path as cgroup:/proc/923785/fd/10
lxc base 20210302210944.842 TRACE start - start.c:lxc_spawn:1892 - Finished setting up cgroups
lxc base 20210302210944.842 TRACE sync - sync.c:lxc_sync_barrier_child:99 - Parent waking child with sequence ready-start and waiting with sequence restart
lxc base 20210302210944.842 NOTICE execute - execute.c:execute_start:66 - Exec'ing "/stacker/.stacker-run.sh"
lxc base 20210302210944.842 TRACE conf - conf.c:lxc_setup_devpts_parent:1519 - Received devpts file descriptor 20 from child
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:244 - index: 0
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:245 - ifindex: 0
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:311 - type: none
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:319 - flags: none
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:344 - ipv4 gateway auto: false
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:347 - ipv4 gateway dev: false
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:363 - ipv6 gateway auto: false
lxc base 20210302210944.842 TRACE confile_utils - confile_utils.c:lxc_log_configured_netdevs:366 - ipv6 gateway dev: false
lxc base 20210302210944.842 NOTICE execute - execute.c:execute_post_start:82 - '/stacker/.stacker-run.sh' started with pid '923788'
lxc base 20210302210944.842 TRACE start - start.c:lxc_serve_state_clients:448 - Set container state to RUNNING
lxc base 20210302210944.842 TRACE start - start.c:lxc_serve_state_clients:451 - No state clients registered
lxc base 20210302210944.842 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn't set in the environment
lxc base 20210302210944.842 TRACE start - start.c:lxc_poll:602 - Mainloop is ready
lxc base 20210302210944.842 NOTICE start - start.c:signal_handler:414 - Received 17 from pid 923789 instead of container init 923788
lxc base 20210302210944.862 DEBUG start - start.c:signal_handler:432 - Container init process 923788 exited
lxc base 20210302210944.862 TRACE start - start.c:lxc_poll:615 - Closed console mainloop
lxc base 20210302210944.862 TRACE start - start.c:lxc_poll:620 - Closed mainloop
lxc base 20210302210944.862 TRACE start - start.c:lxc_poll:623 - Closed signal file descriptor 6
lxc base 20210302210944.862 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn't set in the environment
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_USER_NS=/proc/923785/fd/15
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_MNT_NS=/proc/923785/fd/16
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_PID_NS=/proc/923785/fd/17
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_UTS_NS=/proc/923785/fd/18
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_IPC_NS=/proc/923785/fd/19
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_NET_NS=/proc/923785/fd/4
lxc base 20210302210944.862 TRACE start - start.c:lxc_expose_namespace_environment:883 - Set environment variable LXC_CGROUP_NS=/proc/923785/fd/10
lxc base 20210302210944.862 DEBUG network - network.c:lxc_delete_network:4167 - Deleted network devices
lxc base 20210302210944.862 TRACE start - start.c:lxc_serve_state_clients:448 - Set container state to STOPPING
lxc base 20210302210944.862 TRACE start - start.c:lxc_serve_state_clients:451 - No state clients registered
lxc base 20210302210944.862 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn't set in the environment
lxc base 20210302210944.862 TRACE start - start.c:lxc_end:940 - Closed command socket
lxc base 20210302210944.862 INFO utils - utils.c:get_rundir:260 - XDG_RUNTIME_DIR isn't set in the environment
lxc base 20210302210944.862 TRACE start - start.c:lxc_end:951 - Set container state to "STOPPED"
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2021-03-02 14:19:05 -07:00
Stéphane Graber
b49f36bcdb
Merge pull request #3700 from brauner/2021-02-26/fixes_2
...
small fixes
2021-02-26 18:06:49 -05:00
Christian Brauner
cfe6f43599
start: fix whitespace error
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 22:37:55 +01:00
Christian Brauner
d961ebd945
af_unix: vet all parameters
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 22:37:30 +01:00
Stéphane Graber
88e27cd641
Merge pull request #3699 from brauner/2021-02-26/network
...
network: fix networks with switched names
2021-02-26 09:47:26 -05:00
Christian Brauner
3a197a1b63
network: use two passes through networks
...
Consider the following network layout:
lxc.net.0.type = phys
lxc.net.0.link = eth2
lxc.net.0.name = eth%d
lxc.net.1.type = phys
lxc.net.1.link = eth1
lxc.net.1.name = eth0
If we simply follow this order and create the first network first the kernel
will allocate eth0 for the first network but the second network requests
that eth1 be renamed to eth0 in the container's network namespace which
would lead to a clash.
Note, we don't handle cases like:
lxc.net.0.type = phys
lxc.net.0.link = eth2
lxc.net.0.name = eth0
lxc.net.1.type = phys
lxc.net.1.link = eth1
lxc.net.1.name = eth0
That'll brutally fail of course but there's nothing we can do about it. But
this can happen when e.g. a has the following LXD configuration:
devices:
eth2:
name: eth0
nictype: physical
parent: eth2
type: nic
eth3:
name: eth0
nictype: physical
parent: eth3
type: nic
in the container's config and the default profile has:
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 15:12:40 +01:00
Christian Brauner
fdd6be55c1
network: handle name collisions when renaming network devices
...
LXC moves network devices into the target namespace based on their created
name. The created name can either be randomly generated for e.g. veth
devices or it can be the name of the existing device in the server's
namespaces. This is e.g. the case when moving physical devices. However this
can lead to weird clashes. Consider we have a network namespace that has the
following devices:
4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:16:3e:91:d3:ae brd ff:ff:ff:ff:ff:ff permaddr 00:16:3e:e7:5d:10
altname enp7s0
5: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:16:3e:e7:5d:10 brd ff:ff:ff:ff:ff:ff permaddr 00:16:3e:91:d3:ae
altname enp8s0
and the user generates the following network config for their container:
lxc.net.0.type = phys
lxc.net.0.name = eth1
lxc.net.0.link = eth2
lxc.net.1.type = phys
lxc.net.1.name = eth2
lxc.net.1.link = eth1
This would cause LXC to move the devices eth1 and eth2 from the server's
network namespace into the container's network namespace:
24: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:16:3e:91:d3:ae brd ff:ff:ff:ff:ff:ff permaddr 00:16:3e:e7:5d:10
altname enp7s0
25: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:16:3e:e7:5d:10 brd ff:ff:ff:ff:ff:ff permaddr 00:16:3e:91:d3:ae
altname enp8s0
According to the network config above we now need to rename the network
devices in the container's network namespace. Let's say we start with
renaming eth2 to eth1. This would immediately lead to a clash since the
container's network namespace already contains a network device with that
name. Renaming the other device would have the same problem.
There are multiple ways to fix this but I'm concerned with keeping the logic
somewhat reasonable which is why we simply start creating transient device
names that are unique which we'll use to move and rename the network device
in the container's network namespace at the same time. And then we rename
based on those random devices names to the target name.
Fixes : #3696
Reported-by: Sam Boyles <sam.boyles@alliedtelesis.co.nz>
Reported-by: Blair Steven <blair.steven@alliedtelesis.co.nz>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 15:12:40 +01:00
Christian Brauner
3392d37941
network: add lxc_network_info struct
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 14:20:07 +01:00
Christian Brauner
4a037d618e
network: fix grammar
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 14:20:05 +01:00
Christian Brauner
9dffc40e2a
confile_utils: ensure memory is zeroed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 13:37:06 +01:00
Christian Brauner
071d09345f
network: fix coding style in lxc_create_network_unpriv_exec()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 12:36:42 +01:00
Christian Brauner
bad2f9131a
network: make callback naming consistent and understandable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 12:36:09 +01:00
Stéphane Graber
32d4045252
Merge pull request #3698 from brauner/2021-02-25/fixes
...
tree-wide: some more logging fixes
2021-02-25 22:12:08 -05:00
Christian Brauner
815c378b9b
tree-wide: replace old-style sysinfo logging return helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:45:39 +01:00
Christian Brauner
b1b38fd16d
tree-wide: replace old systrace logging helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:44:12 +01:00
Christian Brauner
6d95e0b7e9
tree-wide: use new logging helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:42:09 +01:00
Christian Brauner
81d90ee560
log: mark logging helpers to use
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:39:35 +01:00
Christian Brauner
9fc21b2d84
tree-wide: replace remaining instances of syserrno() with syserror_ret()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
2d7b089590
tree-wide: start replacing instances of syserrno() with syserror()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
060aaa395a
tree-wide: s/syerrno_set()/syserror_set()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
6d829cd2da
commands: unify fd retrieval commands
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
89d51b22cc
commands: fix indentation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
46b576e56d
commands: rsp_one_fd_{reap,keep}() and rsp_many_fds_reap()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
5f241268dc
commands: cleanup error handling and variable naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Stéphane Graber
cca31bf0ac
Merge pull request #3697 from brauner/2021-02-25/fixes
...
commands: improvements and fixes
2021-02-25 18:24:07 -05:00
Christian Brauner
885bb002a5
commands: port misnamed functions to general style
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:20 +01:00
Christian Brauner
daad4f954c
commands: use debug logging
...
It is fine to fail these commands when a new client talks to an old server or
the kernel doesn't support the necessary features.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:20 +01:00
Christian Brauner
8aa82616b1
log: add some more log and return helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:14 +01:00
Christian Brauner
161e4bef90
tests: add logging to lxc-test-lxc-attach
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:45 +01:00
Christian Brauner
d2560c4e21
commands: improve lxc_cmd_get_tty_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:45 +01:00
Christian Brauner
3a9daa046c
commands: rework lxc_cmd_rsp_recv() to make it more obvious
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:44 +01:00
Christian Brauner
780215cf0d
af_unix: allow caller and callee to negotiate expectations and reality
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 16:05:06 +01:00
Christian Brauner
265dc73af6
macro: add hweight*() helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 13:49:29 +01:00
Christian Brauner
57fc2dd7e6
commands: let lxc_cmd() return ssize_t to indicate that it returns not just 0 on success
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
962c70c562
commands: port lxc_cmd_get_limit_cgroup2_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
dab4f69fe0
commands: port lxc_cmd_get_cgroup2_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
3d7661aa67
commands: port lxc_cmd_get_limit_cgroup_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
e83494bb56
commands: port lxc_cmd_get_cgroup_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
558cb2b58d
commands: port lxc_cmd_unfreeze() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
ac91e5151b
commands: port lxc_cmd_freeze() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
6e66211771
commands: port lxc_cmd_seccomp_notify_add_listener() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
c58b63fe12
commands: port lxc_cmd_serve_state_clients() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
dda7dc08f5
commands: port lxc_cmd_console_log() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
9338a6f341
commands: port lxc_cmd_add_bpf_device_cgropu() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
3de3c9e365
commands: port lxc_cmd_add_state_client() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
9dca720777
commands: port lxc_cmd_get_lxcpath() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
16fcb1fed0
commands: port lxc_cmd_get_name() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
1a37ba9d55
commands: port lxc_get_tty_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
dbdd56c120
commands: port lxc_cmd_stop() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
1b08494ee5
commands: port lxc_cmd_get_state() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
187e46ab32
commands: port lxc_cmd_get_config_item() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f85d2385c0
commands: portlxc_cmd_get_cgroup_path_do() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
b4e1a2e8e7
commands: port lxc_cmd_get_clone_flags() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
19d141f686
commands: port lxc_cmd_get_cgroup_ctx() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f0af908257
commands: port lxc_cmd_get_seccomp_notify_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f7a7b0955a
commands: port lxc_cmd_get_devpts_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
7208e700bb
commands: port lxc_cmd_get_init_pidfd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
22642823ac
commands: port lxc_cmd_get_init_pid() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
38d14ebda6
commands: port lxc_try_cmd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
58a8d1f07d
commands: add lxc_cmd_init() and lxc_cmd_data()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
6834acfffb
commands: s/lxc_cmd_init()/lxc_server_init()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:55:22 +01:00
Christian Brauner
8a598112dd
commands: switch to bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:32:19 +01:00
Christian Brauner
0437eac569
commands: use IN_SET() in lxc_cmd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:23:27 +01:00
Stéphane Graber
2be31fed40
Merge pull request #3695 from brauner/2021-02-24/fixes_3
...
commands: array hardening
2021-02-24 11:32:07 -05:00
Christian Brauner
3d97131917
commands: ensure that non-NULL and MAX_STATE is always passed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 16:58:21 +01:00
Christian Brauner
e848413e2a
commands: annotate array argument
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 16:47:43 +01:00
Stéphane Graber
2ed90529b4
Merge pull request #3694 from brauner/2021-02-24/fixes_2
...
commands: rework and add LXC_CMD_GET_CGROUP_FD and LXC_CMD_GET_LIMIT_CGROUP_FD
2021-02-24 10:36:10 -05:00
Christian Brauner
7e85a2c423
commands: s/LXC_CMD_CONSOLE/LXC_CMD_GET_TTY_FD/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 16:07:23 +01:00
Christian Brauner
abb6f6572c
commands: add LXC_CMD_GET_CGROUP_FD and LXC_CMD_GET_LIMIT_CGROUP_FD
...
and port cgroup_get() and cgroup_set(). This means no more useless cgroup
driver initialization on ever get or set.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 15:59:13 +01:00
Christian Brauner
124b60ec3e
commands: extend rsp_one_fd() to also handle additional data
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 15:32:06 +01:00
Christian Brauner
53be29113c
file_utils: actually open the file for reading
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 15:32:05 +01:00
Christian Brauner
28c738ebe0
commands: set rsp.ret to 0 for lxc_cmd_get_cgroup_ctx_callback()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 11:53:53 +01:00
Christian Brauner
61983e15d2
cgroups: s/cgroup_layout/layout/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 11:31:55 +01:00
Christian Brauner
c206ac24b3
commands: add LXC_CMD_GET_CGROUP_FD and LXC_CMD_GET_LIMIT_CGROUP_FD
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 11:11:08 +01:00
Christian Brauner
a9b642ee5c
commands: s/_LIMITING_/_LIMIT_/g and s/_limiting_/_limit_/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 11:06:06 +01:00
Christian Brauner
bce2970f80
commands: simplify lxc_cmd_get_cgroup_ctx()
...
Instead of allowing individual hierarchy fd retrieval through
lxc_cmd_get_cgroup_ctx() let's add a dedicated method instead.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:47:40 +01:00
Christian Brauner
ac5eacc62e
commands: fix alignment for lxc_cmd_get_cgroup_ctx()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:46:07 +01:00
Christian Brauner
8dfcf0df6c
cgroups: handle fallback gracefully
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:41:32 +01:00
Christian Brauner
f740bc6343
cgroups: make use of ERRNO_IS_NOT_SUPPORTED()
...
This will hopefully prevent backwards compatibility fallback errors.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:37:13 +01:00
Christian Brauner
7924f36a15
error_utils: copy over Lennart's IN_SET()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:37:01 +01:00
Christian Brauner
5dc24a8c28
commands: tweak return values
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:37:01 +01:00
Christian Brauner
38fa7e479c
error_utils: move error helper to separate header
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 09:37:00 +01:00
Christian Brauner
9d3480dab4
cgroups: simple variable reordering
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 08:58:56 +01:00
Stéphane Graber
5dc90afd49
Merge pull request #3692 from brauner/2021-02-23/fixes
...
build fix & cgroup braino
2021-02-23 20:17:52 -05:00
Christian Brauner
6ee13f5be7
attach: be paranoid about file descriptors
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 01:53:05 +01:00
Christian Brauner
327baffea3
cgroups: fix braino during controller list creation
...
Co-mounted controllers are conventionally separated by ",".
Fixes: https://jenkins.linuxcontainers.org/job/lxd-github-commit/1905/arch=amd64,backend=dir,compiler=golang-1.15/consoleFull
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 01:37:54 +01:00
Christian Brauner
70ba94fb0a
commands: remove faulty use of access attribute
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 01:01:17 +01:00
Stéphane Graber
162402ccc1
Merge pull request #3691 from brauner/2021-02-23/fixes
...
Fix issues reported by Coverity
2021-02-23 16:53:23 -05:00
Christian Brauner
2d8b9ab865
cgroups: fix error checking
...
Fixes: Coverity 1473310
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 22:11:22 +01:00
Christian Brauner
92fea74bfe
af_unix: prevent oob writes
...
Fixes: Coverity 1473309
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 22:08:48 +01:00
Christian Brauner
1454e5d9a0
commands: only deref once
...
Fixes: Coverity 1473308
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 22:07:11 +01:00
Stéphane Graber
be7715476f
Merge pull request #3690 from brauner/2021-02-21/fixes
...
attach: improve attaching of new clients to old servers
2021-02-23 15:49:38 -05:00
Christian Brauner
7ec5eee4f0
commands: handle old clients for LXC_CMD_GET_CGROUP_CTX
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 21:11:10 +01:00
Christian Brauner
bef8f78473
attach: handle new and old clients
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 21:11:09 +01:00
Christian Brauner
8723f88e9a
attach: make fd sending more uniform
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 21:11:09 +01:00
Christian Brauner
550ede0a94
terminal: dumb logging down
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 21:11:07 +01:00
Stéphane Graber
b6f4863739
Merge pull request #3689 from brauner/2021-02-21/fixes
...
cgroups: introduce fd-only cgroup attach via LXC_CMD_GET_CGROUP_CTX
2021-02-23 15:08:04 -05:00
Christian Brauner
3a6678c7fb
attach: fix namespace preservation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 20:36:29 +01:00
Christian Brauner
00df53300b
commands: verify expected file descriptors were sent
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 19:39:36 +01:00
Christian Brauner
8a95cd8271
commands: handle older clients gracefully
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 19:20:21 +01:00
Christian Brauner
7184e9d280
attach: remove additional newline
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 19:05:09 +01:00
Christian Brauner
8af9b5dadb
af_unix: add comment about cast
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 19:00:42 +01:00
Christian Brauner
fb54db2c34
attach: fix unsupported namespaces
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 18:59:07 +01:00
Christian Brauner
254a22e17f
commands: lxc_cmd_add_state_client_callback()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 18:45:22 +01:00
Christian Brauner
d3be623e3c
commands: handle older clients elegantly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 18:45:19 +01:00
Christian Brauner
ebc548a1ef
commands: send ENOSYS response
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:32 +01:00
Christian Brauner
c071c112d3
cgroups: introduce fd-only cgroup attach
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:32 +01:00
Christian Brauner
ef6e048a03
commands: introduce LXC_CMD_GET_CGROUP_CTX
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:32 +01:00
Christian Brauner
9ec1d9db36
utils: add copy_struct_to_client()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:32 +01:00
Christian Brauner
c965e8015f
log: add syswarn_set()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:31 +01:00
Christian Brauner
d329cda71b
utils: add copy_struct_from_client()
...
Which is our variant of copy_struct_from_user() that Aleksa and I added to the
kernel.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:31 +01:00
Christian Brauner
a1feaf2944
macro: add min() macro
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:31 +01:00
Christian Brauner
2092492ca6
cgroups: allow cgroup fd batch retrieval
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:31 +01:00
Christian Brauner
f8cc4ae8be
commands: add LXC_CMD_GET_CGROUP_FD
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:30 +01:00
Christian Brauner
9c3eb8d525
commands: introduce rsp_many_fds()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:30 +01:00
Christian Brauner
c2f4008889
commands: introduce rsp_one_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:30 +01:00
Christian Brauner
4b5f4bdcde
commands: introduce lxc_cmd_rsp_send_reap()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 16:15:28 +01:00
Christian Brauner
32fd8d4f85
commands: be more explicit during command processing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 13:57:45 +01:00
Christian Brauner
89420aff36
state: _never_ return NULL from lxc_state2str()
...
Cc: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 13:57:44 +01:00
Christian Brauner
c674e0f6e7
cgroups: add cgroup_fds() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 13:57:44 +01:00
Christian Brauner
d17c815ded
af_unix: improve SCM_RIGHTS file descriptor retrieval
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-23 13:57:42 +01:00
Christian Brauner
da63ea6b4d
commands: tweak validate_string_request()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:02 +01:00
Christian Brauner
61cebd7a1b
commands: explicitly number enums
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:02 +01:00
Christian Brauner
840eec19c3
cgroups: close dfd_mon but keep dfd_con and dfd_lim open for all cgroup hierarchies
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:02 +01:00
Christian Brauner
d39f72b8b6
cgroups: start stashing all fds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:02 +01:00
Christian Brauner
7f02fd24f7
cgroups: skip and warn about invalid file descriptors
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:02 +01:00
Christian Brauner
1d5446120b
memory_utils: fix close_equal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-22 21:40:00 +01:00
Stéphane Graber
793996583c
Merge pull request #3688 from brauner/2021-02-19/fixes_2
...
cgroups: rework cgroup initialization
2021-02-22 14:52:25 -05:00
Christian Brauner
c7a1f72aca
cgroups: handle lxc.cgroup.use global parameter
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:33:43 +01:00
Christian Brauner
b8a4fe1282
cgroups: fix cg_legacy_freeze() return type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:33:43 +01:00
Christian Brauner
2e85effb00
file_utils: tweak lxc_write_openat()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:33:43 +01:00
Christian Brauner
ca72ccb50f
cgroups: improve utility controller handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:32:56 +01:00
Christian Brauner
042f9e9c75
cgroups: s/cgroup2_chown/delegate/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:18:28 +01:00
Christian Brauner
4cd3a76456
cgroups: move cgroup2 parameters into substruct
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 14:15:18 +01:00
Christian Brauner
b1b1a60f16
cgroups: s/container_limit_path/path_lim/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:26:30 +01:00
Christian Brauner
67ed60ce6b
cgroups: s/container_full_path/path_con/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:26:29 +01:00
Christian Brauner
c0af7b1c96
cgroups: s/cgfd_limit/dfd_lim/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:41 +01:00
Christian Brauner
6a32c81772
cgroups: s/cgfd_mon/dfd_mon/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:41 +01:00
Christian Brauner
e33870e511
cgroups: s/cgfd_con/dfd_con/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:41 +01:00
Christian Brauner
a58be2ad8b
cgroups: s/mountpoint/at_mnt/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:41 +01:00
Christian Brauner
44585f1a90
cgroups: s/container_base_path/at_base/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:41 +01:00
Christian Brauner
e18e905394
cgroups: rename cgroupfs mount fd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 11:25:38 +01:00
Christian Brauner
a9db9474ae
cgroups: simplify and fix mounting on non-cgroup namespace aware kernels
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 01:40:11 +01:00
Christian Brauner
b8572e8c2f
cgroups: introduce cgroup hierarchy type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 01:28:45 +01:00
Christian Brauner
e821c3b74a
cgroups: remove unused helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 01:25:49 +01:00
Christian Brauner
179754a25e
cgroups: s/add_hierarchy()/cgroup_hierarchy_add()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 01:09:33 +01:00
Christian Brauner
0da35ac723
cgroups: split delegation checks into separate helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 01:07:12 +01:00
Christian Brauner
63ba9eafcf
cgroups: simplify string list handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 00:46:23 +01:00
Christian Brauner
35ec1a385a
cgroups: rework cgroup initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-21 00:18:09 +01:00
Christian Brauner
0e3af26b2f
cgroups: split out unified cgroup helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 03:17:47 +01:00
Christian Brauner
6407ddf4da
memory_utils: adapt to new pointer error macros
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 03:17:46 +01:00
Christian Brauner
844d929d2e
macro: add pointer error encoding support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 01:36:00 +01:00
Christian Brauner
45069107aa
compiler: add likely() and unlikely() support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 01:33:23 +01:00
Christian Brauner
0eb3b1ceed
cgroups: s/basecginfo/cgroup_info/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 01:10:53 +01:00
Christian Brauner
8033666ce2
cgroups: simplify current cgroup retrieval on pure unified cgroup layouts
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 01:07:43 +01:00
Christian Brauner
a96be3c335
cgroups: tweak return values
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 00:49:25 +01:00
Christian Brauner
0fbf99d600
cgroups: tweak lxc.cgroup.use handling in __cgroup_init()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 00:43:43 +01:00
Christian Brauner
7a0c8ed32c
cgroups: s/must_copy_string()/strdup()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 00:40:32 +01:00
Christian Brauner
0d83967fa3
cgroups: avoid additional variable for single access
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-20 00:38:57 +01:00
Christian Brauner
37ac0b481d
cgroups: fix prune_init_scope()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 18:25:30 +01:00
Christian Brauner
d9be3d2694
string_utils: move lxc_iterate_parts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 18:09:13 +01:00
Stéphane Graber
c33840f6f9
Merge pull request #3684 from brauner/2021-02-18/fixes_2
...
bpf: device cgroup improvements
2021-02-19 12:04:56 -05:00
Stéphane Graber
02882d8358
Merge pull request #3687 from brauner/2021-02-19/fixes
...
lsm: fixes
2021-02-19 11:58:43 -05:00
Christian Brauner
54dbe498b9
doc: tweak cgroup headline
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:29 +01:00
Christian Brauner
5025f3a690
doc: epxlain eBPF-based device controller semantics
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:29 +01:00
Christian Brauner
e9b3d28df4
doc: add missing ".[controller file] suffix to lxc.cgroup{2}. key explanations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:27 +01:00
Christian Brauner
0ede37250c
bpf: update device cgroup semantics
...
LXC has supported the bpf device controlller for a while now. A bpf device
program can be attached to the container's cgroup if this is a pure cgroup2
host.
The format for specifying device rules for the cgroup2 bpf device controller is
the same as for the legacy cgroup device controller; only the configuration key
prefix has to change. Specifically, device rules for the legacy cgroup device
controller are specified by via lxc.cgroup.devices.{allow,deny} whereas for the
cgroup2 bpf device controller lxc.cgroup2.devices.{allow,deny} must be used.
The following semantics apply:
1. The device rule "lxc.cgroup2.devices.deny = a" will cause LXC to instruct
the kernel to block access to all devices by default. To grant access to
devices "allow device rules" must be added via the
"lxc.cgroup2.devices.allow" key. This is referred to as a "allowlist" device
program.
2. The device rule "lxc.cgroup2.devices.allow = a" will cause LXC to instruct
the kernel to allow access to all devices by default. To deny access to
devices "deny device rules" must be added via "lxc.cgroup2.devices.deny"
key. This is referred to as a "denylist" device program.
3. Specifying a rule as explained in 1. or 2. will cause all previous rules to
be cleared, i.e. the device list will be reset.
For example the set of rules:
lxc.cgroup2.devices.deny = a
lxc.cgroup2.devices.allow = c *:* m
lxc.cgroup2.devices.allow = b *:* m
lxc.cgroup2.devices.allow = c 1:3 rwm
implements a "allowlist" device program, i.e. the kernel will block access to
all devices not specifically allowed in this list. This particular program
states that all character and block devices might be created but only /dev/null
might be read or written.
If we to switch to the set of rules to:
lxc.cgroup2.devices.allow = a
lxc.cgroup2.devices.deny = c *:* m
lxc.cgroup2.devices.deny = b *:* m
lxc.cgroup2.devices.deny = c 1:3 rwm
then LXC would instruct the kernel to implement a "denylist", i.e. the kernel
will allow access to all devices not specifically denied in this list. This
particular program states that no character devices or block devices might be
created and that /dev/null is not allow allowed to be read, written, or
created.
Consider the same program but followed by a rule as explained in 1. or 2.:
lxc.cgroup2.devices.allow = a
lxc.cgroup2.devices.deny = c *:* m
lxc.cgroup2.devices.deny = b *:* m
lxc.cgroup2.devices.deny = c 1:3 rwm
lxc.cgroup2.devices.allow = a
The last line will cause LXC to reset the device list without changing the type
of device program.
lxc.cgroup2.devices.allow = a
lxc.cgroup2.devices.deny = c *:* m
lxc.cgroup2.devices.deny = b *:* m
lxc.cgroup2.devices.deny = c 1:3 rwm
lxc.cgroup2.devices.deny = a
The last line will cause LXC to reset the device list and switch from a
"allowlist" program to a "denylist" program.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
30bfbd3ff1
cgroups: tweak bpf_device_cgroup_prepare()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
a7744f125e
conf: expose lxc_clear_cgroup2_devices()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
d6c06927df
conf: improve lxc_clear_cgroups()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
159702774c
bpf: fix typos
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
a0f0e9df1d
bpf: comment bpf_cgroup_devices_update()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
60532b18f4
commands: only update bpf device program if really needed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
a134099de5
cgroups: make device cgroup handling smarter and simpler
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:26 +01:00
Christian Brauner
fc4612cb39
cgroups: ensure no garbage is returned
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 15:23:25 +01:00
Christian Brauner
ba9055c96b
lsm: twek apparmor_process_label_get()
...
Fixes: Coverity 1473189
Fixes: Coverity 1473190
Fixes: 47f4914d88
("apparmor: prefer /proc/.../attr/apparmor/current over legacy interface")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 14:40:58 +01:00
Christian Brauner
8b145a8778
file_utils: allow fd_to_buf() to fail for real
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-19 14:32:36 +01:00
Christian Brauner
f43ed6a0ab
Merge pull request #3686 from cyphar/apparmor-attr-subdir
...
apparmor: prefer /proc/.../attr/apparmor/current over legacy interface
2021-02-19 13:15:31 +01:00
Aleksa Sarai
47f4914d88
apparmor: prefer /proc/.../attr/apparmor/current over legacy interface
...
It turns out that since Linux 5.1 there are now per-LSM subdirectories
for major LSMs, which users are recommended to use over the "legacy"
top-level /proc/$pid/attr/... files[1]:
> Process attributes associated with “major” security modules should be
> accessed and maintained using the special files in /proc/.../attr. A
> security module may maintain a module specific subdirectory there,
> named after the module. /proc/.../attr/smack is provided by the Smack
> security module and contains all its special files. The files directly
> in /proc/.../attr remain as legacy interfaces for modules that provide
> subdirectories.
AppArmor has had such a directory since Linux 5.8[2], and it turns out
that with certain CONFIG_LSM configurations you can end up with AppArmor
files not being accessible from the legacy interface. Arch Linux
recently added BPF as one of the enabled LSM in their configuration, and
this broke runc[3] and LXC.
The solution is to first try to use /proc/$pid/attr/apparmor/current and
fall back to /proc/$pid/attr/current if the former is not available.
[1]: https://www.kernel.org/doc/html/latest/admin-guide/LSM/index.html
[2]: Linux 5.8 ; commit 6413f852ce08 ("apparmor: add proc subdir to attrs")
[3]: https://github.com/opencontainers/runc/issues/2801
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-02-19 20:53:50 +11:00
Aleksa Sarai
301a5f8e78
apparmor: clean up apparmor_process_label_get
...
Rather than open-coding file reading and retry semantics and
implementing the path generation logic separately to
apparmor_process_label_fd_get, refactor the logic so that it looks
closer to the pidfd version.
This will make it easier to implement the two-step handling for
/proc/self/attr/apparmor/current and makes this code slightly less
confusing.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-02-19 20:46:01 +11:00
Stéphane Graber
35a68d6df2
Merge pull request #3681 from brauner/2021-02-18/cgroups
...
cgroups: fixes & bpf rework
2021-02-18 11:52:52 -05:00
Stéphane Graber
599a0c6c9c
Merge pull request #3682 from brauner/2021-02-18/fixes
...
console: fixes
2021-02-18 11:42:17 -05:00
Christian Brauner
f640c8187a
conf: don't log garbage
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 17:08:11 +01:00
Christian Brauner
f3dff08054
start: fix non-daemonized and application containers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 17:01:59 +01:00
Christian Brauner
1dd71c90e8
conf: use saner mode for console
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 17:01:59 +01:00
Christian Brauner
ad755295f1
bpf: simplify bpf (device) program freeing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 16:26:16 +01:00
Christian Brauner
25903ba9c0
bpf: make bpf_program_cgroup_attach() static
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 16:21:04 +01:00
Christian Brauner
da03dc28e1
bpf: prevent double-close
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 16:13:45 +01:00
Christian Brauner
8c49586f0d
cgroups: use close_equal() and free_equal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 15:55:24 +01:00
Christian Brauner
284868b249
memory_utils: add close_equal() and free_equal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 15:52:35 +01:00
Christian Brauner
3d01776c50
lxccontainer: fix reboot logging
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 15:39:27 +01:00
Christian Brauner
0a150695b4
bpf: rework live device cgroup update
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 14:56:01 +01:00
Christian Brauner
fd1cf1b1ab
compiler: fix fallthrough attribute
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 14:42:39 +01:00
Christian Brauner
d202c500d6
bpf: fix return values in bpf_program_cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 14:42:15 +01:00
Christian Brauner
354d21c491
bpf: let bpf_list_add_device() take the device list directly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 13:35:03 +01:00
Christian Brauner
7da502de6a
bpf: add and use bpf_cgroup_devices_attach() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 13:29:26 +01:00
Christian Brauner
928937b114
cgroups: remove compile-time bpf support detection
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 12:42:34 +01:00
Christian Brauner
7fc77b1ae0
bpf: vendor bpf headers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 12:34:51 +01:00
Christian Brauner
34683e39b9
bpf: handling missing defines
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 12:02:54 +01:00
Christian Brauner
7aec2bd3cd
bpf: rework bpf_program_cgroup_detach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:33 +01:00
Christian Brauner
9a2a38b313
commands: rework bpf devices BPF_F_REPLACE codepath
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:33 +01:00
Christian Brauner
c38e5c4fd2
bpf: don't close invalid fd, simply swap
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
281f42afaa
bpf: use __u32 not uint32_t
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
a38a34f888
macro: add swap helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
79bc22bd24
commands: replace bpf program on update
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
934bb475e2
commands: improve bpf device program management
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
413e074bbe
cgroups: improve bpf device program management
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:32 +01:00
Christian Brauner
df1a5345cd
bpf: add helpers for better bpf device program management
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 11:54:20 +01:00
Christian Brauner
e41afad55e
cgroups: improve bpf device program handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:51:07 +01:00
Christian Brauner
69885a7656
cgroups: make device cgroups semantics clearer
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:51:07 +01:00
Christian Brauner
0d450efcf2
bpf: enable helpers to let caller replace existing bpf programs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:50:45 +01:00
Christian Brauner
8828c61a8b
bpf: align struct initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:50:03 +01:00
Christian Brauner
bee6ee17b0
bpf: use return macros
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:50:03 +01:00
Christian Brauner
4b9dc703d2
conf: introduce lxc_bpf_devices_rule_t type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:50:03 +01:00
Christian Brauner
7c37e93740
bpf: use cgroup fd directly instead of paths
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 10:50:03 +01:00
Christian Brauner
7064ee3a92
cgroups: kill monitor_full_path
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 00:39:22 +01:00
Christian Brauner
11e5c6783e
cgroups: free correct path
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-18 00:39:22 +01:00
Christian Brauner
05fe99f3a9
utils: fix print_r() debugging helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 23:30:12 +01:00
Christian Brauner
bce04069bc
cgroups: fix error values
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 22:48:56 +01:00
Christian Brauner
2c4348bd1c
cgroups: don't overwrite type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 18:49:20 +01:00
Christian Brauner
bd09ee987d
cgroups: make it extremely obvious that we're transitioning from a flag to a type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 18:48:58 +01:00
Stéphane Graber
cca7d405fe
Merge pull request #3680 from brauner/2021-02-17/cgroups_2
...
cgroups: fourth batch of cgroup fixes
2021-02-17 12:30:57 -05:00
Christian Brauner
77410c983c
cgroups: create controller directories if missing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:56:55 +01:00
Christian Brauner
51feb8dbb7
cgroups: use non-flag based checking now that we switched all codepaths over
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:56:55 +01:00
Christian Brauner
9394b6dc97
conf: use brackets to clarify check semantics
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:30:15 +01:00
Christian Brauner
69c296739d
cgroups: validate that only a single cgroup mount type is set
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:30:15 +01:00
Christian Brauner
8186eb8e8a
cgroups: prevent cgroup mount type overwrite
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:30:15 +01:00
Christian Brauner
f1921f351e
cgroups: ensure that cgroup_root is initialized in legacy codepaths
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 16:29:56 +01:00
Christian Brauner
9bca62b305
cgroups: distinguish between tmpfs and unified based cgroup layouts file descriptors
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 15:29:14 +01:00
Christian Brauner
e203535895
cgroups: log intermediate cleanup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 15:24:59 +01:00
Stéphane Graber
b3ad27fb43
Merge pull request #3679 from brauner/2021-02-17/cgroups
...
cgroups: third batch of cgroup fixes
2021-02-17 08:59:13 -05:00
Christian Brauner
0954f6cec9
cgroups: prevent NULL pointer deref
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 14:42:55 +01:00
Christian Brauner
8f45c49bb1
cgroups: simplify mount opening
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:45:35 +01:00
Christian Brauner
9981107f55
cgroups: ensure we prune the limit dir
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:35:58 +01:00
Christian Brauner
c1ece89518
cgroups: ensure we don't remove cgroups we didn't create
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:30:30 +01:00
Christian Brauner
57abfbb640
cgroups: don't move pivot cgroup under the monitor's cgroup
...
Otherwise we will never be able to destroy the monitor's cgroup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:08:27 +01:00
Christian Brauner
1e05885505
cgroups: don't rely on absolute path
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:06:29 +01:00
Christian Brauner
471929c6d0
cgroups: be stricter when creating payloads
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:04:58 +01:00
Christian Brauner
a6aeb9f1b9
cgroups: rework cgroup tree creation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 10:03:42 +01:00
Christian Brauner
6c880cdfa1
cgroups: ensure leaf cgroup is correctly pruned on creation failure
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 09:29:04 +01:00
Christian Brauner
cb423bd38b
cgroups: rework cgroup tree removal on creation failure
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 09:15:38 +01:00
Christian Brauner
2291719e82
cgroups: remove obsolote check
...
In the new layout we don't need to do this.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 09:06:37 +01:00
Christian Brauner
6fec43278e
cgroups: reorder function arguments
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 09:04:03 +01:00
Stéphane Graber
e82bb1b360
Merge pull request #3678 from brauner/2021-02-17/unified_controller_delegation
...
cgroups: rework unified cgroup controller delegation
2021-02-16 20:27:03 -05:00
Christian Brauner
838d155694
start: delegate than move into the target cgroup
...
This is a way more sensible model.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 01:45:47 +01:00
Christian Brauner
95ab26aff7
cgroups: rework unified controller delegation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 01:45:47 +01:00
Christian Brauner
e4db08ed3e
cgroups: check correct variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 01:45:47 +01:00
Christian Brauner
e219f8e885
cgroups: s/openat()/open_at()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 01:45:44 +01:00
Stéphane Graber
6963202241
Merge pull request #3677 from brauner/2021-02-17/cgroup_pruning
...
cgroups: fd-only cgroup tree pruning
2021-02-16 19:16:38 -05:00
Stéphane Graber
a218be90f5
Merge pull request #3676 from brauner/2021-02-16/fixes
...
cgroups: fixes
2021-02-16 19:16:23 -05:00
Christian Brauner
dcf6a5c7c6
cgroups: remove obsolote cgroup_tree handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 00:49:41 +01:00
Christian Brauner
c55fe36d28
cgroups: fd-only cgroup tree pruning
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 00:42:40 +01:00
Christian Brauner
6347774b4c
file_utils: move dup_cloexec() to header
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-17 00:42:37 +01:00
Christian Brauner
701be30e14
cgroups: prevent double-close
...
Fixes: Coverity 1473183
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 23:27:53 +01:00
Christian Brauner
ba559a5b19
namespace: add missing \0 terminator
...
Link: https://launchpadlibrarian.net/523195972/buildlog_ubuntu-groovy-ppc64el.lxc_1%3A4.0.6+master~20210215-1740-0ubuntu1~groovy_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 23:20:54 +01:00
Stéphane Graber
858f62255d
Merge pull request #3675 from brauner/2021-02-16/fixes
...
cgroups: second batch of cgroup fixes
2021-02-16 16:37:42 -05:00
Christian Brauner
060e54d6df
cgroups: rework how hierarchies are added
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 20:39:02 +01:00
Christian Brauner
c426abeaa9
cgroups: fix fd leaks
...
They didn't really matter because we want to keep them around for as long as
the container lives anyway.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 19:19:09 +01:00
Christian Brauner
f5b049452e
cgroups: allow "" base cgroup paths
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 19:19:09 +01:00
Christian Brauner
192812516e
string_utils: handle empty strings in must_make_path()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 19:19:09 +01:00
Christian Brauner
088db01b85
cgroups: improve logging
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 19:19:09 +01:00
Christian Brauner
033267c93a
cgroups: rework legacy cpuset handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 19:19:09 +01:00
Christian Brauner
da42ac7b4b
cgroups: fd-based only cgroup creation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 17:25:53 +01:00
Christian Brauner
3486d9935a
cgroups: stash fds for the controller mountpoint and base cgroup path
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 13:36:13 +01:00
Christian Brauner
5c7b81439c
cgroups: fail when no cgroup hierarchies are found
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 13:28:48 +01:00
Christian Brauner
600a016384
cgroups: rework base cgroup parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 13:25:26 +01:00
Christian Brauner
c72e7cb584
cgroups: rework add_hierarchy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 11:46:36 +01:00
Christian Brauner
008ccca920
cgroups: better document stashed file descriptors
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 11:35:43 +01:00
Christian Brauner
d4cff3525d
cgroups: stash host's cgroupfs file descriptor
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 11:22:56 +01:00
Christian Brauner
7414bc72c3
cgroups: s/cg_init()/__cgroup_init()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 10:55:38 +01:00
Stéphane Graber
136b349c94
Merge pull request #3674 from brauner/2021-02-15/nesting
...
cgroups: tighten cgroup config items
2021-02-15 12:56:52 -05:00
Christian Brauner
f63ef15527
confile: forbid absolute paths in config items that modify the cgroup layout
...
This is not a safety measure but merely is supposed to raise awareness that
these paths are always relative to the cgroup root as determined by
lxc.cgroup.relative.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
0a48ee66c6
confile: forbid walking upwards for confile items that modify cgroup layout
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
7d714159a3
confile_utils: normalize paths in config items
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
ee94a8b5cf
confile: use set_config_path_item() for most cgroup layout modifiers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:54 +01:00
Stéphane Graber
7e925736c9
Merge pull request #3673 from brauner/2021-02-15/nesting
...
cgroups: first batch of cgroup mounting fixes
2021-02-15 12:08:01 -05:00
Christian Brauner
a3e5ec2657
cgroupfs: rework cgroup2 mounting
...
We now explicitly refuse to mount cgroups on pure unified layouts when the
container is not running in a separate cgroup namespace. This is not a
regression since we simply always failed before anyway. I will likely fix this
very soon though. But there are bigger fish to fry currently.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 16:25:38 +01:00
Christian Brauner
3a86fb378d
cgroups: log early return
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:58:10 +01:00
Christian Brauner
44234ae1e9
cgroups: s/__cg_mount_direct()/__cgroupfs_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:54:51 +01:00
Christian Brauner
6768700d24
cgroups: strip LXC_AUTO_CGROUP_MIXED and LXC_AUTO_CGROUP_FULL_MIXED when cgroup namespaces are supported and used
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:54:10 +01:00
Christian Brauner
80262447c9
cgroups: fix flag checking in legacy mount paths
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:45:45 +01:00
Christian Brauner
1411165033
cgroups: s/cg_mount_cgroup_full()/cgroupfs_bind_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:44:24 +01:00
Christian Brauner
074af8903c
cgroups: s/cg_mount_in_cgroup_namespace()/cgroupfs_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:42:56 +01:00
Christian Brauner
6cc501f3e0
conf: remove wrong comment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:41:02 +01:00
Christian Brauner
c581c8a365
cgroups: switch to flag-based checking
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:36:49 +01:00
Christian Brauner
68599aab10
cgroups: don't strip LXC_AUTO_CGROUP_FORCE
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:25:00 +01:00
Christian Brauner
cdd3b77d0c
cgroups: make clear that a flag argument is passed to cgroup mount functions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:23:51 +01:00
Christian Brauner
8cdbef77df
utils: add development helper to quickly dump a directories contents
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:29:47 +01:00
Christian Brauner
e7e45fdffc
cgroups: improve cgroup mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:23:36 +01:00
Christian Brauner
937a3af94e
cgroups: verify that we are actually running in cgroup namespace
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:05:20 +01:00
Christian Brauner
ab8cd5d9e2
cgroups: pass handler to cgroup mount() method
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:57:31 +01:00
Christian Brauner
6d25a524d8
conf: don't pass conf separately to lxc_mount_auto_mounts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:55:33 +01:00
Christian Brauner
c988c8b1ce
cgroups: move cgns_supported() to cgroup utilities
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:51:11 +01:00
Stéphane Graber
4b9467975c
Merge pull request #3672 from brauner/2021-02-14/fixes
...
start: small fixes
2021-02-14 15:38:58 -05:00
Christian Brauner
245066afbc
start: fix comment about time namespace preservation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:45:22 +01:00
Christian Brauner
3a89b0ab0a
start: improve comment in lxc_spawn()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:44:57 +01:00
Christian Brauner
9beaca55d7
start: improve comments
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:44:18 +01:00
Christian Brauner
857ba1f0c5
start: improve namespace preservation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:42:36 +01:00
Christian Brauner
cb3b010c16
start: fix error handling and improve comment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:36:25 +01:00
Stéphane Graber
5fd0968304
Merge pull request #3671 from brauner/2021-02-14/namespace_hooks
...
hooks: rework exposing namespace information
2021-02-14 10:55:54 -05:00
Christian Brauner
37631ddbf8
network: expose namespace fd paths to network hooks
...
Closes : #3667
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 15:42:10 +01:00
Christian Brauner
8db6be1ba5
start: rework namespace preservation and path creation for hooks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 15:42:10 +01:00
Stéphane Graber
3bcf3ba0b4
Merge pull request #3670 from brauner/2021-02-13/fixes
...
tree-wide: convert to strequal() and strnequal()
2021-02-13 19:02:22 -05:00
Christian Brauner
a58b0754ab
utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
becc8d207c
seccomp: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
948fcf60b0
lxccontainer: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
12b902608a
lsm: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
90d5fea581
freezer: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:24 +01:00
Christian Brauner
b3fde94479
file_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:24 +01:00
Christian Brauner
1c95f94c23
confile_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:19 +01:00
Christian Brauner
1af3044f0c
confile: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:15 +01:00
Christian Brauner
eed95eb005
conf: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
aa72fbe713
cgroups: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
6a6c7030d5
attach: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
f0fdcd893a
utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
5ef8637869
terminal: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
7ba62a5e87
string_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
d594790c82
state: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
d0269705d2
start: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
c92bfdb065
namespace: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
dc2c2622a2
seccomp: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
6ee997a743
network: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
62dcc033f2
lxccontainer: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:20 +01:00
Christian Brauner
644bbdbcea
lsm: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:24:16 +01:00
Christian Brauner
c72ad27f4a
log: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:23:01 +01:00
Christian Brauner
32ec743a3e
initutils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:22:35 +01:00
Christian Brauner
066af2cbef
criu: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:21:58 +01:00
Christian Brauner
676cd75cdd
confile_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:21:03 +01:00
Christian Brauner
d62177e99a
confile: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:20:26 +01:00
Christian Brauner
715287420e
conf: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:16:18 +01:00
Christian Brauner
8b99a20a18
cgroups: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:14:19 +01:00
Christian Brauner
e8c4335756
attach: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:12:45 +01:00
Stéphane Graber
46ad3c97ab
Merge pull request #3666 from brauner/2021-02-11/fixes
...
Improved mount api support checking & console setup hardening
2021-02-11 09:14:16 -05:00
Christian Brauner
de7f9f3303
tree-wide: rework mount api support checks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:57:51 +01:00
Christian Brauner
37c74fd1ef
conf: introduce lxc_bind_mount_console()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:53 +01:00
Christian Brauner
4a233eab3d
macro: add LXC_PROC_SELF_FD_LEN
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:52 +01:00
Christian Brauner
8e40762dfd
file_utils: add same_file_lax()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:52 +01:00
Christian Brauner
74f4638877
string_utils: add fdstr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:52 +01:00
Christian Brauner
4b7686ea7b
string_utils: add proc_self_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:52 +01:00
Christian Brauner
1ff4821158
memory_utils: add close_move_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 14:44:52 +01:00
Stéphane Graber
244a5017ba
Merge pull request #3665 from brauner/2021-02-11/fixes
...
tree-wide: fixes
2021-02-11 07:59:48 -05:00
Christian Brauner
af00ba8b0a
utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:51:54 +01:00
Christian Brauner
4af24cb740
string_utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:49:10 +01:00
Christian Brauner
93d5ebf1b9
terminal: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:48:07 +01:00
Christian Brauner
fa60cd7bf3
start: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:47:38 +01:00
Christian Brauner
8a6bea9432
seccomp: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:46:47 +01:00
Christian Brauner
608a39c23d
rexec: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:45:14 +01:00
Christian Brauner
387c1c70a2
network: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:44:38 +01:00
Christian Brauner
d0c6b86e82
mount_utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:42:22 +01:00
Christian Brauner
3ca3b23065
monitor: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:41:52 +01:00
Christian Brauner
ff88c2b4af
lxclock: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:40:56 +01:00
Christian Brauner
94aeacb7a3
lxccontainer: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:40:00 +01:00
Christian Brauner
08f7f1fd34
log: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:32:59 +01:00
Christian Brauner
82c24a7306
file_utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:30:38 +01:00
Christian Brauner
8eaa5ae36c
criu: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:29:59 +01:00
Christian Brauner
34a51534fd
confile_utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:28:07 +01:00
Christian Brauner
3948c2529a
confile: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:27:06 +01:00
Christian Brauner
9bcde680c5
conf: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:24:18 +01:00
Christian Brauner
92e6ae287c
commands_utils: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:18:41 +01:00
Christian Brauner
f51c7eb43e
attach: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:16:34 +01:00
Christian Brauner
0bba27c1b7
cgroups: convert to strnprintf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:15:15 +01:00
Christian Brauner
66efb199f7
string_utils: add wrapper for snprintf()
...
This let's us avoid the tedious
if (ret < 0 || (size_t)ret >= sizeof(buf))
style of error checking.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-11 10:14:34 +01:00
Stéphane Graber
ff4e462906
Merge pull request #3664 from brauner/2021-02-10/fixes
...
cgroups: fixes
2021-02-10 15:52:59 -05:00
Christian Brauner
25db3f9440
cgroups: log container process entering
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 20:20:34 +01:00
Christian Brauner
ebf88e5b87
cgroups: log monitor and transient process entering
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 20:20:34 +01:00
Christian Brauner
d1ee87192e
cgroups: do not return early when entering monitor cgroups
...
This will happen when restoring a container via criu.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 20:20:33 +01:00
Christian Brauner
b3a4286596
cgroups: use brackets to have clear semantics for flags checking
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 20:20:33 +01:00
Stéphane Graber
ae2d267e59
Merge pull request #3663 from brauner/2021-02-10/fixes
...
criu: fixes
2021-02-10 13:41:07 -05:00
Christian Brauner
d9fc9be8f0
criu: handle new cgroup layout
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 13:36:04 +01:00
Christian Brauner
b41a8023b8
criu: lxc_init() already initializes cgroups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 13:14:11 +01:00
Christian Brauner
92fde26d7b
criu: warn about cgroup hierarchies without controllers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 13:03:06 +01:00
Christian Brauner
2539492cc9
criu: rework init pid retrieval
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:52:30 +01:00
Christian Brauner
5257b91b6e
criu: use cleanup macro when parsing mount data
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:52:30 +01:00
Christian Brauner
6eff3c0d79
criu: use cleanup macro
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:52:30 +01:00
Christian Brauner
2541dfab38
criu: move logging under lxc_log_trace()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:52:26 +01:00
Christian Brauner
59d8a539d1
criu: massage exec_criu()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:31:01 +01:00
Christian Brauner
ff9edd2d04
criu: mark cgroups methods specific to criu
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:27:51 +01:00
Christian Brauner
9d0e129b54
conf: fix memory leak
...
Fixes: Coverity 1472848
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-10 12:27:50 +01:00
Stéphane Graber
11a3696fda
Merge pull request #3661 from blenk92/iw_error_msg
...
network: Add error message if iw couldn't be found
2021-02-09 10:46:19 -05:00
Stéphane Graber
642429e57b
Merge pull request #3662 from brauner/2021-02-08/fixes
...
conf: expand fd-only setup codepaths
2021-02-09 10:07:28 -05:00
Christian Brauner
58b381117d
conf: kill PATH_MAX bytes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 21:59:20 +01:00
Christian Brauner
887ae844d5
conf: kill PATH_MAX bytes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 21:59:19 +01:00
Christian Brauner
17d9d07275
tests: add logging to lxc-test-unpriv
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 21:59:19 +01:00
Christian Brauner
7369e6bf6d
conf: fd-only tty setup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 21:59:19 +01:00
Christian Brauner
ade356b90c
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>
2021-02-08 21:59:19 +01:00
Christian Brauner
79ff643d24
conf: rework rootfs pinning
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 21:59:15 +01:00
Max
0ed79f452a
network: Add error message if iw couldn't be found
...
When iw is not installed on the host, lxc fails to move wireless devices
into a container. Unfortunately there is no real error message yet
(other than that it didn't work), so its quite unobvious what causes
this. This commit adds a error message that clearly states the
application iw is missing.
Signed-off-by: Maximilian Blenk <blenkmax@gmail.com>
2021-02-08 20:42:27 +01:00
Christian Brauner
4806d3b9ec
conf: kill PAT_MAX bytes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 10:22:41 +01:00
Christian Brauner
9c0fd29a5c
conf: kill PATH_MAX bytes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 10:22:41 +01:00
Christian Brauner
48e5dcc85a
conf: don't pass struct lxc_conf
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 10:22:41 +01:00
Christian Brauner
8183f09e00
conf: kill PATH_MAX bytes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 10:22:36 +01:00
Christian Brauner
b28aae045e
conf: s/setup_mount()/setup_mount_fstab()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 09:54:57 +01:00
Christian Brauner
ac11febd37
mount_utils: add locked flag helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 09:53:34 +01:00
Stéphane Graber
01149adf72
Merge pull request #3660 from brauner/2021-02-05/fixes_1
...
mount_utils: initialize fd
2021-02-05 17:01:39 -05:00
Christian Brauner
60218ee70b
mount_utils: kill mount_filesystem()
...
We have way better helpers now.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 21:49:51 +01:00
Christian Brauner
0d50f2882c
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>
2021-02-05 21:49:18 +01:00
Christian Brauner
5cf51172e3
mount_utils: initialize fd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 21:21:01 +01:00
Stéphane Graber
338c2abe83
Merge pull request #3659 from brauner/2021-02-05/fixes
...
mount: extend support for the new mount api
2021-02-05 13:40:19 -05:00
Christian Brauner
635e7bac01
tree-wide: make use of new_mount_api() where it makes sense
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 19:01:32 +01:00
Christian Brauner
87545854f7
mount_utils: detect new mount api support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
55a85f4a11
mount_utils: kill mount_from_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
d2c885f199
conf: use fd_bind_mount() in lxc_fill_autodev()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
041d1e3054
mount_utils: add support for bind-mounts through the new mount api
...
fd_bind_mount()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
ca9055b473
mount_utils: kill mount_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
a099c5db1c
cgroups: switch __cg_mount_direct() to use the new mount api
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:54 +01:00
Christian Brauner
23a20dbea8
cgroups: switch tmpfs mounting to new mount api
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:53 +01:00
Christian Brauner
bfbfeedfab
conf: switch mount_autodev() to new mount api
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 18:52:53 +01:00
Christian Brauner
1f3eb95965
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>
2021-02-05 18:52:49 +01:00
Christian Brauner
74ed30d721
mount_utils: move mount_at() and mount_from_at() over from utils.{c,h}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:56:59 +01:00
Christian Brauner
b5daeddc5a
Merge pull request #3657 from brauner/2021-02-05/init_groups
...
conf: implement lxc.init.groups
2021-02-05 12:30:17 +01:00
Christian Brauner
7fe8120eca
confile: make garbage groups an error
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:09 +01:00
Christian Brauner
6f6c71cdca
tests: improve lxc.init.groups tests
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:08 +01:00
Christian Brauner
c71f64cbe0
confile: handle appending init groups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:07 +01:00
Christian Brauner
4822319f31
conf: use lxc_groups_t directly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:06 +01:00
Christian Brauner
fb4dbb516c
attach_options: use size_t for lxc_groups_t
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:05 +01:00
Christian Brauner
9475d2b9b6
attach: use brackets around flag check
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:14:02 +01:00
Christian Brauner
f5072dcd5f
attach_options: use standard C pointer syntax
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:13:28 +01:00
Christian Brauner
f41aa73b4e
attach_options: initialize .groups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:13:25 +01:00
Ruben Jenster
8caac58373
attach: Add groups option to keep additional group IDs.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2021-02-05 12:13:24 +01:00
Ruben Jenster
bf31b3378f
confile: add lxc.init.groups to keep additional groups
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2021-02-05 12:13:06 +01:00
Christian Brauner
5a7f1dc660
utils: rework lxc_setgroups()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:12:29 +01:00
Christian Brauner
8917c3825a
tree-wide: use lxc_drop_groups() instead of lxc_setgroups(0, NULL)
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:12:28 +01:00
Christian Brauner
8dd6f81e70
utils: add lxc_drop_groups()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-05 12:09:35 +01:00
Stéphane Graber
d71e4764b7
Merge pull request #3655 from brauner/2021-02-04/fixes_1
...
Tiny fixes in attach and utils
2021-02-04 17:44:48 -05:00
Christian Brauner
7f40f0617e
utils: check for snprintf() error
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 22:48:18 +01:00
Christian Brauner
bd6a23550f
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>
2021-02-04 22:45:19 +01:00
Stéphane Graber
5ee510d614
Merge pull request #3651 from brauner/2021-02-04/fixes
...
cgroups: fix cgroup mounting
2021-02-04 15:40:31 -05:00
Christian Brauner
59114d8053
cgroups: check for correct error in __cg_unified_attach() from cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 20:27:40 +01:00
Christian Brauner
ea11a215dc
tree-wide: s/dfd_root_host/dfd_host/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:51:26 +01:00
Christian Brauner
ea57e42409
tree-wide: s/mntpt_fd/dfd_mnt/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:50:11 +01:00
Christian Brauner
a5a08920ee
tree-wide: s/dev_mntpt_fd/dfd_dev/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:50:10 +01:00
Christian Brauner
8ea5110c9c
syscall_wrappers: fix PROTECT_OPEN_W macro
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:49:32 +01:00
Christian Brauner
927ea337a4
conf: restricted fd-only lxc_fill_autodev()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:49:32 +01:00
Christian Brauner
a370f16bcd
conf: start stashing dfd to host's / during container setup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 19:49:22 +01:00
Christian Brauner
86087bd6bf
conf: fix lxc_setup_dev_console()
...
We were printing garbage on accident.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 18:45:32 +01:00
Christian Brauner
977687db1c
utils: add mount_from_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 18:45:32 +01:00
Christian Brauner
7043e2b470
cgroups: restrict open calls in cgroup_attach_create_leaf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 18:45:32 +01:00
Christian Brauner
6e2078de11
cgroups: improve error handling and logging in cgroup_attach_leaf()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:53 +01:00
Christian Brauner
88c27c5352
cgroups: fix argument vetting in cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:53 +01:00
Christian Brauner
9a57778bb5
attach: fix fallback logic when attaching to cgroups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:53 +01:00
Christian Brauner
02efd04151
cgroups: switch to fd-based cgroup mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:52 +01:00
Christian Brauner
c689b58ad3
cgroups: restricted fd-only controller mountpoint creation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:52 +01:00
Christian Brauner
315f8a4e42
cgroups: fix cgroup mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-04 15:59:50 +01:00
Stéphane Graber
dfb71524d7
Merge pull request #3650 from brauner/2021-02-03/fixes_1
...
conf: harden various mount paths
2021-02-03 17:05:35 -05:00
Christian Brauner
cbc2ddf5b3
utils: harden __safe_mount_beneath_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 21:57:44 +01:00
Christian Brauner
952b5031b7
conf: refactor transient procfs mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 21:54:52 +01:00
Christian Brauner
ccf5374124
conf: restrict open call in lxc_mount_rootfs()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 20:58:45 +01:00
Christian Brauner
e1b9d6af00
conf: make lxc_create_tmp_proc_mount() static
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 20:55:01 +01:00
Christian Brauner
fdb57ab442
conf: coding style
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 20:51:56 +01:00
Stéphane Graber
f8dcf07fd3
Merge pull request #3648 from brauner/2021-02-03/fixes
...
conf: open hardening & fd-only operations
2021-02-03 10:38:50 -05:00
Stéphane Graber
b5e7502996
Merge pull request #3649 from brauner/2021-02-03/attach_via_pidfds
...
attach: attach to namespaces via pidfds
2021-02-03 10:23:53 -05:00
Christian Brauner
9b31ab5859
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>
2021-02-03 15:23:56 +01:00
Christian Brauner
a26822c5d2
conf: fd-only devtps setup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:52 +01:00
Christian Brauner
7f50ec8bd0
conf: fd-only pivot root
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:52 +01:00
Christian Brauner
99ca563299
conf: restrict open for lxc_mount_rootfs()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:52 +01:00
Christian Brauner
79019997c8
conf: fd-only operations in lxc_setup_dev_symlinks()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:52 +01:00
Christian Brauner
814983287e
conf: harden open in lxc_fill_autodev()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:51 +01:00
Christian Brauner
ce011f53d8
conf: restrict open of dev/
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:51 +01:00
Christian Brauner
fdf7314dc4
conf: remove unnecessary syscall
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:51 +01:00
Christian Brauner
531d36ad00
rexec: mark all fds as close-on-exec if possible
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 11:49:47 +01:00
Christian Brauner
e8aaef8159
syscalls: add close_range()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 09:45:30 +01:00
Christian Brauner
6b69d7f8cf
rexec: check lseek() return value
...
Not really needed buy ok.
Fixes: Coverity: 1472769
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 09:39:21 +01:00
Christian Brauner
3c981fcb78
tests: check for NULL in device_add_remove
...
Fixes: Coverity 1472768
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 09:36:23 +01:00
Stéphane Graber
07f89a4faf
Merge pull request #3647 from brauner/2021-02-02/fixes
...
cgroup2: only rely on command socket when getting cgroup values
2021-02-02 18:30:27 -05:00
Christian Brauner
b7aeda9691
cgroups: improve parameter vetting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-03 00:00:50 +01:00
Christian Brauner
7d013cccf9
tests: support pure unified cgroup layouts in cgpath test
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:52:18 +01:00
Christian Brauner
a4f2435718
test: add logging to device_add_remove
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:40:32 +01:00
Christian Brauner
ea299bfc98
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>
2021-02-02 23:24:28 +01:00
Christian Brauner
9d47970b9b
commands: use __cgroup_unfreeze() directly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:21:21 +01:00
Christian Brauner
c9c814f4d4
cgroups: export __cgroup_unfreeze() for use in commands
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:21:19 +01:00
Christian Brauner
ae4fcc7b11
cgroups: use lxc_cmd_get_limiting_cgroup2_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:08:04 +01:00
Christian Brauner
6f7f2966b1
commands: add missing lxc_cmd_get_limiting_cgroup2_fd() implementation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 23:05:56 +01:00
Christian Brauner
44322ead39
cgpath: add logging
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
c5bac50665
attach: explicitly close seccomp notifier fd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
5ef7547f3d
cgroups: switch back to returning ints
...
Whick makes for easier error checking and fallback code.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
29619d419b
attach: check for ENOCGROUP2 explicitly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
6b55ce0ed3
cgroups: return ENOCGROUP2 from cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
6407e1c244
cgroups: stricter argument vetting for cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
029d8e8801
cgroups: move down cgroup_attach()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:56:10 +01:00
Christian Brauner
739af8478c
lxccontainer: use correct error checks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 22:15:43 +01:00
Christian Brauner
b57f9b1319
cgroups: vet parameters
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 21:59:04 +01:00
Christian Brauner
bfe2971ae4
cgroups: remove unused conf argument
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 21:58:09 +01:00
Christian Brauner
281c36454a
cgroups: rewind() file before polling again
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 19:29:41 +01:00
Christian Brauner
97d7b200d9
lxccontainer: use cgroup_freeze() and cgroup_unfreeze()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:56:23 +01:00
Christian Brauner
4639029c9f
freezer: make methods return bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:56:23 +01:00
Christian Brauner
c8af3332bc
cgroups: add cgroup_freeze() and cgroup_unfreeze()
...
These are unified hierarchy only methods which don't need to initialize a full
cgroup driver. Instead, they rely on the command socket to retrieve a cgroup2
file descriptor to the container's cgroup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:56:23 +01:00
Christian Brauner
419847a8aa
freezer: use lxc_cmd_notify_state_listeners()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:26:57 +01:00
Christian Brauner
241670e7e9
commands_utils: add lcx_cmd_notify_state_listeners()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:26:29 +01:00
Christian Brauner
751a624fb5
cgroups: annotate cgroup_get()/cgroup_set()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:09:29 +01:00
Christian Brauner
be835470f3
cgroups: move functions after methods
...
This makes it more obvious that they are separate.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:08:14 +01:00
Christian Brauner
69edb51d07
lxccontainer: use cgroup_set()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:03:41 +01:00
Christian Brauner
efb4b3e80f
lxccontainer: use correct variable ordering
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 18:02:47 +01:00
Christian Brauner
983b1db09d
cgroups: add croup_set()
...
This is a unified hierarchy only method which doesn't need to initialize a full
cgroup driver. Instead, it relies on the command socket to retrieve a cgroup2
file descriptor to the container's cgroup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 17:40:30 +01:00
Christian Brauner
3baf0fc8b9
cgroups: reorder cgroup_get() arguments
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 17:40:08 +01:00
Christian Brauner
a29cc280c7
lxccontainer: use cgroup_get()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 17:10:12 +01:00
Christian Brauner
b135642488
cgroups: add cgroup_get()
...
This is a unified hierarchy only method which doesn't need to initialize a full
cgroup driver. Instead, it relies on the command socket to retrieve a cgroup2
file descriptor to the container's cgroup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 17:10:10 +01:00
Christian Brauner
2b5e0b8bd2
file_utils: add lxc_read_try_buf_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 16:59:14 +01:00
Christian Brauner
6de35cd959
macro: abuse ENOMEDIUM as ENOCGROUP2
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 16:58:45 +01:00
Stéphane Graber
b22ae84389
Merge pull request #3646 from brauner/2021-02-02/fixes
...
attach & cgroup hardening
2021-02-02 09:28:50 -05:00
Christian Brauner
ac01a9b83c
cgroups: switch controller delegation to fd-only operations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:51:00 +01:00
Christian Brauner
6d15354365
cgroups: add unified_cgroup_fd() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:46:03 +01:00
Christian Brauner
3c5fa7f3e8
file_utils: harden lxc_writeat()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:45:26 +01:00
Christian Brauner
87c7dbcb9c
file_utils: harden lxc_open_dirfd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:45:11 +01:00
Christian Brauner
bcf9793d43
syscall_wrappers: add PROTECT_OPEN_W_* variants
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:44:37 +01:00
Christian Brauner
4c6c4794dc
memory_utils: add close_prot_errno_mov()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 13:44:13 +01:00
Christian Brauner
e18aba7d2a
attach: move loading seccomp as late as possible
...
We want to minimize the change that the profile blocks syscalls we need during
attach setup and has the notifier enabled.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 10:51:06 +01:00
Christian Brauner
92466fe34b
attach: move file descriptor closing into attach_context_container()
...
This reduces the possibility of forgetting to close the namespace file
descriptors when we change this codepath.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 10:51:03 +01:00
Christian Brauner
72a19d2f38
attach: stricter lookup semantics for fdopen_at() calls
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-02 09:54:10 +01:00
Stéphane Graber
c7d644983f
Merge pull request #3645 from brauner/2021-02-01/fixes_4
...
attach: bugfixes
2021-02-01 17:13:37 -05:00
Christian Brauner
4ac35afb78
confile_utils: use lxc_log_trace()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 22:54:47 +01:00
Christian Brauner
62fef886dc
conf: use lxc_log_trace()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 22:53:56 +01:00
Christian Brauner
570e117338
commands_utils: don't leak memory
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 22:47:19 +01:00
Christian Brauner
52ed870ed0
attach: use correct put method
...
Fixes: Coverity 1472763
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 22:13:03 +01:00
Christian Brauner
cd5f35ec67
attach: prevent UAF
...
Fixes: Coverity 1472761
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 22:11:38 +01:00
Stéphane Graber
32947602fd
Merge pull request #3644 from brauner/2021-02-01/fixes_3
...
attach: harden open() calls
2021-02-01 15:26:08 -05:00
Christian Brauner
6f0c2cea14
attach: file descriptor based fdinfo handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 20:27:53 +01:00
Christian Brauner
8e5d175935
file_utils: remove O_NOFOLLOW from open_at() defaults
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 20:27:53 +01:00
Christian Brauner
6fc8a0dd82
lsm: harden read_file_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 20:27:53 +01:00
Christian Brauner
46bf13b7c3
tree-wide: extend read_file_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 20:27:53 +01:00
Christian Brauner
5129b2d3ed
attach: harden open calls
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 20:27:51 +01:00
Christian Brauner
cce677d168
syscall_wrappers: add PROTECT_LOOKUP, PROTECT_OPEN, PROTECT_LOOKUP_WITH_SYMLINKS, PROTECT_OPEN_WITH_TRAILING_SYMLINKS
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 19:02:28 +01:00
Christian Brauner
7166ab759e
file_utils: add open_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 17:03:59 +01:00
Stéphane Graber
42673edd05
Merge pull request #3642 from brauner/2021-02-01/fixes
...
attach: rework id handling
2021-02-01 10:17:18 -05:00
Stéphane Graber
2b5259634a
Merge pull request #3643 from brauner/2021-02-01/fixes_2
...
cgroups: remove pointless NULL checks
2021-02-01 10:14:49 -05:00
Christian Brauner
ed75d76e70
cgroups: initialize variable
...
Fixes: Coverity 1472651
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 15:44:59 +01:00
Christian Brauner
bb6dbaf0df
cgroups: remove pointless NULL checks
...
We're already ensuring before that conf isn't NULL.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 15:24:05 +01:00
Christian Brauner
3ac4480a6c
attach: stash host uid and host gid in attach_context
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 15:16:56 +01:00
Christian Brauner
40301d4895
attach: fix error checking for dup2()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:51:41 +01:00
Christian Brauner
93b9960a09
attach: fix logging for stdfd replacement
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:50:55 +01:00
Christian Brauner
a7563434ac
attach: log failues to dup2() with SYSDEBUG()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:44:45 +01:00
Christian Brauner
7e90889dbd
utils: use SYSTRACE() when logging stdio permission fixup failures
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:41:18 +01:00
Christian Brauner
20718e3987
attach: document attach_context
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:41:09 +01:00
Christian Brauner
595798bbca
attach: simplify opening of /proc/self
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:41:09 +01:00
Christian Brauner
4475fabb0e
attach: move uid and gid handling to get_attach_context()
...
the less we do in do_attach(), the better.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 14:41:08 +01:00
Christian Brauner
bac33ebdcb
attach: initialize init_pid field to -ESRCH
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 12:30:03 +01:00
Christian Brauner
9680e7b062
attach: unifiy /proc/<init-pid>/status parsing
...
and move it out of do_attach(). The less we do in the container's context the
better.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 12:29:59 +01:00
Christian Brauner
a60d8c4ea7
file_utils: add fdopenat()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-01 11:32:46 +01:00
Stéphane Graber
326bb02cbb
Merge pull request #3641 from brauner/2021-01-30/fixes
...
attach: pidfd-based hardening and file-descriptor-only LSM interactions
2021-01-31 17:13:25 -05:00
Christian Brauner
fbf281d3f4
lsm/apparmor: cleanup apparmor_process_label_set()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-31 22:26:31 +01:00
Christian Brauner
d87640256f
attach: hardening through use of pidfds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-31 22:26:28 +01:00
Christian Brauner
afc691a01a
attach: file descriptors based LSM handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-31 21:39:20 +01:00
Christian Brauner
ca76baed10
cgroups: align methods
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-31 20:38:40 +01:00
Stéphane Graber
ee4aad1e1f
Merge pull request #3639 from brauner/2021-01-28/fixes
...
cgroups: fixes and improvements
2021-01-30 14:23:25 -05:00
Christian Brauner
7d2f7ae185
cgroups: use PTR_TO_U64()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 17:28:32 +01:00
Christian Brauner
640952e538
attach: don't needless check for NULL
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 17:07:55 +01:00
Christian Brauner
de96cd600c
log: add lxc_log_trace() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 16:58:00 +01:00
Christian Brauner
4a888de15d
cgroups: use bpf log when logging at trace level
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 16:55:52 +01:00
Christian Brauner
25a8b256af
seccomp: use lxc_log_get_level()
...
This will now enable LXD users to dump the seccomp filter in the log when
logging at TRACE level.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:10:21 +01:00
Christian Brauner
09c8768a0b
log: rework lxc_log_get_level()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:10:09 +01:00
Christian Brauner
0450b7ce71
cgroups: use cleanup macro for consistency
...
and to prevent future mishaps.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
d5d4b98e59
cgroups: vet parameters more strictly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
0464dec30e
seccomp: use lxc_log_get_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
c422f3afa6
log: add lxc_log_get_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
ef1a597f4b
log: remove pointless inline
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
6e214b7419
cgroups: tweak cgroup initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
c5d0238a6d
cgroups: use zalloc
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:09 +01:00
Christian Brauner
954d61c53f
cgroups: ensure all memory is zeroed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 12:02:08 +01:00
Christian Brauner
ca67978486
cgroups: don't initiliaze NULL log
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 02:23:05 +01:00
Christian Brauner
f3ef7e67c1
cgroups: coding style fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 02:23:05 +01:00
Christian Brauner
7af21d2962
croups: improve __do_bpf_program_free
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 02:23:05 +01:00
Christian Brauner
dcbb9e991e
cgroups: bpf fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-30 02:23:02 +01:00
Stéphane Graber
0e24c5600d
Merge pull request #3638 from brauner/2021-01-28/fixes
...
attach: improve attach codepaths
2021-01-29 19:58:40 -05:00
Christian Brauner
581b849a74
attach: init file descriptors to -EBADF
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 16:38:17 +01:00
Christian Brauner
25c659d500
attach: move to file descriptor only namespace interactions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 16:34:56 +01:00
Christian Brauner
c538837d04
attach: move to file descriptor-only interactions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:52:21 +01:00
Christian Brauner
39b3b69b21
attach: rework attaching to namespace fds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:32:17 +01:00
Christian Brauner
3a24f14edf
attach: remove unneeded assignment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:27:24 +01:00
Christian Brauner
5d2b46fbb8
attach: use STDIN_FILENO instead of hard-coding 0
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:26:15 +01:00
Christian Brauner
26abd7eaca
attach: move new_cwd into tighter scope
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:24:31 +01:00
Christian Brauner
f8e88e9420
attach: use dummy macros to make it easier to follow sync logic
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:13:37 +01:00
Christian Brauner
6e36c29770
attach: introduce sync_wait_fd() and sync_wake_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:08:44 +01:00
Christian Brauner
6e48e7c58e
sync: make all sync helpers return bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 14:01:59 +01:00
Christian Brauner
2b695e5fb2
attach: introduce sync_wait_pid() and sync_wake_pid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:52:22 +01:00
Christian Brauner
a9f0cecfc5
attach: use sync_wait()/sync_wake() where applicable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:43:25 +01:00
Christian Brauner
946a0c6d61
sync: rename startup synchronization macros
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:36:25 +01:00
Christian Brauner
2689133604
sync: export sync_wait() and sync_wake()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:28:23 +01:00
Christian Brauner
74ce42b5b5
attach: coding style fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:21:29 +01:00
Christian Brauner
338b230f4e
attach: rename attach_clone_payload to attach_payload
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:17:44 +01:00
Christian Brauner
a64902abe3
attach: move attach_clone_payload into tighter scope
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:14:37 +01:00
Christian Brauner
cb2420df26
attach: s/close/close_prot_errno_disarm/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:11:24 +01:00
Christian Brauner
6d6bfd4f6c
configure: fix static builds with clang-12 and LTO
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 13:04:58 +01:00
Christian Brauner
a588a482d9
attach: move getcwd() into tighter scope
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 11:43:23 +01:00
Christian Brauner
53bca1f3c0
attach: remove obsolete namespace check
...
We're not going to support kernel without namespaces anyway.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 11:40:07 +01:00
Christian Brauner
ee142207d4
attach: fix personality handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 11:31:53 +01:00
Christian Brauner
4eb19ac075
lsm: s/lsm_init/lsm_init_static/g
...
Make it clear that there is nothing to free here.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-29 10:20:15 +01:00
Christian Brauner
677e1d2769
attach: s/lxc_attach_drop_privs/drop_capabilities/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:34 +01:00
Christian Brauner
7e995801f8
attach: s/lxc_proc_close_ns_fd/close_nsfds/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:33 +01:00
Christian Brauner
b7873c951e
attach: add get_attach_context_nsfds()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:32 +01:00
Christian Brauner
1874ef7468
attach: move config init into get_attach_context()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:31 +01:00
Christian Brauner
d92c8e40d1
attach: move get_personality() into get_attach_context()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:30 +01:00
Christian Brauner
500ed81395
attach: move lxc_cmd_get_init_pid() int get_attach_context()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:25 +01:00
Christian Brauner
9745eb8aea
attach: split attach_context into allocation and initialization
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 19:18:16 +01:00
Christian Brauner
89b7bfe3ff
attach: s/calloc/zalloc/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 18:13:54 +01:00
Christian Brauner
dd53c8af7f
attach: rename attach_context helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 18:05:57 +01:00
Christian Brauner
ab919e5fb7
attach: s/lxc_proc_context_info/attach_context/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 18:04:23 +01:00
Christian Brauner
0e304baae8
attach: move lxc_proc_context_info to file local scope
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 17:57:51 +01:00
Christian Brauner
6f9fe5d02c
attach: order variables correctly
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 17:53:44 +01:00
Christian Brauner
5b514ce32b
attach: coding style fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-28 17:34:29 +01:00
Stéphane Graber
0fa84a8cd2
Merge pull request #3637 from brauner/2021-01-27/fixes
...
attach: fixes
2021-01-27 20:10:55 -05:00
Christian Brauner
b495984869
attach: add some DEBUG() logging to stdfd dpulication
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:55:02 +01:00
Christian Brauner
578d4b6202
attach: use close_prot_errno_disarm()
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:57 +01:00
Christian Brauner
dab02267f0
attach: make do_attach() void
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:54 +01:00
Christian Brauner
737a8d8515
attach: mark do_attach() as __noreturn
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:51 +01:00
Christian Brauner
16d19b34ea
attach: s/attach_child_main/do_attach/g
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:49 +01:00
Christian Brauner
7444657c87
attach: use free_disarm()
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:47 +01:00
Christian Brauner
7678371439
attach: coding style fixes
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:45 +01:00
Christian Brauner
ad001fb6d7
attach: use __do_close for labelfd
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:43 +01:00
Christian Brauner
4f3b6a85ed
attach: tweak logging
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:40 +01:00
Christian Brauner
e11f5b8c91
attach: use __do_free cleanup macro for cwd
...
but still yield memory immediately once we're done with it to not have it lying
around while the parent process is around.
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:38 +01:00
Christian Brauner
4f25e72fb0
attach: invert child/parent handling
...
This makes it more consistent with th rest of the shared library.
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 20:52:34 +01:00
Stéphane Graber
665fcdf903
Merge pull request #3636 from brauner/2021-01-27/fixes
...
conf: proc and sys mountpoint creation fixes
2021-01-27 11:34:01 -05:00
Christian Brauner
f4bea7cc76
conf: move proc and sys mountpoint creation int lxc_mount_auto_mounts()
...
Fixes: 493e00b68d
("mkdir -p /proc /sys on container startup")
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:48:05 +01:00
Christian Brauner
7b371c1e0b
conf: coding style fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:46:49 +01:00
Christian Brauner
e25af1bc38
conf: fix coding style
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:16:42 +01:00
Christian Brauner
e9636f4f48
Merge pull request #3634 from motiejus/mkdir-proc-sys
...
mkdir -p /proc /sys on container startup
2021-01-27 15:03:57 +01:00
Motiejus Jakštys
493e00b68d
mkdir -p /proc /sys on container startup
...
some containers don't have it, and strange things happen.
Signed-off-by: Motiejus Jakštys <motiejus@jakstys.lt>
2021-01-27 12:19:15 +02:00
Stéphane Graber
2c64170505
Merge pull request #3633 from brauner/2021-01-25/criu
...
cgroups: fixes and cgroup2 improvements
2021-01-26 11:04:22 -05:00
Christian Brauner
928b065d34
criu: handle cgroup2 freezer
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:58:41 +01:00
Christian Brauner
6dcd6f0284
cgroups: detect and record cgroup2 freezer support
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:35:54 +01:00
Christian Brauner
f914ae08c4
cgroups: rework cg_unified_init()
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:29:21 +01:00
Christian Brauner
09ed8992c5
cgroups: coding style fixes
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:29:18 +01:00
Christian Brauner
9cde8a8ab4
string_utils: add must_make_path_relative()
...
Stolen without shame from my previous implementation in LXCFS.
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:29:14 +01:00
Christian Brauner
d23cb29e64
file_utils: introduce read_file_at()
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-26 15:29:07 +01:00
Stéphane Graber
6f2f65909e
Merge pull request #3632 from brauner/2021-01-25/fixes
...
autotools: update build
2021-01-25 11:29:47 -05:00
Christian Brauner
b59bc011e3
autotools: update build
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-25 17:04:43 +01:00
Christian Brauner
1aaf81c338
configure: add AC_SYS_LARGEFILE checking
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-25 12:51:31 +01:00
Christian Brauner
123ca49e2d
config: update ax_pthread.m4
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-25 12:45:09 +01:00
Stéphane Graber
8061dd6e67
Merge pull request #3631 from brauner/2021-01-24/fixes
...
tree-wide: fix compilation with-Wstrict-prototypes -Wold-style-defini…
2021-01-24 21:05:21 -05:00
Christian Brauner
39b725730c
tree-wide: fix compilation with-Wstrict-prototypes -Wold-style-definition
...
Fixes : #3630
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-24 22:19:34 +01:00
Stéphane Graber
609d2b2e63
Merge pull request #3629 from brauner/2021-01-22/static_binaries
...
build: allow to build all binaries statically via --enable-static-binaries
2021-01-22 15:40:34 -05:00
Christian Brauner
1d91880163
autotools: enable static builds for commands
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 19:31:11 +01:00
Christian Brauner
8e43f33e65
autotools: enable static builds for tools
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 19:30:45 +01:00
Christian Brauner
014a65ef16
configure: support static binaries
...
Including openssl handling.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 19:30:15 +01:00
Christian Brauner
3382f3ede0
initutils: fix missing includes
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 18:08:27 +01:00
Christian Brauner
5f1269773c
tree-wide: fix some header inclusions
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 17:57:32 +01:00
Christian Brauner
2b6ad639eb
Merge pull request #3623 from cotequeiroz/seccomp
...
Fix compilation without seccomp when libseccomp is installed
2021-01-22 17:55:50 +01:00
Stéphane Graber
be0fb2f759
Merge pull request #3628 from brauner/2021-01-22/fixes
...
conf: fix containers retaining CAP_NET_ADMIN
2021-01-22 10:06:51 -05:00
Christian Brauner
7b854e37a7
lxc_attach: include rexec conditionally
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 15:45:22 +01:00
Christian Brauner
b85b44169a
lsm: remove obsolute comment about constructor
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 15:45:22 +01:00
Christian Brauner
e6d4df7895
cgroups: fix cgroup mounting
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 15:45:22 +01:00
Christian Brauner
5d1bf4c4e1
conf: fix containers retaining CAP_NET_ADMIN
...
Fixes : #3627
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-22 11:54:25 +01:00
Eneas U de Queiroz
67cd8bde2d
configure: skip libseccomp tests if it is disabled
...
Move the block checking for libseccomp api compatibility inside
AM_COND_IF([ENABLE_SECCOMP] ... ).
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-01-16 13:58:22 -03:00
Eneas U de Queiroz
a342b11fed
commands: fix check for seccomp notify support
...
Use HAVE_SECCOMP_NOTIFY instead of HAVE_DECL_SECCOMP_NOTIFY_FD.
Currently the latter will be true if the declaration is found by
configure, even if 'configure --disable-seccomp' is used.
HAVE_SECCOMP_NOTIFY is defined in lxcseccomp.h if both HAVE_SECCOMP and
HAVE_DECL_SECCOMP_NOTIFY_FD are true, which is the correct behavior.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-01-16 13:58:22 -03:00
Stéphane Graber
092529eaef
Merge pull request #3617 from motiejus/lxc-net-dnsmasq
...
make lxc-net's dnsmasq hermetic
2021-01-11 09:05:22 -05:00
Motiejus Jakštys
60a43d5564
make lxc-net hermetic w.r.t. existing dnsmasq config
...
lxc's dnsmasq will try to read system's dnsmasq if `--conf-file` is not
specified. This is likely not desirable, as lxc's dnsmasq should be
self-contained.
On my system the conflicting options are `--bind-interfaces` and
`--bind-dynamic`, since the same host is doing other DNS-y things
unrelated to lxc.
This is an incompatible change, since lxc's dnsmasq will stop honoring
system's `/etc/dnsmasq.conf`, and some systems may be relying on it.
Given that, I believe it should not depend on it by default, since
dnsmasq is lxc's implementation detail. However, if the user desires,
the old behavior could be brought back by setting
`LXC_DHCP_CONFILE=/etc/dnsmasq.conf` in `/etc/default/lxc-net`.
Signed-off-by: Motiejus Jakštys <motiejus@jakstys.lt>
2021-01-11 12:49:35 +02:00
Stéphane Graber
5e4dddcf9b
Merge pull request #3615 from sirh3e/master
...
Changed Version from 2.*.* to 4.*.*
2021-01-09 17:47:53 -05:00
sirh3e
949b3059a2
Changed Version from 2.*.* to 4.*.*
...
Signed-off-by: sirh3e <marvin.huber@bluewin.ch>
2021-01-09 20:24:59 +01:00
Stéphane Graber
239578849f
Merge pull request #3614 from brauner/2021-01-04/fixes
...
capability fixes
2021-01-04 12:19:00 +01:00
Christian Brauner
d84b26bc8b
conf: fix CAP_NET_ADMIN-based mount handling
...
Fixes: e8b9c9ec6f
("unmounted proc/sys/net if dropping CAP_NET_ADMIN")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 11:21:53 +01:00
Christian Brauner
309ae2876f
conf: add lxc_wants_cap() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 11:16:31 +01:00
Christian Brauner
fa934e3e24
macro: define all capabilities
...
Fixes : #3612
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 11:16:31 +01:00
Christian Brauner
7b4cd4681d
conf: add new capabilities CAP_{BLOCK_SUSPEND,PERFMON,BPF,CAP_CHECKPOINT_RESTORE}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 10:58:11 +01:00
Christian Brauner
f2da98c045
conf: define missing capabilities
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 10:50:07 +01:00
Christian Brauner
24b77f47ad
macro: use ascending order for capabilities
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-04 10:45:44 +01:00
Stéphane Graber
bfcd663fc7
Merge pull request #3608 from brauner/2020-12-27/no_rootfs
...
bugfixes
2020-12-28 05:39:53 -05:00
Christian Brauner
31b84c7a02
cgroup2: move bpf device cgroup program to struct cgroup_ops
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-27 18:44:00 +01:00
Christian Brauner
c1c9193cfc
utils: allow cross-device resolution
...
This is needed to enable containers without a rootfs.
Fixes : #3607
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-27 11:19:51 +01:00
Stéphane Graber
708e0653c8
Merge pull request #3603 from brauner/2020-12-15/bugfixes
...
confile: don't accidently alter lxc.cgroup.dir
2020-12-15 09:08:44 -05:00
Christian Brauner
c583072d67
confile: don't accidently alter lxc.cgroup.dir
...
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-15 11:58:35 +01:00
Christian Brauner
667fcc0e3c
confile: cleanup set_config_hooks()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-15 11:54:34 +01:00
Stéphane Graber
8a0e2272ac
Merge pull request #3601 from brauner/2020-12-14/bugfixes
...
conf: fix block-device based rootfs mounting
2020-12-14 17:42:29 -05:00
Christian Brauner
26ea5533c9
conf: fix block-device based rootfs mounting
...
Fixes : #3598
Cc: stable-4.0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-14 17:52:44 +01:00
Christian Brauner
970c8d964d
Merge pull request #3600 from zhenr667/3091
...
unmounted proc/sys/net by dropping CAP_NET_ADMIN
2020-12-14 10:31:36 +01:00
zhenr667
e8b9c9ec6f
unmounted proc/sys/net if dropping CAP_NET_ADMIN
...
Signed-off-by: Henry Zhang <henryzhang99@gmail.com>
2020-12-13 16:00:59 -06:00
Stéphane Graber
3aa3407f34
Merge pull request #3595 from brauner/2020-12-08/fixes
...
tree-wide: fixes
2020-12-10 15:37:24 -05:00
Christian Brauner
c3e4896776
criu: cleanup load_tty_major_minor()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:49:45 +01:00
Christian Brauner
1530e041bb
confile_utils: cleanup strprint()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:41:56 +01:00
Christian Brauner
bcdeed91f0
confile: cleanup set_config_net_l2proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
b41ff502ff
conf: fix unchecked return value
...
Fixes: Coverity: 1465854
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
999f5140b7
utils: fix unchecked return value
...
Fixes: Coverity 1465853
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
504ce601ba
cgroups/cgfsng: remove logically dead code
...
Fixes: Coverity 1461761
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
ae9ad0309d
storage/btrfs: add missing return
...
Fixes: Coverity 1461749
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
25619b9984
network: use empty initializer
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
af9bfc22e9
storage/lvm: cleanup do_lvm_create()
...
Fixes: Coverity 1461741
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
8b961418b7
utils: cleanup get_rundir()
...
Fixes: Coverity 1461740
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
f175de7c68
lxclock: cleanup lxclock_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:55 +01:00
Christian Brauner
e00c91eb33
lxclock: cleanup dump_stacktrace()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
e442322914
lxclock: cleanup lxc_putlock()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
129c915f8d
lxclock: cleanup lxcunlock()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
2263fd997d
lxclock: cleanup lxclock()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
82c1fd646a
lxclock: cleanup lxclock_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
a04dc6376c
lxclock: cleanup lxc_newlock()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
3274bfb5f1
lxclock: logically dead code
...
Fixes: Coverity 1461722
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
bc00122282
cmd/lxc_init: ignore return value
...
Fixes: Coverity 1440390
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:54 +01:00
Christian Brauner
546d016e56
confile_utils: cleanup sig_parse()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
2a169aec03
confile_utils: cleanup rt_sig_num()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
50692dc1d4
confile_utils: cleanup sig_num()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
a011ec99ba
confile_utils: cleanup lxc_inherit_namespace()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
fd47e5f1da
confile_utils: cleanup lxc_container_name_to_pid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
49aaa7546f
lxc: add cleanup helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
f6261b4630
confile_utils: cleanup new_hwaddr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:53 +01:00
Christian Brauner
ffb7e0f6c3
confile_utils: cleanup network_ifname()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
4f3de2ac12
confile_utils: cleanup set_config_bool_item()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
21af2fbed1
confile_utils: cleanup set_config_string_item_max()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
f4d287eaa2
confile_utils: cleanup set_config_string_item()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
6998880b52
confile_utils: cleanup lxc_ipvlan_flag_to_isolation()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
f2713131ea
confile_utils: cleanup lxc_ipvlan_isolation_to_flag()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
11e5a00f73
confile_utils: cleanup lxc_ipvlan_isolation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
c789d1625d
confile_utils: cleanup lxc_ipvlan_flag_to_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:52 +01:00
Christian Brauner
345c0c49ca
confile_utils: cleanup lxc_ipvlan_mode_to_flag()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
cdc5e0176a
confile_utils: cleanup lxc_ipvlan_mode
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
650664071c
confile_utils: cleanup lxc_macvlan_flag_to_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
fa204110ac
confile_utils: cleanup lxc_macvlan_mode_to_flag()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
faf7e3ba9e
confile_utils: cleanup lxc_macvlan_mode
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
97ea2c2dc9
confile_utils: cleanup lxc_veth_flag_to_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
9e75cf7afc
confile_utils: cleanup lxc_veth_mode_to_flag()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
ecf953c584
confile_utils: cleanup lxc_veth_mode
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:51 +01:00
Christian Brauner
89d66b41c7
confile_utils: cleanup lxc_free_networks()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:50 +01:00
Christian Brauner
06db6101d9
confile_utils: cleanup lxc_remove_nic_by_idx()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:50 +01:00
Christian Brauner
2a655c0d23
confile_utils: cleanup lxc_get_netdev_by_idx()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:50 +01:00
Christian Brauner
1e323af6dc
confile_utils: cleanup lxc_network_add()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-10 20:39:50 +01:00
Christian Brauner
a4809e4e56
confile_utils: cleanup parse_idmaps()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
17f781b35f
confile: cleanup lxc_list_net()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
efcba3c342
confile: lxc_list_subkeys()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
984853899a
confile: cleanup get_config_net_veth_ipv6_route()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
396acb62de
confile: cleanup get_config_net_ipv6_address()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
d8009ed2ea
confile: cleanup get_config_net_ipv6_gateway()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
5d4611dc5d
confile: cleanup get_config_net_veth_ipv4_route()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
c341054449
confile: cleanup get_config_net_ipv4_address()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:48 +01:00
Christian Brauner
f203e57c77
confile: cleanup get_config_net_ipv4_gateway()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
5b2a55098f
confile: cleanup get_config_net_vlan_id()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
d832a0864e
confile: cleanup get_config_net_mtu()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
8b123a8c08
confile: cleanup get_config_net_hwaddr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
f1bf5d72ec
confile: cleanup get_config_net_script_down()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
5ac4e7ba2b
confile: cleanup get_config_net_script_up()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
a90dc552f1
confile: cleanup get_config_net_veth_vlan_id()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
9e86b4429a
confile: cleanup get_config_net_veth_pair()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:47 +01:00
Christian Brauner
7d6ccf8c5f
confile: cleanup get_config_net_veth_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
56ce674701
confile: cleanup get_config_net_ipvlan_isolation()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
dff2db4204
confile: cleanup get_config_net_ipvlan_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
3d72edbef7
confile: cleanup get_config_net_macvlan_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
252de70466
confile: cleanup get_config_net_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
5cd78f55b0
confile: cleanup get_config_net_l2proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
30302ee950
confile: cleanup get_config_net_link()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
39d2d2d646
confile: cleanup get_config_net_flags()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:46 +01:00
Christian Brauner
ea9bf9f9ab
confile: cleanup get_config_net_type()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
05a9b9676d
confile: cleanup get_config_net_nic()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
b67488ec7c
confile: cleanup clr_config_net_veth_ipv6_route()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
2b592308fb
confile: cleanup clr_config_net_ipv6_address()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
209590443e
confile: cleanup clr_config_net_ipv6_gateway()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
6340f28f36
confile: cleanup clr_config_net_veth_ipv4_route()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
54148d6999
confile: cleanup clr_config_net_ipv4_address()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:45 +01:00
Christian Brauner
69a91fd3ff
confile: cleanup clr_config_net_ipv4_gateway()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
2c76b1ba2b
confile: cleanup clr_config_net_vlan_id()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
18bab943bd
confile: cleanup clr_config_net_mtu()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
afa97df575
confile: cleanup clr_config_net_hwaddr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
25dea1a3ce
confile: cleanup clr_config_net_script_down()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
9e1608ecc4
confile: cleanup clr_config_net_script_up()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
a69a835e96
confile: cleanup clr_config_net_veth_pair()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:44 +01:00
Christian Brauner
7b39759df9
confile: cleanup clr_config_net_veth_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
ce79ece834
confile: cleanup clr_config_net_ipvlan_isolation()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
6288bd5779
confile: cleanup clr_config_net_ipvlan_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
a0ea16c526
confile: cleanup clr_config_net_macvlan_mode()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
0171e2a991
confile: clr_config_net_l2proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
081461437f
confile: cleanup clr_config_net_link()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
a1ff93c95e
confile: cleanup clr_config_net_flags()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
24a2870414
confile: cleanup clr_config_net_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:43 +01:00
Christian Brauner
ee52bb2f8d
confile: cleanup clr_config_net_type()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:42 +01:00
Christian Brauner
ec35c656a8
confile: cleanup clr_config_net_nic()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:42 +01:00
Christian Brauner
d5c2cd94e8
confile: cleanup get_network_config_ops()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-09 15:01:42 +01:00
Christian Brauner
0c9621be8a
Merge pull request #3596 from blairsteven/restore_phys
...
Restore interfaces to the correct namespace on error
2020-12-09 10:30:42 +01:00
Blair Steven
abd953eb51
Restore interfaces to the correct namespace on error
...
If the container unexpectedly exists we may need to restore physical
interfaces back into the main namespace in a tidy way.
Signed-off-by: Blair Steven <blair.steven@alliedtelesis.co.nz>
2020-12-09 11:45:15 +13:00
Stéphane Graber
20aa280bf7
Merge pull request #3585 from AndrewElvisDeng/issue-1507
...
new standard resolver option in ldc-download.in shell script
2020-12-08 17:07:14 -05:00
Andrew Deng
67e7ac7b85
added standard resolver option to the lxc-download.in shell script
...
Signed-off-by: Andrew Deng <adeng1433@gmail.com>
2020-12-08 14:14:33 -06:00
Christian Brauner
218c46ec27
confile: cleanup get_config_includefiles()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:13 +01:00
Christian Brauner
5fab421ad4
confile: cleanup clr_config_init_cwd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:12 +01:00
Christian Brauner
df45b76185
confile: cleanup clr_config_init_cmd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:12 +01:00
Christian Brauner
e8f6cdb3db
confile: cleanup clr_config_execute_cmd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:12 +01:00
Christian Brauner
f9f6f28fcf
confile: cleanup clr_config_log_syslog()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:12 +01:00
Christian Brauner
9902a5d0ec
confile: cleanup clr_config_seccomp_notify_proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:07 +01:00
Christian Brauner
eaade76df1
confile: cleanup clr_config_seccomp_notify_proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:45:04 +01:00
Christian Brauner
46bc15734e
confile: cleanup clr_config_seccomp_notify_cookie()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:44:32 +01:00
Christian Brauner
0a6980fe59
confile: cleanup clr_config_seccomp_allow_nesting()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 18:44:12 +01:00
Christian Brauner
e68dfc256f
confile: cleanup clr_config_console_logfile()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:24:59 +01:00
Christian Brauner
2ed97e6fb4
confile: cleanup clr_config_console_path()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:24:42 +01:00
Christian Brauner
137ee4b660
confile: cleanup clr_config_uts_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:24:25 +01:00
Christian Brauner
30f8754d23
confile: cleanup clr_config_rootfs_options()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:24:08 +01:00
Christian Brauner
7decd4966f
confile: cleanup clr_config_rootfs_mount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:23:46 +01:00
Christian Brauner
ad16f12dcc
confile: cleanup clr_config_rootfs_path()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:23:19 +01:00
Christian Brauner
6620228b53
confile: cleanup clr_config_mount_fstab()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:22:59 +01:00
Christian Brauner
150c191e9d
confile: cleanup clr_config_log_file()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:22:36 +01:00
Christian Brauner
bd5501d2f5
confile: cleanup clr_config_cgroup_dir()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:22:16 +01:00
Christian Brauner
b60c8dd943
confile: cleanup clr_config_selinux_context_keyring()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:21:56 +01:00
Christian Brauner
6afcf6dd12
confile: cleanup clr_config_selinux_context()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:21:40 +01:00
Christian Brauner
1c64e3edec
confile: cleanup clr_config_apparmor_profile()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:21:23 +01:00
Christian Brauner
faf3d0aeab
confile: cleanup clr_config_tty_dir()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:21:04 +01:00
Christian Brauner
5ab1dbcf1a
confile: cleanup get_config_proc()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:20:22 +01:00
Christian Brauner
4b1ef6aa83
confile: cleanup get_config_sysctl()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:20:03 +01:00
Christian Brauner
4c12267ea0
confile: get_config_prlimit()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:19:38 +01:00
Christian Brauner
010d7debac
confile: cleanup get_config_seccomp_notify_proxy()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:19:09 +01:00
Christian Brauner
6d38035e34
confile: cleanup get_config_seccomp_notify_cookie()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:18:53 +01:00
Christian Brauner
254b5bdd0e
confile: cleanup get_config_seccomp_allow_nesting()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:18:24 +01:00
Christian Brauner
5a848c4bbe
confile: cleanup get_config_hooks()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:17:52 +01:00
Christian Brauner
2e5db3a230
confile: cleanup get_config_idmaps()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:16:56 +01:00
Christian Brauner
7820581456
confile: cleanup __get_config_cgroup_controller()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:16:28 +01:00
Christian Brauner
ad9a0d33e2
confile: set_config_no_new_privs()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:15:44 +01:00
Christian Brauner
b8a0e94463
confile: cleanup set_config_log_syslog()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:15:13 +01:00
Christian Brauner
4486ea13a8
confile: cleanup set_config_ephemeral()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:14:13 +01:00
Christian Brauner
29e78cb912
confile: cleanup clone_update_unexp_hooks()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:13:28 +01:00
Christian Brauner
b063ba290f
confile: cleanup clone_update_unexp_ovl_paths()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:13:05 +01:00
Christian Brauner
f2c644081a
confile: cleanup write_config()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:11:53 +01:00
Christian Brauner
966f56624c
confile: cleanup lxc_fill_elevated_privileges()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:11:14 +01:00
Christian Brauner
c852678bc2
confile: cleanup lxc_config_parse_arch()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:10:41 +01:00
Christian Brauner
bce0472ac2
confile: cleanup lxc_config_define_add()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:09:13 +01:00
Christian Brauner
2b4cdcdbd2
confile: cleanup parse_new_conf_line()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 17:08:22 +01:00
Christian Brauner
2e373df3da
confile: cleanup parse_line()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:41 +01:00
Christian Brauner
8f204445b4
confile: cleanup set_config_time_offset_monotonic()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:41 +01:00
Christian Brauner
b9965fd7b7
confile: cleanup set_config_time_offset_boot()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:41 +01:00
Christian Brauner
6c90df0ee9
confile: cleanup set_config_namespace_keep()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:41 +01:00
Christian Brauner
7454047d60
confile: cleanup set_config_namespace_clone()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:41 +01:00
Christian Brauner
cde6d8b465
confile: cleanup set_config_uts_name()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
f9d29e1f4e
confile: cleanup set_config_rootfs_options()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
d8cf02899d
confile: cleanup set_config_rootfs_path()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
c1b2319b94
confile: cleanup do_includedir()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
1161f50d9c
confile: cleanup append_unexp_config_line()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
a7ac0d1ef0
confile: cleanup set_config_console_size()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
3f5c01db8f
confile: cleanup set_config_console_buffer_size()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:40 +01:00
Christian Brauner
9a26e4af23
confile: cleanup set_config_console_rotate()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
c5c4831c19
confile: cleanup set_config_cap_drop()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
bd7c53713d
confile: cleanup set_config_cap_keep()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
48c367c013
confile: cleanup set_config_mount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
138079ee36
confile: cleanup set_config_mount_auto()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
e9cda8ec9b
confile: cleanup set_config_mount_fstab()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
5c856bcb40
confile: cleanup set_config_idmaps()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 16:49:39 +01:00
Christian Brauner
83332c2473
confile: cleanup set_config_proc()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
f10c80d258
confile: cleanup set_config_sysctl()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
8fa831e0dc
confile: cleanup set_config_prlimit()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
c521771abb
confile: cleanup set_config_cgroup_relative()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
ee91fa0616
confile: cleanup __set_config_cgroup_controller()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
c4d9b15942
confile: cleanup set_config_signal_stop()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
7d6b1a204a
confile: cleanup set_config_signal_reboot()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:50 +01:00
Christian Brauner
d12fabf8d6
confile: cleanup set_config_signal_halt()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
0c48b874fd
confile: cleanup set_config_log_level()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
806244c69d
confile: cleanup set_config_log_level()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
34f3b30a78
confile: cleanup set_config_log_file()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
7f44fda1da
confile: cleanup set_config_apparmor_raw()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
55a7689135
confile: cleanup set_config_apparmor_allow_nesting()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
042f87117f
confile: cleanup set_config_apparmor_allow_incomplete()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
755d653269
confile: cleanup set_config_tty_max()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:49 +01:00
Christian Brauner
a6bf1128eb
confile: cleanup set_config_environment()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
1543699535
confile: cleanup set_config_group()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
cb5f3df258
confile: cleanup set_config_monitor_signal_pdeath()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
e166597316
confile: cleanup set_config_monitor()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
572f6a1470
confile: cleanup set_config_start()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
49aabd9d60
confile: cleanup set_config_pty_max()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Christian Brauner
62af653cc1
confile: cleanup set_config_personality()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 15:40:48 +01:00
Wolfgang Bumiller
4c9ffb3e66
Merge pull request #3594 from brauner/2020-12-08/fixes
...
tree-wide: fixes and cleanups
2020-12-08 14:36:47 +01:00
Christian Brauner
ed1454e852
confile: clean up hooks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 12:19:04 +01:00
Christian Brauner
059a1ec30b
confile: clean up network configuration parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 12:18:08 +01:00
Christian Brauner
c4ef8f4c11
tree-wide: use call_cleaner(netns_freeifaddrs)
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-08 12:00:01 +01:00
Stéphane Graber
d1042c9dc4
Merge pull request #3593 from brauner/2020-12-07/bugfixes
...
2020 12 07/bugfixes
2020-12-07 10:25:54 -05:00
Christian Brauner
abd833eb58
macro: bump MAX_GRBUF_SIZE to 2 mb
...
Closes #3592 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-07 15:39:06 +01:00
Christian Brauner
052535c865
macro: move MAX_GRBUF_SIZE
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-12-07 11:25:58 +01:00
Stéphane Graber
065d331af0
Merge pull request #3589 from tych0/fix-nonet-cleanup
...
network: fix LXC_NET_NONE cleanup
2020-12-02 11:06:46 -05:00
Tycho Andersen
04213960f7
network: fix LXC_NET_NONE cleanup
...
We have a case where we have a nested container with LXC_NET_NONE run
inside a container that's *also* got no network namespace (run by
lxc-usernsexec).
The "am I root" check in this function then does not suffice, since the
euid of the task is 0 but it does not have privilege over its network
namespace, and thus cannot do any of the restore operations:
lxc foo 20201201232059.271 TRACE network - network.c:lxc_restore_phys_nics_to_netns:3299 - Moving physical network devices back to parent network namespace
lxc foo 20201201232059.271 ERROR network - network.c:lxc_restore_phys_nics_to_netns:3307 - Operation not permitted - Failed to enter network namespace
lxc foo 20201201232059.271 ERROR start - start.c:__lxc_start:2045 - Failed to move physical network devices back to parent network namespace
Let's check that we indeed did clone the network namespace, and thus have
things to restore to their correct namespace before attempting to actually
restore them.
I suspect it's possible we can also get rid of some of the network namespace
preservation stuff in start.c in the LXC_NET_NONE case.
Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2020-12-02 06:26:18 -08:00
Stéphane Graber
55f7e4d688
Merge pull request #3586 from tenforward/japanese
...
doc: Add lxc.cgroup.dir.monitor.pivot to Japanese man page
2020-11-21 10:56:16 -05:00
KATOH Yasufumi
74f9fb2c9d
doc: Add lxc.cgroup.dir.monitor.pivot to Japanese man page
...
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2020-11-22 00:26:35 +09:00
Stéphane Graber
4aa5a10e02
Merge pull request #3583 from brauner/2020-11-18/fixes
...
commands_utils: fix lxc-wait
2020-11-18 16:33:10 -05:00
Christian Brauner
d2bab66fa9
commands_utils: fix lxc-wait
...
Closes : #3570
Fixes: 7792a5b60f
("commands: add additional check to lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-18 21:06:37 +01:00
Stéphane Graber
2cc8d550f8
Merge pull request #3582 from brauner/2020-11-17/bugfixes
...
file_utils: fix config file parsing
2020-11-17 18:22:50 -05:00
Christian Brauner
7d84e2cd65
file_utils: fix config file parsing
...
We accidently used the "bytes_to_write" variable after we've written all the
bytes at which point it is guaranteed to be 0. Let's use the "bytes_read"
variable instead.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-17 22:34:05 +01:00
Stéphane Graber
59c6b06611
Merge pull request #3581 from brauner/2020-11-16/fixes
...
conf: improve mountinfo and config parsing
2020-11-16 09:50:14 -05:00
Christian Brauner
a39fc34bd6
conf: switch to fd_to_fd() when copying mountinfo
...
Closes : #3580 .
Link: https://bugzilla.kernel.org/show_bug.cgi?id=209971
Suggested-by: Joan Bruguera <joanbrugueram@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-16 14:41:36 +01:00
Christian Brauner
26dffd8258
parse: rework config parsing routine
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-16 14:41:36 +01:00
Christian Brauner
c875dc6374
Merge pull request #3579 from lifeng68/master
...
cgfsng: adjust log level to warn instead of error
2020-11-13 16:03:48 +01:00
lifeng68
34375fd74c
cgfsng: adjust log level to warn instead of error
...
Signed-off-by: lifeng68 <lifeng68@huawei.com>
2020-11-13 13:49:21 +08:00
Stéphane Graber
74294d76f9
Merge pull request #3577 from brauner/2020-11-05/bugfixes
...
attach: silence stdio permission adjust warnings
2020-11-05 18:08:25 -05:00
Christian Brauner
a2c26befc9
attach: silence stdio permission adjust warnings
...
Closes : #3576 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-05 20:25:29 +01:00
Stéphane Graber
056b6a60bc
Merge pull request #3574 from Drachenfels-GmbH/seccomp-fixes
...
Add missing free for monitor_pivot_dir.
2020-11-05 12:50:18 -05:00
Ruben Jenster
eb60b5648b
Add missing free for monitor_pivot_dir.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-11-05 11:03:18 +01:00
Stéphane Graber
9f39b9e2f4
Merge pull request #3572 from brauner/2020-11-02/seccomp_nonblocking
...
seccomp: fixes
2020-11-02 12:58:43 -05:00
Christian Brauner
0d724ab4f4
seccomp: log aborted system calls
...
Suggested-by: Jann Horn <jann@thejh.net>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-02 16:48:52 +01:00
Christian Brauner
a60c98aaf6
seccomp: make seccomp notifier fd non-blocking
...
Suggested-by: Jann Horn <jann@thejh.net>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-11-02 16:48:52 +01:00
Stéphane Graber
7fde74f375
Merge pull request #3568 from brauner/2020-10-28/fixes
...
coverity fixes
2020-10-28 08:02:51 -04:00
Christian Brauner
65129087f4
attach: require that LXC_ATTACH_LSM_LABEL is specified
...
to avoid liblxc stumbling over an smaller struct passed in from an older
liblxc. In the future we should version by size but this requires a new
attach2().
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-28 04:16:41 +01:00
Christian Brauner
0dde733e5a
utils: check snprintf return value
...
Fixes: Coverity 1465853
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-28 04:04:42 +01:00
Christian Brauner
8ddf34f7a0
conf: check snprint return value
...
Fixes: Coverity 1465854
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-28 04:03:31 +01:00
Christian Brauner
3715d0c03f
utils: don't deref after NULL check
...
Fixes: Coverity 1465855
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-28 04:01:19 +01:00
Christian Brauner
ec0befee94
commands: don't deref after NULL check
...
Fixes: Coverity 1465657
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-28 03:58:54 +01:00
Christian Brauner
bf0b9c1ed6
Merge pull request #3567 from blenk92/lxc-attach-selinux
...
lxc-attach: Enable setting the SELinux context
2020-10-27 17:45:46 +01:00
Christian Brauner
a093bb0f5c
Merge pull request #3563 from Drachenfels-GmbH/cgroup-fixes
...
cgroups: Introduce lxc.cgroup.dir.monitor.pivot - fixes cgroup removal on termination
2020-10-27 17:44:59 +01:00
Christian Brauner
5fd31e375f
Merge pull request #3562 from Drachenfels-GmbH/seccomp-fixes
...
seccomp: fix pseudo syscalls, improve logging and avoid duplicate processing
2020-10-27 17:44:38 +01:00
Christian Brauner
10397a8031
Merge pull request #3565 from Drachenfels-GmbH/test-fixes
...
tests: Fix compilation with appamor enabled.
2020-10-27 17:14:16 +01:00
Christian Brauner
dd8d550919
Merge pull request #3564 from Drachenfels-GmbH/fixes
...
lxccontainer: fix lxc_config_item_is_supported
2020-10-27 17:12:51 +01:00
Maximilian Blenk
8455e39efe
lxc-attach: Enable setting the SELinux context
...
Enable lxc-attach to set the SELinux context that the user will end up
in when attaching to a container (This can be used to overwrite the
context set in the config file). If the option is not used, behavior
will be as before
Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
2020-10-27 17:03:20 +01:00
Ruben Jenster
beff993939
tests: Fix compilation with appamor enabled.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-27 09:48:34 +01:00
Ruben Jenster
6eb516a793
lxccontainer: fix lxc_config_item_is_supported
...
Use exact match instead of longest prefix match
to check whether a config item is supported.
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-27 09:47:55 +01:00
Ruben Jenster
7696c1f9d1
Introduce lxc.cgroup.dir.monitor.pivot
...
On termination lxc may fail to remove either lxc.cgroup.dir or lxc.cgroup.dir.monitor,
because the monitor process may still be a member of either of these cgroups.
The pivot cgroup should not be a member (subpath) of any other container cgroup (dir).
because only empty cgroups can be removed.
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-27 09:23:01 +01:00
Ruben Jenster
15044cd19c
seccomp: Avoid duplicate processing of rules for host native arch.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-27 08:37:52 +01:00
Ruben Jenster
0ff0d23e40
seccomp: Fix handling of pseudo syscalls and improve logging for rule processing.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-27 08:35:00 +01:00
Stéphane Graber
c8fe11552a
Merge pull request #3561 from tenforward/japanese
...
Update Japanese pam_cgfs(8) to reflect lack of support for pure cgroupv2
2020-10-24 13:59:10 -04:00
KATOH Yasufumi
bf73687ae5
Update Japanese pam_cgfs(8) to reflect lack of support for pure cgroupv2
...
Update for commit b87ed83bbc
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2020-10-25 01:35:35 +09:00
Stéphane Graber
c639f45ee5
Merge pull request #3559 from brauner/2020-10-20/fixes
...
conf: account for early return when sending devpts fd
2020-10-20 12:21:53 -04:00
Christian Brauner
185b9ee91b
conf: account for early return when sending devpts fd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-20 17:41:06 +02:00
Stéphane Graber
f4da1c37e6
Merge pull request #3558 from brauner/2020-10-20/fixes
...
conf: always send response to parent waiting for devptfs_fd
2020-10-20 08:22:49 -04:00
Christian Brauner
68f3899e4a
conf: always send response to parent waiting for devptfs_fd
...
When no devpts devices are requested we used to return early but did not send a
response to the parent. This is a problem because the parent will be waiting
for a devpts fd to be sent. Make sure to always send a response.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-20 13:34:24 +02:00
Stéphane Graber
1593efb5d7
Merge pull request #3556 from brauner/2020-10-19/fixes
...
startup fixes
2020-10-19 08:29:16 -04:00
Christian Brauner
fbfe5c8208
start: improve devpts fd sending
...
Closes : #3549 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-19 12:18:54 +02:00
Christian Brauner
5befd767a6
sync: log synchronization states
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-19 12:18:53 +02:00
Christian Brauner
35f0c46e0d
sync: switch to new error helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-19 12:18:53 +02:00
Stéphane Graber
a282f7792f
Merge pull request #3555 from brauner/2020-10-16/seccomp
...
seccomp: fix compilation on powerpc
2020-10-16 08:17:26 -04:00
Christian Brauner
50926f4b2c
seccomp: fix compilation on powerpc
...
Link: https://launchpadlibrarian.net/502200189/buildlog_snap_ubuntu_bionic_ppc64el_lxd-latest-edge_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-16 12:22:57 +02:00
Wolfgang Bumiller
eb587451d0
Merge pull request #3553 from brauner/2020-10-15/seccomp
...
seccomp: bugfixes
2020-10-15 11:38:49 +02:00
Christian Brauner
dc70d7e4fb
seccomp: improve default notification sending
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-15 10:08:53 +02:00
Christian Brauner
a76fe490dc
seccomp: log invalid seccomp notify ids
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-15 09:44:01 +02:00
Christian Brauner
186ff2beaf
Merge pull request #3548 from Drachenfels-GmbH/master
...
seccomp: Check if syscall is supported on compat architecture.
2020-10-13 22:12:29 +02:00
Ruben Jenster
fbec5f832b
seccomp: Check if syscall is supported on compat architecture.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-10-13 17:21:50 +02:00
Stéphane Graber
11d123becb
Merge pull request #3541 from Mingli-Yu/master
...
Remove obsolete setting regarding the Standard Output
2020-09-23 08:01:11 -04:00
Mingli Yu
a7a92a06a4
Remove obsolete setting regarding the Standard Output
...
The Standard output type "syslog" is obsolete, causing a warning since systemd
version 246 [1].
Please consider using "journal" or "journal+console"
[1] https://github.com/systemd/systemd/blob/master/NEWS#L202
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
2020-09-23 07:03:02 +00:00
Stéphane Graber
c37c7b91af
Merge pull request #3540 from brauner/2020-09-17/fixes_2
...
lxc-usernsexec: setgroups() similar to other places shouldn't fail on…
2020-09-17 13:11:20 -04:00
Christian Brauner
3f6e5c831e
lxc-usernsexec: setgroups() similar to other places shouldn't fail on EPERM
...
FAIL: lxc-tests: lxc-test-usernsexec (1s)
---
as test-userns executing /tmp/autopkgtest.waGEXj/build.Hm3/src/src/tests/lxc-test-usernsexec
uid=1001 gid=1001 name=test-userns subuid=165536 subgid=165536 ver=1:4.0.4-0ubuntu3
lxc-utils=1:4.0.4-0ubuntu3 kver=5.8.0-19-generic
USERNSEXEC=lxc-usernsexec
nouidgid: PASS
myuidgid: FAIL - runtest failed 1
$ lxc-usernsexec -mu:0:1001:1 -mg:0:1001:1 -- /tmp/autopkgtest.waGEXj/build.Hm3/src/src/tests/lxc-test-usernsexec inside f0
lxc 20200914222824.562 ERROR utils - utils.c:lxc_setgroups:1363 - Operation not permitted - Failed to setgroups()
kid 73112 is gone 1
subuidgid: PASS
bothsets: PASS
mismatch: PASS
ERRORS: myuidgid
---
Reported-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-09-17 17:46:00 +02:00
Stéphane Graber
b324a25500
Merge pull request #3539 from brauner/2020-09-17/fixes
...
commands: don't fail if unfreeze fails
2020-09-17 11:30:14 -04:00
Christian Brauner
8db8adea44
commands: don't fail if unfreeze fails
...
We can e.g. fail the unfreeze because the freezer cgroup is not available and
then we erronously report that stopping the container failed.
Closes : #3471 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-09-17 15:51:41 +02:00
Christian Brauner
4226b2e5af
Merge pull request #3532 from alliedtelesis/fix_lxc_attach_crash
...
avoid a NULL pointer dereference in lxc-attach
2020-09-03 10:11:41 +02:00
Christian Brauner
c3941f32de
attach: use lxc_terminal_signal_sigmask_safe_blocked()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-09-03 08:40:52 +12:00
Christian Brauner
3e3f79bdcd
terminal: introduce lxc_terminal_signal_sigmask_safe_blocked()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-09-03 08:40:42 +12:00
Scott Parlane
d9346e19eb
avoid a NULL pointer dereference in lxc-attach
...
Seems to appear when stderr is a terminal and not stdin or stdout.
Signed-off-by: Scott Parlane <scott.parlane@alliedtelesis.co.nz>
2020-09-02 17:04:45 +12:00
Christian Brauner
9cc837ef2c
Merge pull request #3531 from JingWoo/cleancode
...
remove useless parameters
2020-08-28 12:12:56 +02:00
wujing
a7c6e83042
remove useless parameters
...
Signed-off-by: wujing <Jing.Woo@outlook.com>
2020-08-28 16:49:00 +08:00
Stéphane Graber
46fd283b50
Merge pull request #3530 from brauner/2020-08-25/fixes
...
cgroups: fix armhf builds
2020-08-25 08:45:14 -04:00
Christian Brauner
00f848f31a
Merge pull request #3529 from pranaysrivastava/fixup_rootfs_detection
...
Check only rootfs as filesystem type
2020-08-25 12:30:37 +02:00
Christian Brauner
9fd047d158
cgroups: fix armhf builds
...
Link: https://launchpadlibrarian.net/494473462/buildlog_ubuntu-groovy-armhf.lxc_1%3A4.0.4-0ubuntu2_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-25 12:27:10 +02:00
Pranay Kr. Srivastava
97edebfacd
Check only rootfs as filesystem type
...
When detecting if rootfs is on ramfs instead of checking "- rootfs
rootfs" which is the " - <file_system> <device>" information only check
the file system type. This is due to a change introduced in kernel where
ramfs file system doesn't set the device to "rootfs" but instead mark it
as "none". By making sure we only check for "rootfs" as the file system
name we also offer backward compatibility with earlier kernels as well.
The kernel commit that introduced this change was
commit f32356261d44d580649a7abce1156d15d49cf20f
Author: David Howells <dhowells@redhat.com>
Date: Mon Mar 25 16:38:31 2019 +0000
vfs: Convert ramfs, shmem, tmpfs, devtmpfs, rootfs to use the new
mount API
Signed-off-by: Pranay Kr. Srivastava <pranay.srivastava@pantacor.com>
2020-08-24 13:40:15 +05:30
Stéphane Graber
c22a1a4a52
Merge pull request #3528 from graysky2/master
...
remove deprecated options in lxc.service fixes #3527
2020-08-21 12:10:50 -04:00
Stéphane Graber
256928ac60
Merge pull request #3526 from brauner/2020-08-21/fixes
...
cgfsng: fix cgroup attach cgroup creation
2020-08-21 12:10:29 -04:00
graysky
0c4cd88d4a
remove deprecated options in lxc.service fixes #3527
...
Signed-off-by: graysky <graysky@archlinux.us>
2020-08-21 06:33:49 -04:00
Christian Brauner
c80c9a70bc
cgfsng: fix cgroup attach cgroup creation
...
[01m[Kcgroups/cgfsng.c:[m[K In function ‘[01m[Kcgroup_attach_leaf.constprop[m[K’:
[01m[Kcgroups/cgfsng.c:2221:10:[m[K [01;31m[Kerror: [m[Kwriting 1 byte into a region of size 0 [[01;31m[K-Werror=stringop-overflow=[m[K]
2221 | [01;31m[K*slash = '\0'[m[K;
| [01;31m[K~~~~~~~^~~~~~[m[K
[01m[Kcgroups/cgfsng.c:2213:8:[m[K [01;36m[Knote: [m[Kat offset -13 to object ‘[01m[Kattach_cgroup[m[K’ with size 23 declared here
2213 | char [01;36m[Kattach_cgroup[m[K[STRLITERALLEN(".lxc-1000/cgroup.procs") + 1];
| [01;36m[K^~~~~~~~~~~~~[m[K
[01m[Kcgroups/cgfsng.c:2229:10:[m[K [01;31m[Kerror: [m[Kwriting 1 byte into a region of size 0 [[01;31m[K-Werror=stringop-overflow=[m[K]
2229 | [01;31m[K*slash = '/'[m[K;
| [01;31m[K~~~~~~~^~~~~[m[K
[01m[Kcgroups/cgfsng.c:2213:8:[m[K [01;36m[Knote: [m[Kat offset -13 to object ‘[01m[Kattach_cgroup[m[K’ with size 23 declared here
2213 | char [01;36m[Kattach_cgroup[m[K[STRLITERALLEN(".lxc-1000/cgroup.procs") + 1];
| [01;36m[K^~~~~~~~~~~~~[m[K
[01m[Kcgroups/cgfsng.c:2229:10:[m[K [01;31m[Kerror: [m[Kwriting 1 byte into a region of size 0 [[01;31m[K-Werror=stringop-overflow=[m[K]
2229 | [01;31m[K*slash = '/'[m[K;
| [01;31m[K~~~~~~~^~~~~[m[K
[01m[Kcgroups/cgfsng.c:2213:8:[m[K [01;36m[Knote: [m[Kat offset -13 to object ‘[01m[Kattach_cgroup[m[K’ with size 23 declared here
2213 | char [01;36m[Kattach_cgroup[m[K[STRLITERALLEN(".lxc-1000/cgroup.procs") + 1];
| [01;36m[K^~~~~~~~~~~~~[m[K
Link: https://launchpadlibrarian.net/494354168/buildlog_ubuntu-groovy-armhf.lxc_1%3A4.0.4-0ubuntu1_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-21 10:32:03 +02:00
Stéphane Graber
9d3b7c97f0
Merge pull request #3522 from avr1254/master
...
Updated documentation to reflect lack of support for pure cgroupv2
2020-08-17 00:04:30 -04:00
Arjun Ramachandrula
b87ed83bbc
Updated documentation to reflect lack of support for pure cgroupv2
...
Signed-off-by: Arjun Ramachandrula <arjun.ramachandrula@gmail.com>
2020-08-15 16:16:03 -04:00
Stéphane Graber
76a59906e8
Merge pull request #3518 from brauner/2020-08-12/fixes
...
lsm: remove the need for atomic operations
2020-08-12 17:31:08 -04:00
Christian Brauner
af04d84752
lsm: remove the need for atomic operations
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-12 22:42:40 +02:00
Stéphane Graber
b799325655
Merge pull request #3517 from brauner/2020-08-10/fixes_2
...
lsm: rewrite
2020-08-11 08:28:19 -04:00
Christian Brauner
3bb6ff017b
lsm: use atomic in ase we're used multi-threaded
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-11 10:32:01 +02:00
Christian Brauner
d701d729f6
lsm: rework lsm handling
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-11 09:41:27 +02:00
Stéphane Graber
d333aeb4fe
Merge pull request #3514 from brauner/2020-08-10/fixes
...
conf: terminal and /dev hardening
2020-08-10 14:41:00 -04:00
Christian Brauner
8ea93a0fa7
terminal: harden terminal allocation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-10 16:05:14 +02:00
Christian Brauner
953db219da
conf: move /dev setup to be file descriptor based
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-10 11:01:42 +02:00
Stéphane Graber
567104e59e
Merge pull request #3513 from brauner/2020-08-09/openat2
...
openat2() and safe mounting
2020-08-09 22:39:45 -04:00
Christian Brauner
d43d5191b5
conf: harden lxc_fill_autodev() via save_mount_beneath_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:33 +02:00
Christian Brauner
6f61472bea
file_utils: add exists_dir_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:32 +02:00
Christian Brauner
ae9215cfc0
conf: make use of stashed container mountpoint fd in mount_autodev()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:32 +02:00
Christian Brauner
31f8b2fd47
conf: stash file descriptor to root mountpoint in struct lxc_rootfs
...
This way we only need to open it _once_ per container startup.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:31 +02:00
Christian Brauner
43535b6d26
utils: introduce safe_mount_beneath_at()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:31 +02:00
Christian Brauner
8b1f4dd9b3
cgfsng: use safe_mount_beneath()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:31 +02:00
Christian Brauner
ee8eeba881
conf: switch mount_autodev() to new safe_mount_beneath() helper
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:30 +02:00
Christian Brauner
65f0afdee2
utils: add safe_mount_beneath() based on openat2()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:30 +02:00
Christian Brauner
2b0c810617
syscalls: add openat2()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-09 19:52:30 +02:00
Christian Brauner
da0fdceb6d
Merge pull request #3512 from stgraber/master
...
lxc-download fixes
2020-08-07 21:40:56 +02:00
Stéphane Graber
e14546e377
lxc-download: Fix retry loop
...
Closes #3511
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-08-07 15:10:25 -04:00
Stéphane Graber
459fef2680
Revert "templates/lxc-download.in: use GPG option --receive-keys instead of --recv-keys"
...
This reverts commit 409040e702
.
Testing of both options show identical behavior but receive-keys does
not exist on older releases, so let's revert this.
Closes #3510
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-08-07 15:09:01 -04:00
Stéphane Graber
dc9074bb79
Merge pull request #3509 from brauner/2020-08-06/fixes
...
api-extension: add missing seccomp_proxy_send_notify_fd extension
2020-08-06 11:51:32 -04:00
Christian Brauner
0dd2e321c2
api-extension: add missing seccomp_proxy_send_notify_fd extension
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-06 17:33:09 +02:00
Stéphane Graber
2a35d949b8
Merge pull request #3508 from brauner/2020-08-06/fixes
...
seccomp: add seccomp_notify_fd_active api extension
2020-08-06 09:27:31 -04:00
Christian Brauner
ec49d30f57
seccomp: send notify fd as part of the message
...
Since we haven't made this official api yet: YOLO
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-06 15:09:12 +02:00
Christian Brauner
2140576960
seccomp: add seccomp_notify_fd_active api extension
...
which allows to retrieve an active seccomp notifier fd from a running
container.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-06 14:40:13 +02:00
Stéphane Graber
05af17d749
Merge pull request #3507 from brauner/2020-08-06/fixes
...
seccomp: don't close the mainloop, simply remove the handler
2020-08-06 08:38:06 -04:00
Christian Brauner
eb551cefed
seccomp: don't close the mainloop, simply remove the handler
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-06 14:14:10 +02:00
Stéphane Graber
c601840017
Merge pull request #3506 from brauner/2020-08-05/safe_native_terminal_allocation
...
macro: define TIOCGPTPEER if missing
2020-08-05 15:14:28 -04:00
Christian Brauner
cfca9ccddc
conf: use openat() instead of open_tree()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-05 20:50:27 +02:00
Christian Brauner
07002a08c1
macro: define TIOCGPTPEER if missing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-05 16:44:53 +02:00
Stéphane Graber
1f15c1c3a2
Merge pull request #3505 from brauner/2020-08-05/safe_native_terminal_allocation
...
terminal: safely allocate pts devices from inside the container
2020-08-05 10:10:52 -04:00
Christian Brauner
f797f05e6e
terminal: safely allocate pts devices from inside the container
...
This was a year long journey which seems to finally have come to an end.
Closes : #1620 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-05 15:16:51 +02:00
Stéphane Graber
2d19c5e172
Merge pull request #3504 from brauner/2020-08-04/fixes
...
conf: ensure that the idmap pointer itself is freed
2020-08-03 20:53:01 -04:00
Christian Brauner
7e62126388
conf: ensure that the idmap pointer itself is freed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-04 00:05:05 +02:00
Christian Brauner
f3bbb01f8a
Merge pull request #3501 from ffontaine/master
...
syscall: don't fail if __NR_signalfd is not defined
2020-07-28 13:25:48 +02:00
Fabrice Fontaine
3341e204dc
syscall: don't fail if __NR_signalfd is not defined
...
lxc fails to build if __NR_signalfd is not defined since version 4.0.0
and
bed09c9cc0
However, some architectures don't define __NR_signalfd but only
__NR_signalfd4. This is the case for example for nios2 or csky:
f9ac84f92f/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
f9ac84f92f/sysdeps/unix/sysv/linux/csky/arch-syscall.h
Fixes:
- http://autobuild.buildroot.org/results/75096a48d2dbda57459523db3ed0952e63f93535
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-07-28 12:44:43 +02:00
Stéphane Graber
79c66a2af3
Merge pull request #3500 from brauner/2020-07-27/seccomp_notify_cleanup
...
seccomp: add missing header
2020-07-27 12:02:48 -04:00
Christian Brauner
e4353a7fc4
seccomp: add missing header
...
Fixes: https://launchpadlibrarian.net/490341075/buildlog_snap_ubuntu_bionic_amd64_lxd-latest-edge_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-27 17:26:42 +02:00
Stéphane Graber
64cbd48aa3
Merge pull request #3499 from brauner/2020-07-27/seccomp_notify_cleanup
...
seccomp: remove seccomp fd from event loop after task exited
2020-07-27 08:16:30 -04:00
Christian Brauner
b2acb9dce9
seccomp: remove seccomp fd from event loop after task exited
...
Linux v5.8 will land my patch where seccomp notifies when a filter goes unused,
i.e. when the last task using a given seccomp filter has exited. This wasn't
possible before and so we accumulated file descriptors in the container's event
loop whenever we attached to the container.
I'm not sure whether the task exiting before we could handle its syscall should
cause us to report and error or not. For now, let's simply close the event loop
and not report an error.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-27 10:15:20 +02:00
Stéphane Graber
aaab14d098
Merge pull request #3498 from brauner/master
...
selinux: remove security_context_t usage as it's deprecated
2020-07-25 12:49:14 -04:00
Christian Brauner
c18de5225b
selinux: remove security_context_t usage as it's deprecated
...
Link: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1888705
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-25 11:36:46 +02:00
Stéphane Graber
d312ef6849
Merge pull request #3497 from brauner/2020-07-23/fix_snap_compilation
...
autotools: fix Makefile
2020-07-23 12:52:37 -04:00
Stéphane Graber
c10c8a61e6
Merge pull request #3496 from brauner/2020-07-18/mount_pid
...
new mount api support: basics
2020-07-23 10:34:36 -04:00
Christian Brauner
7a7286393a
Makefile: fix Makefile
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:33:33 +02:00
Christian Brauner
18780b9068
log: don't break logging by hiding symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
657256e0b8
attach: use new mount api
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
14df702190
mount_utils: add mount_filesystem() helper
...
that translates between the two mount apis.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
7f88a1a2f6
mount_utils: add mount utils
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
7f1d397bbd
syscalls: add fsmount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
9edfcaa822
syscalls: add fsconfig()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
749bc40479
syscalls: add fspick()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:50 +02:00
Christian Brauner
49b21cd7d9
syscalls: add fsopen()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-23 10:20:48 +02:00
Stéphane Graber
8bdacc22a4
Merge pull request #3492 from brauner/2020-07-18/visibility_hidden
...
tree-wide: hide unnecessary symbols
2020-07-22 14:39:53 -04:00
Stéphane Graber
07f25184e9
Merge pull request #3495 from siv0/boot_id_remount_apparmor_fix
...
apparmor: Allow ro remount of boot_id
2020-07-22 13:05:49 -04:00
Stoiko Ivanov
3646e8acef
apparmor: Allow ro remount of boot_id
...
The rule added in 863845075d
did not cover all
necessary mount calls for /proc/sys/kernel/random/boot_id
(in src/lxc/conf.c: lxc_setup_boot_id) - the ro remount is missing.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-07-22 14:13:39 +02:00
Christian Brauner
945daa2406
start: simplify gotos
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-22 10:46:05 +02:00
Christian Brauner
59eac805a3
tree-wide: hide further unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 15:44:43 +02:00
Christian Brauner
2284f8a505
storage: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 14:01:31 +02:00
Christian Brauner
d6728cb356
arguments: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 13:45:37 +02:00
Christian Brauner
ebbde1732c
lsm: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 13:43:46 +02:00
Christian Brauner
c332ec90f0
cgroups: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 13:28:08 +02:00
Christian Brauner
78ad1eb09d
uuid: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 13:20:41 +02:00
Christian Brauner
5f1b09866f
utils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 13:15:25 +02:00
Christian Brauner
cd6b82e44c
terminal: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 12:44:09 +02:00
Christian Brauner
bf1ca416a2
sync: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 12:37:28 +02:00
Christian Brauner
1bf5f8123e
state: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 12:30:53 +02:00
Christian Brauner
8c8cd08712
start: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-21 12:24:45 +02:00
Christian Brauner
f6fea47396
ringbuf: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:49:55 +02:00
Christian Brauner
0b07c6c162
rexec: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:46:13 +02:00
Christian Brauner
92a10958c9
process_utils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:45:02 +02:00
Christian Brauner
a804cff749
parse: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:38:05 +02:00
Christian Brauner
1d332c47dc
network: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:28:11 +02:00
Christian Brauner
9e20bf04e0
namespace: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:18:39 +02:00
Christian Brauner
85b035a134
monitor: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:09:19 +02:00
Christian Brauner
d50aa57f9b
mainloop: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 18:05:28 +02:00
Christian Brauner
d6e12907a0
lxcseccomp: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 17:47:19 +02:00
Christian Brauner
a7692df573
lxclock: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 17:22:31 +02:00
Christian Brauner
07d1f84ab2
log: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 17:11:50 +02:00
Christian Brauner
f575e7efcc
initutils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 16:43:14 +02:00
Christian Brauner
4a9ee78a84
file_utils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 16:31:53 +02:00
Christian Brauner
a10ce5a8a5
error: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 16:17:45 +02:00
Christian Brauner
590b39e50b
criu: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 16:11:14 +02:00
Christian Brauner
f64e249db7
confile_utils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-20 16:10:28 +02:00
Christian Brauner
63c2a0bf06
confile: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-18 19:28:11 +02:00
Stéphane Graber
66c08be391
Merge pull request #3490 from brauner/master
...
lxc-ls: bugfixes
2020-07-18 11:09:46 -04:00
Christian Brauner
d6115c3a38
lxc-ls: bugfixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-18 13:27:14 +02:00
Stéphane Graber
9cd0179fe9
Makefile.am: Fix typo
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-07-17 19:03:59 -04:00
Stéphane Graber
60675a9792
Merge pull request #3488 from brauner/2020-07-17/fixes
...
hide unnecessary symbols I
2020-07-17 18:30:47 -04:00
Christian Brauner
efb7e30416
conf: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-18 00:15:12 +02:00
Christian Brauner
94a5e86b65
commands_utils: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:32:12 +02:00
Christian Brauner
7ebbfe8946
commands: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:30:49 +02:00
Christian Brauner
0550496b62
caps: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:24:23 +02:00
Christian Brauner
9f68a800b9
attach: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:16:08 +02:00
Christian Brauner
035db741de
af_unix: hide unnecessary symbols
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:14:38 +02:00
Christian Brauner
99bf8f2155
string_utils: make all helpers hidden
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 23:12:28 +02:00
Christian Brauner
6822ba9be9
compiler: add and use __hidden visbility
...
Closes : #3485 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 22:55:02 +02:00
Christian Brauner
3a02699695
network: remove unused variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-17 22:18:26 +02:00
Christian Brauner
8bbca3ccf2
Merge pull request #3487 from samboyles1/master
...
Improve efficiency of lxc_ifname_alnum_case_sensitive
2020-07-17 14:13:26 +02:00
Sam Boyles
4810a7a3e6
Improve efficiency of lxc_ifname_alnum_case_sensitive
...
To detect if a newly generated interface name is a duplicate of an existing interface lxc_ifname_alnum_case_sensitive() currently gets a list of all interfaces using netns_getifaddrs(). When the system has a small number of interfaces this works fine, however when there are thousands or tens of thousands of interfaces this quickly becomes less than optimal.
As we only need to check if an interface name exists, and do not need the detailed information about the interfaces provided by netns_getifaddrs(), we can instead use the if_nametoindex() function, which is much more efficient.
Signed-off-by: Sam Boyles <sam.boyles@alliedtelesis.co.nz>
2020-07-17 14:26:51 +12:00
Stéphane Graber
19be19a352
Merge pull request #3486 from brauner/2020-07-16/license
...
autotools: include COPYING file
2020-07-16 18:09:51 -04:00
Christian Brauner
226cf6e2d0
autotools: include COPYING file
...
Closes : #3484 .
Suggested-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-16 22:49:13 +02:00
Christian Brauner
0ba7e64984
Merge pull request #3480 from Drachenfels-GmbH/master
...
checkconfig: Show LXC version in output.
2020-07-08 12:37:39 +02:00
Ruben Jenster
a65ea78e94
checkconfig: Show LXC version in output.
...
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
2020-07-08 12:06:16 +02:00
Stéphane Graber
fa1a9b4d54
Merge pull request #3479 from brauner/2020-07-06/fixes
...
openpty: improve implementation and handling of platforms without it
2020-07-06 06:51:04 -04:00
Christian Brauner
35eb5cdcb3
openpty: improve implementation and handling of platforms without it
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-06 10:57:47 +02:00
Stéphane Graber
6d3b68510a
Merge pull request #3478 from brauner/2020-07-05/fixes
...
openpty: fix faulty rename
2020-07-05 21:14:22 -04:00
Christian Brauner
0a8409df6d
openpty: fix faulty rename
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 23:45:38 +02:00
Stéphane Graber
184de6b8a1
Merge pull request #3477 from brauner/2020-07-05/fixes
...
tree-wide: update terminal terminology once more
2020-07-05 17:29:32 -04:00
Christian Brauner
41808e20a1
tree-wide: s/pts/pty/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 22:01:57 +02:00
Christian Brauner
36a94ce8e3
tree-wide: s/ptmx/ptx/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 22:01:57 +02:00
Stéphane Graber
3e519859bd
Merge pull request #3476 from brauner/2020-07-05/fixes
...
cgroups: handle empty bpf log buffer
2020-07-05 15:24:23 -04:00
Christian Brauner
fddbd86638
cgroups: handle empty bpf log buffer
...
Link: https://launchpadlibrarian.net/487274879/buildlog_ubuntu-eoan-amd64.lxc_1:4.0.3+master~20200705-1541-0ubuntu1~eoan_BUILDING.txt.gz
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 21:04:27 +02:00
Stéphane Graber
40f02ccd0e
Merge pull request #3475 from brauner/2020-07-05/fixes
...
cgroups: fix bpf device program generation
2020-07-05 11:28:48 -04:00
Christian Brauner
ee9d3ef05b
cgroups: fix bpf device program generation
...
Closes : #3473 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-05 11:17:31 +02:00
Stéphane Graber
1844824494
Merge pull request #3474 from brauner/2020-07-03/fixes
...
api-extensions: add seccomp_allow_deny_syntax extension
2020-07-03 09:42:10 -04:00
Christian Brauner
c312db1110
api-extensions: add seccomp_allow_deny_syntax extension
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 15:14:15 +02:00
Stéphane Graber
22e97b8e06
Merge pull request #3472 from brauner/2020-07-03/fixes
...
fixes
2020-07-03 08:22:30 -04:00
Christian Brauner
beafa9874e
cgroup2_devices: fix access rule parsing
...
Closes : #3473 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 13:44:58 +02:00
Christian Brauner
50329f28c3
cgroups: use empty {} to initialize struct
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 13:40:12 +02:00
Christian Brauner
78522aa936
seccomp: support allowlist/denylist in profiles
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 13:18:36 +02:00
Christian Brauner
9ea99cf7e8
cgroups: update terminology II
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 13:01:40 +02:00
Christian Brauner
29a01c3742
cgroups: update terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-03 12:58:53 +02:00
Stéphane Graber
ffa6884056
Merge pull request #3469 from johanneskastl/20200630_Kastl_fix_gpg_option
...
templates/lxc-download.in: use GPG option "--receive-keys"
2020-07-01 08:44:06 -04:00
Johannes Kastl
409040e702
templates/lxc-download.in: use GPG option --receive-keys instead of --recv-keys
...
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
2020-07-01 07:09:09 +02:00
Stéphane Graber
5408652de4
Merge pull request #3468 from johanneskastl/20200630_Kastl_fix_shell_download_template
...
templates/lxc-download.in: fix wrong if-condition
2020-06-30 16:18:44 -04:00
Johannes Kastl
eb44984ae5
templates/lxc-download.in: make shellcheck happy
...
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
2020-06-30 19:18:21 +02:00
Johannes Kastl
18e18d4c31
templates/lxc-download.in: fix wrong if condition (use the result of the gpg command, not the result when executing the result of the gpg command)
...
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
2020-06-30 18:52:49 +02:00
Christian Brauner
f88d8e68b0
Merge pull request #3466 from alivenets/fix-no-new-privs
...
attach: set no_new_privs flag after LSM label
2020-06-30 10:18:01 +02:00
Alexander Livenets
6ce8e67825
attach: set no_new_privs flag after LSM label
...
In `start.c:1284`, no_new_privs flag is set after LSM label is set.
Also, in `lxc.container.conf` documentation it is written that:
```
Note that PR_SET_NO_NEW_PRIVS is applied after the container has
changed into its intended AppArmor profile or SElinux context.
```
This commit fixes the behavior of `lxc_attach` by moving
`PR_SET_NO_NEW_PRIVS` set logic after LSM for the process is configured;
Closes #3393
Signed-off-by: Alexander Livenets <a.livenets@gmail.com>
2020-06-30 00:54:36 +02:00
Stéphane Graber
7c8b10e515
Merge pull request #3465 from brauner/2020-06-19/clone_into_cgroup
...
clone_into_cgroup: fixes
2020-06-29 09:24:34 -04:00
Christian Brauner
0aff04e066
start: use __aligned_u64
...
Closes: Coverity 1465044.
Closes: Coverity 1465046.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-29 14:52:54 +02:00
Christian Brauner
84b66ced1d
start: initialize cgroup_fd
...
Fixes: Coverity 1465045.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-29 14:51:02 +02:00
Stéphane Graber
d5827bc003
Merge pull request #3464 from brauner/2020-06-19/clone_into_cgroup
...
lxc: support CLONE_INTO_CGROUP
2020-06-29 08:24:00 -04:00
Christian Brauner
f7176c3ea9
lxc: support CLONE_INTO_CGROUP
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-29 13:58:21 +02:00
Stéphane Graber
3a9018bba7
Merge pull request #3463 from brauner/2020-06-26/fixes
...
confile: handle overflow in lxc.time.offset.{boot,monotonic}
2020-06-26 09:33:03 -04:00
Stéphane Graber
11e5f16ae0
Merge pull request #3462 from tenforward/japanese
...
Update Japanese lxc.container.conf(5)
2020-06-26 08:45:55 -04:00
Christian Brauner
f1c4343929
start: preserve time namespace
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-26 10:40:52 +02:00
Christian Brauner
07f89c1e0e
confile: handle overflow in lxc.time.offset.{boot,monotonic}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-26 10:08:32 +02:00
KATOH Yasufumi
bb144af237
doc: Add lxc.time.offset.* to Japanese lxc.container.conf(5)
...
and fix a type in English man page.
Update for commit 7fb5a8dfd2
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2020-06-26 14:24:28 +09:00
KATOH Yasufumi
6fcaba0559
doc: Add veth vlan bridge options to Japanese lxc.container.conf(5)
...
Update for commit a789ca4c24
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2020-06-26 14:10:03 +09:00
Stéphane Graber
b2ff0ccc7c
Merge pull request #3461 from brauner/2020-06-25/time_namespace
...
time namespace support
2020-06-25 20:15:50 -04:00
Christian Brauner
7fb5a8dfd2
doc: add lxc.time.offset.{boot,monotonic}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-26 01:03:24 +02:00
Christian Brauner
b1248e473b
api: add time_namespace extension
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-26 01:03:24 +02:00
Christian Brauner
70fd7fc9ba
lxc: add time namespace support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-26 01:03:24 +02:00
Stéphane Graber
f0a3c722e6
Merge pull request #3460 from brauner/2020-06-25/fixes
...
commands: don't flood logs
2020-06-25 12:14:41 -04:00
Christian Brauner
769b88ea06
commands: don't flood logs
...
We're ignoring commands that we don't know about. They used to be fatal. Not
anymore.
Closes : #3459 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-25 16:32:33 +02:00
Christian Brauner
44f0f0ab6e
Merge pull request #3458 from stgraber/master
...
lxc-net: Set broadcast
2020-06-24 18:43:22 +02:00
Stéphane Graber
dfc6654e3c
lxc-net: Set broadcast
...
Closes #3457
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-06-23 19:24:54 -04:00
Christian Brauner
baf6d38bd9
Merge pull request #3456 from brauner/2020-06-23/lxc_stop_fixes
...
lxccontainer: fix non-blocking container stop
2020-06-23 11:45:23 +02:00
Robert Vogelgesang
60cd509114
lxccontainer: fix non-blocking container stop
...
Stopping a lxc container with without waiting on it was broken in master. This
patch fixes it.
Signed-off-by: Robert Vogelgesang <vogel@folz.de>
2020-06-23 11:08:09 +02:00
Stéphane Graber
91dd15a426
Merge pull request #3454 from brauner/master
...
tree-wide: variable naming update
2020-06-19 19:08:19 -04:00
Christian Brauner
992a0a6799
test: update terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-20 00:03:29 +02:00
Christian Brauner
f1d358b08a
doc: update terminology
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-20 00:03:29 +02:00
Christian Brauner
41e1294552
CODING_STYLE: adapt code example
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-20 00:03:29 +02:00
Christian Brauner
a143f4a563
openpty: adapt variable naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-20 00:03:29 +02:00
Christian Brauner
8ed01f3c00
Merge pull request #3453 from stgraber/master
...
network: Rename primary to master
2020-06-18 17:56:52 +02:00
Stéphane Graber
0dc9a1425e
network: Rename primary to master
...
The previous change made things confusing by impliying there may be a
secondary when VLAN/IPVLAN/bridge members can only have a single parent
device.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-06-18 10:28:57 -04:00
Stéphane Graber
3d88831c53
Revert "nl: fix memory leak"
...
This reverts commit 9d05339487
.
This causes a double-free as the variable is already using __do_free.
Closes #3452
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-06-18 10:22:44 -04:00
Christian Brauner
2410ff119c
tree-wide: use "primary" in networking code
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-18 10:06:55 +02:00
Christian Brauner
9e61fb1f70
tree-wide: wipe references to questionable apis from our public logs
...
We can't do anything about the established kernel API but we can at least not
propagate the terminology.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-18 10:05:10 +02:00
Christian Brauner
cecf3e8368
tree-wide: use "ptmx" and "pts" as terminal terms
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-17 23:58:59 +02:00
Christian Brauner
ce755129a9
Merge pull request #3449 from gaurav1086/nl_fix_mem_leak
...
nl: fix memory leak
2020-06-17 23:15:25 +02:00
Christian Brauner
92eeb4ea6b
Merge pull request #3450 from gaurav1086/containertests_fix_null_ptr_deref
...
containertests: fix null pointer defereference
2020-06-14 09:28:39 +02:00
Gaurav Singh
3815ebccdb
containertests: fix null pointer defereference
...
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-06-13 19:15:50 -04:00
Gaurav Singh
9d05339487
nl: fix memory leak
...
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-06-13 14:06:04 -04:00
Stéphane Graber
ebe4f04eb6
Merge pull request #3446 from brauner/2020-06-10/fixes_2
...
conf: kill old chown_mapped_root()
2020-06-11 13:54:05 -04:00
Christian Brauner
472a2ff953
lxccontainer: remove pointless string duplication
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-11 18:24:21 +02:00
Christian Brauner
6e1a327aba
conf: kill old chown_mapped_root()
...
It's now a wrapper around userns_exec_mapped_root() which allows us to avoid
fork() + exec() lxc-usernsexec makes things way nicer to test with ASAN etc.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-11 18:24:21 +02:00
Christian Brauner
2e8013f9f1
conf: add some more logging to userns_exec_mapped_root()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-11 18:24:21 +02:00
Christian Brauner
8053a085e0
conf: always use target_fd in userns_exec_mapped_root()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-11 18:19:31 +02:00
Christian Brauner
a72c68f789
conf: remove faulty flags
...
If we set O_RDWR we won't be able to open directories and if we set O_PATH we
won't be able to chown.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-11 17:34:40 +02:00
Stéphane Graber
c2fe5ecb28
Merge pull request #3444 from brauner/2020-06-10/fixes
...
cgroups: initialize lxc.pivot cpuset
2020-06-10 13:10:46 -04:00
Christian Brauner
77ffeed2b3
cgroups: initialize lxc.pivot cpuset
...
Closes : #3443 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-06-10 17:42:06 +02:00
Christian Brauner
140ea2e5f5
Merge pull request #3442 from tomponline/tp-veth-vlan-coverity
...
Coverity fixes for veth vlan
2020-06-09 15:43:18 +02:00
Thomas Parrott
3fe6b5cf29
network: Adds calls to free_ovs_veth_vlan_args in setup_veth_ovs_bridge_vlan
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 14:05:16 +01:00
Thomas Parrott
72e8122b44
network: Fix int type in log message
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 14:05:16 +01:00
Thomas Parrott
d2f8b2720b
network: Adds free_ovs_veth_vlan_args and allows trunks field to be freed
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 14:05:16 +01:00
Thomas Parrott
bfc01164eb
network: Removes unused ip_proxy_args
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 13:01:36 +01:00
Thomas Parrott
1ee07848e7
network: Fix coverity issue, dont initialise string pointers in setup_veth_ovs_bridge_vlan
...
This is needed by lxc_ovs_setup_bridge_vlan_exec.
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 12:03:40 +01:00
Thomas Parrott
785e15403e
network: Fix coverity issue, leaking data in lxc_ovs_setup_bridge_vlan_exec
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 12:03:06 +01:00
Thomas Parrott
4e61b19d62
confile: Fix coverity issue, missing return in get_config_net_veth_vlan_tagged_id
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 12:01:41 +01:00
Christian Brauner
677c9967b1
Merge pull request #3439 from tomponline/tp-nic-veth-vlan-ovs
...
NIC: Veth OVS bridge VLAN support
2020-06-09 11:38:36 +02:00
Thomas Parrott
38790036a8
network: Updates instantiate_veth to support OVS VLAN setup
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 10:07:56 +01:00
Thomas Parrott
8f7c3358ac
network: Adds OVS VLAN setup functions
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 10:07:56 +01:00
Thomas Parrott
df62850d2a
network: Updates netlink_open handling in lxc_ipvlan_create
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:58:32 +01:00
Thomas Parrott
a789ca4c24
doc: Adds documentation for veth vlan bridge options
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:58:32 +01:00
Thomas Parrott
33320936d5
network: Updates instantiate_veth to set bridge vlan settings
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:58:32 +01:00
Thomas Parrott
622f05c738
network: Adds bridge vlan management functions
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
5ca374db08
tests: Adds test for lxc.net.0.veth.vlan.tagged.id config key
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
9262d64681
tests: Adds test for bridge vlan "none" value
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
8abd96020a
tests: Adds test for lxc.net.0.veth.vlan.id config key
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
3a0049f3d2
confile/utils: Adds freeing of priv.veth_attr.vlan_tagged_ids
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
1f92ddc1a0
confile/utils: Adds veth vlan tagged ID tracing to lxc_log_configured_netdevs
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
134ded24d0
confile/utils: Adds veth mode and vlan ID tracing to lxc_log_configured_netdevs
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
b8e06d332b
confile: Adds validation for lxc.net.veth.vlan.tagged.id
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:06 +01:00
Thomas Parrott
fdf76c6df5
confile: Adds validation for lxc.net.veth.vlan.id
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-09 09:40:05 +01:00
Thomas Parrott
c96a27f739
network: Adds veth vlan_id, vlan_id_set and vlan_tagged_ids
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
2abd5206d7
macro: Adds BRIDGE_VLAN_ID_MAX constant
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
53a9ba7ff4
macro: Adds constant for BRIDGE_VLAN_NONE mode
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
59315a0681
macro: Adds bridge VLAN constants
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
d80ff1fac7
api/extensions: Adds network_bridge_vlan API extension
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
26da53c3ac
network: Adds check for bridge link interface existence in instantiate_veth
...
To avoid misleading errors about openvswitch when non-existent bridge link interface specified.
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
372adece8b
macro: Adds UINT_TO_PTR and PTR_TO_USHORT helpers
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Christian Brauner
bdf4616595
Merge pull request #3434 from tomponline/tp-copying
...
.gitignore: Ignores COPYING file created by make
2020-06-03 12:54:32 +02:00
Thomas Parrott
5d34397461
.gitignore: Ignores COPYING file created by make
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-03 11:16:11 +01:00
Christian Brauner
a65e1458d2
Merge pull request #3432 from smoser/fix/lxc-usernsexec-test-do-create-user
...
lxc-test-usernsexec: If user is root, then create and use non-root user.
2020-06-02 15:03:36 +02:00
Scott Moser
4c93c06e9f
lxc-test-usernsexec: If user is root, then create and use non-root user.
...
Previously if the user was root, then the test would just skip
running (and exit 0). The lxc test environment is run as root.
So, instead of never doing anything there, we create a user,
make sure it is in /etc/sub{ug}id and then execute the test as that
user.
If user is already non-root, then just execute the tests as before.
Signed-off-by: Scott Moser <smoser@brickies.net>
2020-06-01 12:33:58 -04:00
Stéphane Graber
a3ab5b5d10
Merge pull request #3428 from smoser/test/add-usernsexec-test
...
Add test of lxc-usernsexec
2020-05-29 16:42:04 -04:00
Scott Moser
9026f5c25e
Add test of lxc-usernsexec
...
The test executes lxc-usernsexec to create some files and chmod them.
Then makes assertions on the uid and gid of those files from outside.
Signed-off-by: Scott Moser <smoser@brickies.net>
2020-05-29 15:52:30 -04:00
Stéphane Graber
d4ff364247
Merge pull request #3424 from brauner/2020-05-25/fixes
...
api_extensions: add "pidfd"
2020-05-25 14:03:32 -04:00
Christian Brauner
71d53a5ca7
api_extensions: add "pidfd"
...
Somehow it's documented but wasn't ever added.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-25 19:49:10 +02:00
Stéphane Graber
445f47ead8
travis: Restrict coverity to gcc on bionic on amd64
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-05-22 13:28:24 -04:00
Stéphane Graber
fbe48de489
Merge pull request #3422 from brauner/2020-05-20/usernsexec_fixes
...
lxc-usernsexec: improvements
2020-05-20 08:54:42 -04:00
Christian Brauner
158d119f90
lxc-usernsexec: don't fail on setgroups()
...
We can fail to setgroups() when "deny" has been set which we need to set when
we are a fully unprivileged user.
Closes: 3420.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-20 12:15:02 +02:00
Christian Brauner
7cf6e24d07
lxc-usernsexec: dumb down from error to warning message
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-20 12:10:54 +02:00
Christian Brauner
2b5d8a439c
Merge pull request #3419 from brauner/2020-05-19/network_phys_fixes
...
network: use __instantiate_ns_common() in instantiate_ns_phys() too
2020-05-19 10:33:55 +02:00
Christian Brauner
9d0406c79d
network: use __instantiate_ns_common() in instantiate_ns_phys() too
...
Fixes: https://lists.linuxcontainers.org/pipermail/lxc-users/2020-May/015245.html
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-19 09:09:40 +02:00
Stéphane Graber
b23d806cb2
Merge pull request #3418 from brauner/2020-05-18/android_fixes
...
bionic: s/lxc_raw_execveat()/execveat()/g
2020-05-18 14:19:10 -04:00
Christian Brauner
b164903bcd
bionic: s/lxc_raw_execveat()/execveat()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-18 20:02:37 +02:00
Stéphane Graber
fe2227c9fa
Merge pull request #3417 from brauner/2020-05-15/fixes
...
network: fix {mac,ip,v}lan device creation
2020-05-18 12:41:21 -04:00
Christian Brauner
9f8cf6e110
network: fix {mac,ip,v}lan device creation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-18 17:11:26 +02:00
Stéphane Graber
7c1970fa70
Merge pull request #3415 from brauner/2020-05-15/fixes
...
network: restore old behavior
2020-05-17 21:35:35 -04:00
Christian Brauner
717f77f2f3
network: restore old behavior
...
I introduced a regression: when users didn't specify a specific name via
lxc.net.<idx>.name then the device would retain the random name it received
when we created it. Before we would use the "eth%d" syntax to get the kernel to
assign a fixed name. Restore that behavior.
Closes : #3407 .
Fixes: 8bf64b77ac
("network: rework network device creation")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 21:17:48 +02:00
Serge Hallyn
c0bdef23eb
Merge pull request #3412 from brauner/2020-05-15/clone3
...
clone3: add infrastructure and switch container creation to it
2020-05-15 14:01:35 -05:00
Christian Brauner
748166a39b
Merge pull request #3414 from Blub/get-cgroup-path-compat
...
improve LXC_CMD_GET_CGROUP compatibility
2020-05-15 19:14:11 +02:00
Wolfgang Bumiller
400d579e69
improve LXC_CMD_GET_CGROUP compatibility
...
When a newer lxc library communicates with an older one
(such as running an lxc 4.0 lxc-freeze on a longer running
container which was started while lxc was still at version
3), the LXC_CMD_GET_LIMITING_CGROUP command is not
available, causing the remote to just close the socket.
Catch this and try the previous command instead.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 16:33:34 +02:00
Christian Brauner
04a49a1452
cgroups: be less alarming when creating cgroups
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 16:08:31 +02:00
Christian Brauner
2f46fe6e7a
process_utils: make lxc use clone3() whenever possible
...
No more weird api quirks between architectures and cool new features.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 16:08:31 +02:00
Christian Brauner
6b641ce4f0
Merge pull request #3413 from Blub/dont-busy-loop-on-freeze
...
Don't busy loop on freeze with cgroupv2
2020-05-15 15:59:50 +02:00
Wolfgang Bumiller
385e58e8a8
cgfsng: use EPOLLPRI when polling cgroup.events
...
EPOLLIN will always be true and therefore end up
busy-looping
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:07:36 +02:00
Wolfgang Bumiller
443be56560
cgfsng: deduplicate freeze code
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:07:07 +02:00
Wolfgang Bumiller
9d1c51d19e
mainloop: add lxc_mainloop_add_handler_events
...
in order to be able to listen for EPOLLPRI
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:06:39 +02:00
Christian Brauner
96086a6b7b
process_utils: add clone3() support
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 13:42:56 +02:00
Christian Brauner
f40988c773
process_utils: introduce new process_utils.{c,h}
...
This will be the central place for all process management helpers. This also
removes raw_syscalls.{c,h}.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 12:32:28 +02:00
Christian Brauner
923d3a2dba
syscall_numbers: add clone3()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 11:48:25 +02:00
Christian Brauner
78ae61d86c
syscall_numbers: handle ia64 syscall numbers correctly
...
They are offset by 1024.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 11:44:46 +02:00
Stéphane Graber
94f544e445
Merge pull request #3411 from brauner/master
...
console: only create detached mount when a console is requested
2020-05-14 15:19:45 -04:00
Christian Brauner
efbfe93ff4
console: only create detached mount when a console is requested
...
otherwise weird things might happen.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-14 18:30:43 +02:00
Stéphane Graber
656335920f
Merge pull request #3410 from brauner/2020-05-13/fixes
...
reboot fixes
2020-05-13 15:23:45 -04:00
Christian Brauner
4e2d6b9a8d
log: cleanup syslog handling
...
Disable and enable syslog around lxc_check_inherited().
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 14:35:54 +02:00
Christian Brauner
85c279bbab
start: cleanup file descriptor inheritance
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 13:21:41 +02:00
Christian Brauner
a42abccecc
start: fix container reboot
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:59:59 +02:00
Christian Brauner
f1426d583c
lxccontainer: use close_prot_errno_disarm() on state_socket_pair
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:39:28 +02:00
Christian Brauner
824c5efae3
start: remove unused lxc_zero_handler()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:32:38 +02:00
Christian Brauner
fb1a080daf
lxccontainer: small cleanup to lxc_check_inherited() calls
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:25:25 +02:00
Stéphane Graber
bee9ba72b8
Merge pull request #3408 from brauner/2020-05-11/fixes
...
network: fix key ordering independence
2020-05-12 10:32:00 -04:00
Christian Brauner
756cadb6ab
confile: fix order independence of network keys
...
We need to make sure we don't overwrite values when they have already been set.
Closes : #3405 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-11 22:16:59 +02:00
Christian Brauner
598b35b421
tools/lxc-ls: shut up lgtm more
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-11 09:16:33 +02:00
Stéphane Graber
57140e5a34
Merge pull request #3403 from brauner/2020-05-07/fixes
...
fixes
2020-05-07 10:11:42 -04:00
Christian Brauner
a201349b34
tools/lxc-ls: shutup lgtm
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-07 15:01:30 +02:00
Christian Brauner
c89e6d5843
yum: remove unused module
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-07 14:56:26 +02:00
Christian Brauner
50e3e83d37
tree-wide: this is all rather TODO than FIXME
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-07 14:54:31 +02:00
Stéphane Graber
424886b115
Merge pull request #3399 from brauner/2020-05-09/compiler_hardening
...
compiler: more hardening
2020-05-05 10:11:27 -04:00
Christian Brauner
674c969298
compiler: support new access attributes
...
which will allow us to catch more oob accesses.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-05 14:04:34 +02:00
Christian Brauner
6acf25e36a
gcc: add -Warray-bounds, -Wrestrict, -Wreturn-local-addr, -Wstringop-overflow
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-05 09:21:33 +02:00
Stéphane Graber
a4327f2aa1
Merge pull request #3398 from brauner/2020-05-04/fixes
...
terminal: remove unneeded if condition
2020-05-04 13:38:43 -04:00
Christian Brauner
af25cae409
terminal: remove unneeded if condition
...
Fixes: Coverity 1461742.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-04 15:50:41 +02:00
Stéphane Graber
466b8e7f20
Merge pull request #3397 from brauner/2020-05-03/fixes
...
conf: introduce userns_exec_mapped_root()
2020-05-04 09:39:34 -04:00
Christian Brauner
cf68ffd9e2
conf: support console setup on containers without rootfs
...
This depends on the new mount api.
Closes #3164 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-04 13:26:43 +02:00
Christian Brauner
234998b4f2
conf: introduce userns_exec_mapped_root()
...
to avoid the overhead of calling to lxc-usernsexec whenever we can.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-04 10:56:05 +02:00
Stéphane Graber
33b8e598f1
Merge pull request #3396 from brauner/2020-05-03/fixes
...
cgroup: fixes
2020-05-03 09:51:44 -04:00
Christian Brauner
4547e73e3e
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>
2020-05-03 14:08:11 +02:00
Christian Brauner
8dd7f9052f
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>
2020-05-03 12:03:29 +02:00
Christian Brauner
0e7a013ee8
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>
2020-05-03 11:59:15 +02:00
Christian Brauner
95d4c1c425
Merge pull request #3392 from tomponline/tp-ipvlan-netlink
...
src/lxc/network: Fixes netlink attribute type 1 has an invalid length message
2020-04-22 12:01:42 +02:00
Thomas Parrott
3a934e2e53
src/lxc/network: Fixes netlink attribute type 1 has an invalid length message
...
Fixes #3386
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-04-22 10:12:06 +01:00
Christian Brauner
1bfaf96fd0
Merge pull request #3391 from stgraber/master
...
apparmor: Allow boot_id
2020-04-21 19:14:10 +02:00
Stéphane Graber
863845075d
apparmor: Allow boot_id
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-04-21 13:09:07 -04:00
Christian Brauner
538337ee9d
configure: fix coverity builds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-16 10:03:45 +02:00
Stéphane Graber
4fa41f3562
Merge pull request #3385 from brauner/2020-04-15/fixes
...
cgroups: fix cgroup limit braino
2020-04-15 17:39:18 -04:00
Christian Brauner
92afbe74c4
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>
2020-04-15 23:15:49 +02:00
Stéphane Graber
2c46eaeda7
Merge pull request #3384 from brauner/master
...
travis: coverity gets confused about the %m printf extension in glibc
2020-04-15 15:41:05 -04:00
Christian Brauner
64a2547c0a
travis: coverity gets confused about the %m printf extension in glibc
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 21:27:53 +02:00
Stéphane Graber
b3e27ad413
Merge pull request #3383 from brauner/2020-04-15/fixes
...
log: set GNU_SOURCE as it might help coverity along
2020-04-15 10:55:20 -04:00
Christian Brauner
b10cb59b30
log: set GNU_SOURCE as it might help coverity along
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 15:55:57 +02:00
Stéphane Graber
2c6e89857a
Merge pull request #3382 from brauner/2020-04-15/fixes
...
conf: correctly cleanup memory in get_minimal_idmap()
2020-04-15 09:24:51 -04:00
Christian Brauner
47649d5bba
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>
2020-04-15 14:54:35 +02:00
Stéphane Graber
55785a2cf2
Merge pull request #3381 from brauner/2020-04-15/fixes
...
fixes
2020-04-15 08:38:10 -04:00
Christian Brauner
0212dc6f33
rexec: free argv array on failure
...
Fixes: Coverity 1461736.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:31 +02:00
Christian Brauner
a9909116bc
attach: move check for valid config earlier
...
Fixes: Coverity 1461735.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:31 +02:00
Christian Brauner
ad9ea93929
log: restore non-local value
...
Fixes: Coverity 1461734.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:31 +02:00
Christian Brauner
40a220433f
network: log warning on network deconfiguration failures
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:31 +02:00
Christian Brauner
7792a5b60f
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>
2020-04-15 14:10:30 +02:00
Christian Brauner
c148bb7d9f
zfs: fix resource leak
...
Fixes: Coverity 1461730.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:30 +02:00
Christian Brauner
f075e955d1
criu: make explicit that we're ignoring rmdir() return value
...
Fixes: Coverity 1461726.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:30 +02:00
Christian Brauner
2c99621932
conf: don't double free in get_minimal_idmap()
...
Fixes: Coverity 1461725.
Fixes: Coverity 1461727.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:30 +02:00
Christian Brauner
7484656d63
cgroups: use correct NULL pointer check
...
Fixes: Coverity 1461722.
Fixes: Coverity 1461737.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 14:10:22 +02:00
Christian Brauner
67e724615c
rexec: avoid double-close
...
Fixes: Coverity 1461721.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 13:42:41 +02:00
Christian Brauner
cd86470685
cgroups: fix cgroup2 devices
...
Fixes: Coverity 1461748.
Fixes: Coverity 1461746.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 13:37:51 +02:00
Christian Brauner
e84e4a989d
uuid: close fd
...
Fixes: Coverity 1461751.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 11:59:57 +02:00
Christian Brauner
83b25c4d37
cgroups: do not pass NULL pointer
...
Fixes: Coverity 1461752.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 11:56:54 +02:00
Christian Brauner
e0624f70fc
Merge pull request #3380 from brauner/2020-04-15/fixes
...
fixes
2020-04-15 11:45:57 +02:00
Christian Brauner
586a3fe820
conf: fix tty cleanup
...
Fixes: Coverity 1461755.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 11:32:48 +02:00
Christian Brauner
ba7536c070
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>
2020-04-15 11:15:56 +02:00
Christian Brauner
3aff3a1490
Merge pull request #3379 from brauner/upstream/master
...
travis: add back coverity
2020-04-15 11:00:48 +02:00
Christian Brauner
9e13595366
travis: add back coverity
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-15 10:50:59 +02:00
Stéphane Graber
ff81e0ac1a
Merge pull request #3378 from brauner/2020-04-13/fixes
...
cgroups: adhere to boolean return
2020-04-13 11:24:24 -04:00
Christian Brauner
ec4d463d0f
cgroups: adhere to boolean return
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-13 14:39:18 +02:00
Christian Brauner
e1141de44e
Merge pull request #3377 from lifeng68/fix_cgroup_exit
...
cgroup: fix wrong use of cgfd_con in cgroup_exit
2020-04-13 08:59:58 +02:00
LiFeng
5305cd4e7a
cgroup: fix wrong use of cgfd_con in cgroup_exit
...
Signed-off-by: LiFeng <lifeng68@huawei.com>
2020-04-13 12:52:30 +08:00
Stéphane Graber
16e62936a6
Merge pull request #3376 from toddnni/lxc-oci-fix
...
Fix lxc-oci template with loop backingstore
2020-04-12 22:59:45 -04:00
Toni Ylenius
bbd84ff1a7
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>
2020-04-12 22:31:30 +03:00
Stéphane Graber
0443ed925d
Merge pull request #3375 from brauner/2020-04-12/fixes
...
cgroups: ignore legacy limits on pure cgroup2 systems
2020-04-12 13:16:02 -04:00
Christian Brauner
e9071702e6
Merge pull request #3374 from stgraber/master
...
tests/no-new-privs: Don't mess with /etc/lxc
2020-04-12 16:51:20 +02:00
Christian Brauner
b96aa96fe2
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>
2020-04-12 10:20:39 +02:00
Stéphane Graber
ecf1f1207b
tests/no-new-privs: Don't mess with /etc/lxc
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-04-11 23:05:04 -04:00
Christian Brauner
3d8949788b
Merge pull request #3370 from stgraber/master
...
lxc-update-config: Fix bad handling of lxc.logfile
2020-04-10 21:09:51 +02:00
Stéphane Graber
71310ccc85
lxc-update-config: Fix bad handling of lxc.logfile
...
Closes #3369
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-04-10 14:43:37 -04:00
Stéphane Graber
b7b0264251
Merge pull request #3368 from brauner/2020-04-09/fixes
...
fixes
2020-04-09 09:20:52 -04:00
Christian Brauner
1758c19505
conf: move_ptr() in all cases in mapped_hostid_add()
...
Closes #3366 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-09 14:30:31 +02:00
Christian Brauner
1c13783ee8
Merge pull request #3367 from tomponline/tp-nic-ipvlan
...
src/lxc/network: ipvlan comment and code style tweak
2020-04-09 14:13:06 +02:00
Christian Brauner
c6ba8981f5
conf: use macros all around in lxc_map_ids()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-09 12:49:16 +02:00
Christian Brauner
46bc6f2a55
conf: tweak get_minimal_idmap()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-09 12:44:25 +02:00
Thomas Parrott
cf88a8279b
src/lxc/network: ipvlan comment and code style tweak
...
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-04-09 11:35:48 +01:00
Christian Brauner
43e35480c5
Merge pull request #3365 from albatross0/ipvlan_l2
...
network: Make it possible to set the mode of IPVLAN to L2
2020-04-09 12:25:33 +02:00
KUWAZAWA Takuya
5755765e77
network: Make it possible to set the mode of IPVLAN to L2
...
Signed-off-by: KUWAZAWA Takuya <albatross0@gmail.com>
2020-04-09 15:40:15 +09:00
Stéphane Graber
8b5f911176
Merge pull request #3362 from brauner/2020-04-07/fixes
...
lxc_user_nic: fixes
2020-04-08 08:56:41 -04:00
Christian Brauner
060c4d4504
seccomp: newer kernels require the buffer to be zeroed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-08 14:42:05 +02:00
Christian Brauner
257f04ec37
cgroups: whitespace fixes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-08 10:01:01 +02:00
Christian Brauner
83ddca524f
lxc_user_nic: continue when we failed to find a group
...
Closes #3361 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-08 09:18:45 +02:00
Christian Brauner
6cffe2b29d
lxc_user_nic: simplify group retrieval
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-08 09:18:45 +02:00
Stéphane Graber
7672d4083f
Merge pull request #3360 from brauner/2020-04-07/fixes
...
start: ensure all file descriptors are closed during exec
2020-04-07 08:56:26 -04:00
Christian Brauner
1b21a48cde
syscall_numbers: handle riscv
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-07 12:59:59 +02:00
Christian Brauner
d31031628f
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>
2020-04-07 10:36:23 +02:00
Christian Brauner
51c8368a37
Merge pull request #3359 from Blub/legacy-devices-isolation-change
...
cgroup isolation: handle devices cgroup early
2020-04-07 10:35:39 +02:00
Wolfgang Bumiller
432faf202e
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>
2020-04-07 10:00:52 +02:00
Christian Brauner
d8ccf90603
Merge pull request #3357 from Blub/cgroup-isolation-fixes
...
Cgroup isolation fixes
2020-04-05 17:08:49 +02:00
Wolfgang Bumiller
29d652a9b9
get the right path in get_cgroup command
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-05 16:19:29 +02:00
Wolfgang Bumiller
20e9ea0425
confile: fix jump table order
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-05 15:56:41 +02:00
Christian Brauner
ea4aeddcbe
Merge pull request #3356 from tenforward/japanese
...
doc: Add lxc.cgroup.dir.{monitor,container,container.inner} to Japanese man
2020-04-05 14:46:22 +02:00
KATOH Yasufumi
27f451e283
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>
2020-04-05 21:18:59 +09:00
Stéphane Graber
8b10fddec4
Merge pull request #3355 from brauner/2020-04-04/fixes
...
api-extensions: add and document cgroup_advanced_isolation
2020-04-04 10:38:01 -04:00
Christian Brauner
e9619d75b1
api-extensions: add and document cgroup_advanced_isolation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-04 12:09:21 +02:00
Christian Brauner
a6e5687378
Merge pull request #3353 from Blub/lxc.cgroup.dir-components
...
introduce lxc.cgroup.dir.{monitor,container,container.inner}
2020-04-03 20:26:02 +02:00
Christian Brauner
e93197e7ec
confile: coding style fixes for set_config_cgroup_container_inner_dir()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-03 20:10:58 +02:00
Christian Brauner
51b07b7036
doc: s/lxc.cgroup.container.namespace/lxc.cgroup.container.inner/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-03 20:08:41 +02:00
Christian Brauner
31691d1bd4
cgroups: remove unused variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-03 20:07:41 +02:00
Wolfgang Bumiller
a900cbaf25
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>
2020-04-03 17:22:04 +02:00
Christian Brauner
514b0270ce
Merge pull request #3352 from Blub/readd-cgroup-ops-check
...
Revert "start: remove unnecessary check for valid cgroup_ops"
2020-04-03 10:28:37 +02:00
Wolfgang Bumiller
e2aed383de
Revert "start: remove unnecessary check for valid cgroup_ops"
...
This reverts commit 52520e4f79
.
This can be NULL when there's a pre-start hook which fails.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-03 10:22:27 +02:00
Stéphane Graber
2235ad66df
Merge pull request #3350 from brauner/2020-04-02/fixes
...
lxccontainer: poll takes millisecond not seconds
2020-04-02 12:21:34 -04:00
Christian Brauner
908c75d24f
lxccontainer: poll takes millisecond not seconds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-02 18:19:31 +02:00
Christian Brauner
2862e55ea3
Merge pull request #3349 from cyphar/cgfsng-uninitialised-2
...
cgroups: fix build warning on GCC 7
2020-04-02 17:37:17 +02:00
Aleksa Sarai
fdb0b8ab2d
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]: 346830421a
("cgroups: fix "uninitialized transient_len" warning")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2020-04-03 02:13:11 +11:00
Stéphane Graber
9f6302e388
Merge pull request #3348 from brauner/2020-04-02/fixes
...
fixes
2020-04-02 10:35:43 -04:00
Christian Brauner
2ed0ea489a
utils: use setres{u,g}id() in lxc_switch_uid_gid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-02 11:51:13 +02:00
Christian Brauner
c353b0b950
utils: rework fix_stdio_permissions()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-02 11:50:27 +02:00
Christian Brauner
85ec52bd9f
Merge pull request #3344 from gaohuatao-1/master
...
fix non-root user cannot write /dev/stdout
2020-04-02 11:38:48 +02:00
Christian Brauner
370a2284be
Merge pull request #3347 from cyphar/cgfsng-uninitialised
...
cgroups: fix "uninitialized transient_len" warning
2020-04-02 10:46:45 +02:00
Aleksa Sarai
346830421a
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>
2020-04-02 19:18:41 +11:00
Christian Brauner
5f2ed0c09f
Merge pull request #3346 from stgraber/master
...
systemd: Add Documentation key
2020-04-01 23:03:09 +02:00
Stéphane Graber
955ec68d76
Merge pull request #3345 from brauner/2020-03-30/fixes
...
fixes
2020-04-01 16:57:25 -04:00
Stéphane Graber
9409ea35a0
systemd: Add Documentation key
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-04-01 16:57:15 -04:00
Christian Brauner
f553c21746
autotools: don't install run-coccinelle.sh
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-04-01 22:25:53 +02:00
Christian Brauner
632dd634f9
Merge pull request #3343 from Blub/apparmor-mount-rule-generation
...
apparmor: generate ro,bind,remount rule list
2020-04-01 21:16:34 +02:00
Wolfgang Bumiller
8fddf007b9
apparmor: generate ro,bind,remount rule list
...
and update to changes based on lxd
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-01 19:21:52 +02:00
gaohuatao
6aff515722
fix non-root user cannot write /dev/stdout
...
Signed-off-by: gaohuatao <gaohuatao@huawei.com>
2020-04-01 09:36:44 -04:00
Christian Brauner
f66fdf2338
Merge pull request #3341 from Blub/upstream-exec-reload
...
init: add ExecReload to lxc.service to only reload profiles
2020-03-31 20:23:38 +02:00
Christian Brauner
f7d85e98c2
Merge pull request #3342 from Blub/upstream-monitord-service
...
allow running lxc-monitord as a system daemon
2020-03-31 20:22:48 +02:00
Wolfgang Bumiller
b62782546c
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>
2020-03-31 15:34:56 +02:00
Wolfgang Bumiller
253f36f9bc
init: add ExecReload to lxc.service to only reload profiles
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 15:31:23 +02:00
Christian Brauner
52520e4f79
start: remove unnecessary check for valid cgroup_ops
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-31 13:52:59 +02:00
Stéphane Graber
c51c757042
Merge pull request #3340 from brauner/2020-03-30/fixes
...
cgroups: handle older kernels (e.g. v4.9)
2020-03-30 14:12:59 -04:00
Christian Brauner
7d84916388
cgroups: send two fds to attach to unified cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-30 19:16:52 +02:00
Christian Brauner
49df620bc2
cgroups: send two attach fds
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-30 18:42:59 +02:00
Christian Brauner
b1ee458e9b
start: log error when failing to create cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-30 18:17:53 +02:00
Christian Brauner
d1783ef4d0
cgroups: handle older kernels (e.g. v4.9)
...
On olders kernels the restrictions to move processes between cgroups are
different than they are on newer kernels. Specifically, we're running into the
following check:
if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) &&
!uid_eq(cred->euid, tcred->uid) &&
!uid_eq(cred->euid, tcred->suid))
ret = -EACCES;
which dictates that in order to move a process into a cgroup one either needs
to be global root (no restrictions apply) or the effective uid of the process
trying to move the process and the {saved}uid of the process that is supposed
to be moved need to be identical. The new attaching logic we did didn't
fulfill this criterion for because it's not present on new kernels.
Closes https://github.com/lxc/lxd/issues/7104 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-30 18:17:41 +02:00
Christian Brauner
4446e0fa7c
Merge pull request #3339 from Blub/cmd-get-cgroup-string-termination
...
verify cgroup controller name
2020-03-30 16:40:36 +02:00
Wolfgang Bumiller
e6bc68d691
verify cgroup controller name
...
validate that a cgroup controller name is a valid
zero-terminated string before passing it to
`cgroup_ops->get_cgroup()`.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-30 16:03:17 +02:00
Stéphane Graber
6821739c3c
Merge pull request #3338 from brauner/2020-03-28/fixes
...
tree-wide: fixes
2020-03-28 10:54:25 -04:00
Christian Brauner
8408a9cc8d
tree-wide: s/recursive_destroy/lxc_rm_rf/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:55 +01:00
Christian Brauner
de6fe1328c
cgroups: better helper naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:55 +01:00
Christian Brauner
c468e4d429
cgroups: move check for valid monitor process up
...
Cc: cenxianlong <cenxianlong@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 15:06:44 +01:00
Christian Brauner
24e84b34e0
Merge pull request #3337 from bale-cen/master
...
monitor process exited by signal SIGKILL, clean cgroup resource by th…
2020-03-28 10:56:49 +01:00
Stéphane Graber
c396f8e654
Merge pull request #3336 from brauner/2020-03-28/fixes
...
cgroups: please compilers
2020-03-27 21:48:18 -04:00
cenxianlong
8fcb908d9f
monitor process exited by signal SIGKILL, clean cgroup resource by third party
...
Writing the value 0 to a cgroup.procs file causes the
writing process to be moved to the corresponding cgroup
Signed-off-by: cenxianlong <cenxianlong@huawei.com>
2020-03-28 03:16:27 +02:00
Christian Brauner
5045306b33
cgroups: please compilers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-28 00:27:00 +01:00
Stéphane Graber
3021b574a0
Merge pull request #3335 from brauner/2020-03-27/fixes
...
cgroups: use hidden directory for attaching cgroup
2020-03-27 17:33:59 -04:00
Christian Brauner
275e8ef8aa
cgroups: use hidden directory for attaching cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 22:22:05 +01:00
Stéphane Graber
334c3bfea5
Merge pull request #3333 from brauner/2020-03-27/fixes
...
conf: simplify userns_exec_minimal()
2020-03-27 17:01:17 -04:00
Christian Brauner
dbfcdf8600
conf: simplify userns_exec_minimal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 21:48:46 +01:00
Stéphane Graber
64e4f71582
Merge pull request #3332 from brauner/2020-03-27/fixes
...
attach: fixes
2020-03-27 15:37:00 -04:00
Christian Brauner
edf8828912
conf: introduce and use userns_exec_minimal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 20:11:41 +01:00
Christian Brauner
4b86fefd0f
Revert "cgroups: fix unified cgroup attach"
...
This reverts commit ba7ca43b0b
.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 19:46:10 +01:00
Stéphane Graber
c0c183b345
Merge pull request #3331 from brauner/2020-03-27/fixes
...
tree-wide: fixes
2020-03-27 11:02:27 -04:00
Wolfgang Bumiller
f7a97743a3
fixup i/o handler return values
...
Particularly important for lxc_cmd_handler() handles client
input and should not be capable of canceling the main loop,
some syscall return values leaked through overlapping with
LXC_MAINLOOP_ERROR, causing unauthorized clients connecting
to the command socket to shutdown the main loop.
In turn, signal_handler() receiving unexpected
`signalfd_siginfo` struct sizes seems like a reason to bail
(since it's a kernel interface).
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 15:45:11 +01:00
Christian Brauner
ba7ca43b0b
cgroups: fix unified cgroup attach
...
There's a fundamental problem with futexes and setid calls and the go runtime.
POSIX requires that when one thread setids all threas must setids and it uses
futexes and signals to synchronize the state across threads. This causes
deadlocks which means we can't use the pretty solution I first implemented.
Instead we need to chown after we create the directory. I might come up with
something smarter later but for now this will do.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 15:45:11 +01:00
Stéphane Graber
d4a5002bb7
Merge pull request #3330 from brauner/2020-03-27/fixes
...
conf: rework and fix leak in userns_exec_1()
2020-03-27 08:52:30 -04:00
Christian Brauner
0d113b16f0
cgroups: remove unused variable
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 12:00:22 +01:00
Christian Brauner
8bc2b675f2
attach: use close_prot_errno_disarm()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:52:44 +01:00
Christian Brauner
32908bfd12
cgroups: rework __cg_unified_attach()
...
We didn't account for cgroup_attach() succeeding and just tried to attach to
the same cgroup again which doesn't make sense.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:49 +01:00
Christian Brauner
7c2c435c52
cgroups: move pointer dereference after check
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:49 +01:00
Christian Brauner
a5263e59fd
commands: log actual errno when lxc_cmd_get_cgroup2_fd() fails
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:48 +01:00
Christian Brauner
766c5b6d75
conf: rework and fix leak in userns_exec_1()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-27 11:47:48 +01:00
Stéphane Graber
8c6a7ee44c
Merge pull request #3329 from brauner/2020-03-25/fixes
...
cgroups: fix attaching to the unified cgroup
2020-03-26 15:11:50 -04:00
Christian Brauner
7581a82fde
cgroups: fix attaching to the unified cgroup
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 19:27:07 +01:00
Stéphane Graber
45d6d89ba4
Merge pull request #3328 from brauner/2020-03-25/fixes
...
tree-wide: fixes
2020-03-26 11:22:34 -04:00
Christian Brauner
65146c9729
dir: improve dir backend
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:47:11 +01:00
Christian Brauner
0f2e356612
dir: use cleanup macro in dir_mount()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:32:29 +01:00
Christian Brauner
a08bfbe340
tree-wide: harden mount option parsing
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-26 15:31:57 +01:00
Stéphane Graber
75688909d2
Merge pull request #3327 from P-EB/master
...
lxc.service: Starts after remote-fs.target
2020-03-25 13:31:45 -04:00
Pierre-Elliott Bécue
c82d7763cd
[lxc.service] Starts after remote-fs.target to allow containers relying on remote FS to work
...
Signed-off-by: Pierre-Elliott Bécue <becue@crans.org>
2020-03-25 17:50:27 +01:00
Christian Brauner
591f6f44a7
lxc_init: add missing O_CLOEXEC
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-25 12:53:13 +01:00
Christian Brauner
ed58616410
lxc_init: move main() down
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-03-25 12:47:07 +01:00
Stéphane Graber
c40aa8c893
configure.ac: Reset devel flag post-release
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-03-24 16:36:14 -04:00