Commit Graph

9454 Commits

Author SHA1 Message Date
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