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 |
|