Commit Graph

9063 Commits

Author SHA1 Message Date
Stéphane Graber
90ddf3c0d7
Merge pull request #3249 from brauner/2020-01-09/bugfixes
handle kernel version <--> header incompatibility
2020-01-09 10:47:36 -05:00
Christian Brauner
c718fac185
start: handle kernel header and kernel incompatability
We might e.g. be compiled in a container with old kernel headers. In this
scenario CLONE_PIDFD will work but pidfd_send_signal() might not be detected
because __NR_pidfd_send_signal is not defined because the kernel headers don't
match the kernel version.

This explains and fixes test-suite hangs on Jenkins I've recently debugged.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-01-09 12:30:14 +01:00
Christian Brauner
38bbeb799e
tests: timeout after 60 seconds
That should be more than enough to reboot.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-01-09 12:28:54 +01:00
Christian Brauner
1126d14815
mainloop: add missing \n
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-01-09 12:28:19 +01:00
Serge Hallyn
f036cc8a2c
Merge pull request #3241 from brauner/2019-12-25/remove_procfs_pidfd_support
start: remove procfs pidfd support
2020-01-08 09:45:57 -06:00
Stéphane Graber
26eb73ca7e
Merge pull request #3247 from Rachid-Koucha/patch-1
Suppress useless udhcpc directory
2020-01-04 14:11:50 -05:00
Rachid Koucha
eeea2ef1b1
Suppress useless udhcpc directory
The udhcpc directory is created with "mkdir -p" at the place dynamically specified by "busybox udhcpc --help".

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2020-01-03 10:48:41 +01:00
Christian Brauner
2b0d48477a
Merge pull request #3244 from Rachid-Koucha/master
Adaptation to latest busybox
2019-12-27 13:38:07 +01:00
Christian Brauner
d55ea1ec6c
Merge pull request #3243 from Rachid-Koucha/patch-1
Word repetition in comment
2019-12-27 12:08:26 +01:00
Rachid Koucha
e76e315c11
Adaptation to latest busybox
In busybox 1.30, the help of udhcpc for "-s" option changed:
--> busybox v1.27.2: -s,--script PROG	Run PROG at DHCP events (default /usr/share/udhcpc/default.script)
--> busybox v1.30.1: -s PROG		Run PROG at DHCP events (default /etc/udhcpc/default.script)
So, I changed the command line which extracts the script name to make it work for both versions

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-12-27 08:49:00 +01:00
Christian Brauner
b94283e19f
start: remove procfs pidfd support
We'll only rely on proper anon-inode based pidfd support in the future.
There's no good reason to use the procfs fallback. All the fancy features we
might want to use are only available with anon-inode pidfds.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-26 13:01:03 +01:00
Rachid Koucha
f073d46045
Word repetition in comment
create_run_template(): Double "will mount" in a comment

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
2019-12-26 11:51:54 +01:00
Stéphane Graber
33db34ef94
Merge pull request #3238 from brauner/2019-12-23/travis
travis: enable -fsanitize=undefined
2019-12-25 17:12:34 -05:00
Christian Brauner
2d50f34074
Merge pull request #3239 from vikaig/fix-shebang
cmd: fix shebang
2019-12-23 22:42:33 +01:00
vikaig
aac4e12abd cmd: fix shebang
Signed-off-by: vikaig <vikaig99@gmail.com>
2019-12-23 23:31:53 +02:00
Christian Brauner
384db5d761
travis: enable -fsanitize=undefined
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-23 22:12:09 +01:00
Christian Brauner
b4fde4ec4c
Merge pull request #3235 from xinhua9569/master
fd: only add valid fd to mainloop
2019-12-23 11:35:53 +01:00
dongxinhua
4879faffbf fd: only add valid fd to mainloop
Signed-off-by: dongxinhua <dongxinhua@huawei.com>
2019-12-23 16:45:36 +08:00
Christian Brauner
c7ba882842
Merge pull request #3233 from xinhua9569/master
seccomp: support s390 seccomp
2019-12-17 03:03:38 +01:00
Stéphane Graber
cbeb79dd08
Merge pull request #3232 from brauner/2019-12-17/cgroup2_api_extension
api_extensions: advertise cgroup2 support
2019-12-16 20:33:58 -05:00
dongxinhua
3c3fab0004 seccomp: support s390 seccomp
Signed-off-by: dongxinhua <dongxinhua@huawei.com>
2019-12-17 09:11:24 +08:00
Christian Brauner
ad92bbcd81
api_extensions: advertise cgroup2 support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-17 00:52:04 +01:00
Stéphane Graber
56cf2a5705
Merge pull request #3229 from brauner/2019-12-12/cgroup_legacy_layout_regression
cgroups/cgfsng: do not prematurely close file descriptors
2019-12-12 16:52:01 -05:00
Christian Brauner
78eb6aa6fa
cgroups/cgfsng: do not prematurely close file descriptors
When adding the new improved cgroup setup logic I didn't account for the fact
that we need the hierarchy fds up until chown. Add a dedicated cleanup method
to fix this:

lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, , 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, tasks, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )
lxc b1 20191212205052.712 WARN     cgfsng - cgroups/cgfsng.c:fchowmodat:1481 - Bad file descriptor - Failed to fchownat(-9, cgroup.procs, 1000000000, 0, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW )

Closes #3228.
Fixes: 1973b62aab ("cgroups/cgfsng: improve cgroup creation and removal")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-12 22:09:18 +01:00
Stéphane Graber
28a41fc269
Merge pull request #3226 from brauner/cgroup_removal
cgroupfs: improve cgroup removal
2019-12-11 08:59:36 -05:00
Christian Brauner
1973b62aab
cgroups/cgfsng: improve cgroup creation and removal
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-11 11:51:09 +01:00
Stéphane Graber
d09863400e
Merge pull request #3225 from brauner/cgroup_improvements
cgroups/cgfsng: rework legacy cpuset handling
2019-12-10 21:46:06 -05:00
Christian Brauner
8e64b6736f
cgroups/cgfsng: rework cgroup removal
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-10 22:55:44 +01:00
Christian Brauner
c5b8049ef4
cgroups/cgfsng: rework legacy cpuset handling
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-10 19:25:20 +01:00
Christian Brauner
f990d3bfde
cgroupfs/cgfsng: pass cgroup to cg_legacy_handle_cpuset_hierarchy() as const char *
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-10 18:07:47 +01:00
Stéphane Graber
dc3cdf282e
Merge pull request #3223 from brauner/flatten_cgroup_hierarchy
cgroups: flatten hierarchy
2019-12-10 09:51:02 -05:00
Christian Brauner
aaa1ec28b0
cgroups: use explicit unsigned type for bitfield
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-10 14:07:08 +01:00
Christian Brauner
fe70edeee5
cgroups: flatten hierarchy
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-10 14:07:08 +01:00
Stéphane Graber
e340fefe18
Merge pull request #3222 from brauner/security
file_utils: use O_NOCTTY | O_NOFOLLOW
2019-12-09 10:37:53 -05:00
Christian Brauner
ef6d231f8b
file_utils: use O_NOCTTY | O_NOFOLLOW
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-09 11:20:29 +01:00
Stéphane Graber
2962359456
Merge pull request #3218 from brauner/bpf_devices_devpath
cgroups/devices: enable devpath semantics for cgroup2 device controller
2019-12-07 22:31:39 -05:00
Christian Brauner
cb3fc90ced
cgroups/devices: enable devpath semantics for cgroup2 device controller
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 02:23:35 +01:00
Stéphane Graber
7453799ad7
Merge pull request #3217 from brauner/rework_cgroups
cgroups, logging: fixes and improvements
2019-12-07 19:39:55 -05:00
Christian Brauner
c04a6d4e7f
cgroups/cgfsng: replace lxc_write_file()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 01:17:33 +01:00
Christian Brauner
e552bd1a34
cgroups/cgfsng: cgfsng_devices_activate()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:43:40 +01:00
Christian Brauner
1aae36a98f
cgroups/cgfsng: rework cgfsng_nrtasks()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:41:36 +01:00
Christian Brauner
9585ccb3f0
cgroups/cgfsng: rework cgfsng_mount()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:40:29 +01:00
Christian Brauner
c98bbf7106
cgroups/cgfsng: rework cgfsng_chown()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:38:16 +01:00
Christian Brauner
ab9a452ddb
cgroups/cgfsng: rework cgfsng_attach()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:35:19 +01:00
Christian Brauner
7e31931f10
cgroups/cgfsng: rework cgfsng_setup_limits()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:33:24 +01:00
Christian Brauner
92ca7eb54f
cgroups/cgfsng: rework cgfsng_setup_limits_legacy()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:29:45 +01:00
Christian Brauner
a358028a7c
cgroups/cgfsng: rework cgfsng_{get,set}()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:28:48 +01:00
Christian Brauner
6bdf969152
cgroups/cgfsng: rework cgfsng_unfreeze()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:28:48 +01:00
Christian Brauner
aa48a34fac
cgroups/cgfsng: rework cgfsng_get_hierarchies()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:28:48 +01:00
Christian Brauner
e3ffb28bd0
cgroups/cgfsng: rework cgfsng_num_hierarchies()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-12-08 00:17:58 +01:00