Commit Graph

8502 Commits

Author SHA1 Message Date
Christian Brauner
a71f619c16
conf: cleanup macros parse_mntopts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:43:45 +01:00
Christian Brauner
b8d8876481
conf: cleanup macros lxc_chroot
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:43:27 +01:00
Christian Brauner
8db92302f6
conf: cleanup macros lxc_mount_auto_mounts
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:43:04 +01:00
Christian Brauner
957c470438
conf: cleanup macros pin_rootfs
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:42:45 +01:00
Christian Brauner
e1a94937dc
conf: cleanup macros run_script_argv
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:42:25 +01:00
Christian Brauner
cc6a0e78d7
conf: auto free run_buffer
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:41:48 +01:00
Christian Brauner
7fda348e84
commands_utils: auto free lxc_add_state_client
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:23:58 +01:00
Christian Brauner
b02dc0d9b5
commands_utils: auto close lxc_cmd_sock_get_state
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 23:23:53 +01:00
Christian Brauner
1edf8fa48d
Merge pull request #2866 from brauner/2019-02-19/cve-2019-5736-test
cve-2019-5736: add test
2019-02-19 21:58:04 +01:00
Christian Brauner
99258734dc
cve-2019-5736: add test
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-19 18:24:00 +01:00
Stéphane Graber
2d8bd1db23
Merge pull request #2865 from brauner/2019-02-18/rexec_improve_fallbacks
rexec: try sendfile() fallback to fd_to_fd()
2019-02-18 17:24:08 -05:00
Christian Brauner
5e6e38bd88
rexec: try sendfile() fallback to fd_to_fd()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 23:07:52 +01:00
Stéphane Graber
cd1372e2a1
Merge pull request #2864 from brauner/2019-02-18/rename_pointer_macros
tree-wide: s/steal_{fd,ptr}/move_{fd,ptr}/g
2019-02-18 16:36:14 -05:00
Christian Brauner
240fecd0e1
tree-wide: s/steal_fd/move_fd/g
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 22:20:51 +01:00
Christian Brauner
e4edf5d7bc
tree-wide: s/steal_ptr/move_ptr/g
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 22:20:50 +01:00
Stéphane Graber
005f822b22
Merge pull request #2863 from brauner/2019-02-17/save_rexec
rexec: handle legacy kernels
2019-02-18 15:35:01 -05:00
Christian Brauner
4aa90f6012
[V2] rexec: handle legacy kernels
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 19:51:52 +01:00
Stéphane Graber
7cf89ee88d
Revert "rexec: handle legacy kernels"
Broke Android

This reverts commit 8f350e637c.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2019-02-18 12:15:30 -05:00
Stéphane Graber
4d8a34c31c
Merge pull request #2862 from brauner/2019-02-17/save_rexec
cleanup macros and rexec fixes
2019-02-18 11:56:44 -05:00
Christian Brauner
fed8112d04
rexec: use __do_close_prot_errno
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:14 +01:00
Christian Brauner
8f350e637c
rexec: handle legacy kernels
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:14 +01:00
Christian Brauner
2a30bdea60
commands: cleanup macros lxc_cmd_init()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:14 +01:00
Christian Brauner
c13e711119
commands: cleanup macros lxc_cmd_init
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
4c2effceb4
commands: cleanup macros lxc_cmd_accept()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
cd889e57a4
commands: cleanup macros lxc_cmd_add_state_client
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
c34ff11978
commands: cleanup macros lxc_cmd()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
e96f929188
commands: use __do_close_prot_errno
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
e236fe05d1
memory_utils: introduce __do_close_prot_errno
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
4101805bb2
macro: introduce steal_fd()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
8259d86d97
commands: cleanup macros in lxc_cmd_console()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-18 15:24:13 +01:00
Christian Brauner
2ebc7bde97
commands: move declaration into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:21:09 +01:00
Christian Brauner
e8cc83897a
lxc-usernsexec: use cleanup macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
5c8d235259
lxc-user-nic: use cleanup macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
3cf7d8c2b8
lxc-init: use cleanup macros
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
57e7625005
cgroup_utils: use __do_free
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
cd8f5663ab
attach: use __do_free
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
83c11f1d04
af_unix: use __do_free
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:44 +01:00
Christian Brauner
d85617bc67
start: move variable into tighter scope
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-17 14:13:42 +01:00
Christian Brauner
7a8959d572
Merge pull request #2860 from stgraber/master
mount: Allow over-mounting
2019-02-16 02:18:23 +01:00
Stéphane Graber
71521317b2
mount: Cleanup allow over-mounting
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2019-02-15 20:14:34 -05:00
Christian Brauner
eba282e4d8
Merge pull request #2859 from stgraber/master
mount: Allow over-mounting
2019-02-16 02:07:47 +01:00
Stéphane Graber
c00d0e3b2a
mount: Allow over-mounting
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2019-02-15 20:02:07 -05:00
Stéphane Graber
4d3d037a98
Merge pull request #2857 from brauner/2019-02-15/tweak_log
log: fixes
2019-02-15 18:21:33 -05:00
Christian Brauner
24548539af
network: do not log false friends
The netlink functions just return -1 and not specific negative errno values so
logging them doesn't make any sense.

Fixes: https://discuss.linuxcontainers.org/t/warning-in-the-container-log/4072/2
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-15 23:53:45 +01:00
Christian Brauner
29a7b484ff
conf: do not log devpts umount2() failure
We're not acting based on the return value so don't log anything.

Fixes: https://discuss.linuxcontainers.org/t/warning-in-the-container-log/4072/2
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-15 23:53:32 +01:00
Stéphane Graber
2cd6412251
Merge pull request #2852 from brauner/2019-02-14/revert_simplify_argv_parsing
rexec: cmdline and environ parsing improvements
2019-02-14 10:58:09 -05:00
Christian Brauner
cee55b59cd
rexec: remove envp parsing in favour of environ
My first attempt to simplify this and make it less costly focussed on
the way constructors are called. I was under the impression that the ELF
specification mandated that arg, argv, and actually even envp need to be
passed to functions located in the .init_array section (aka
"constructors"). Actually, the specifications is (cf. [2]):

SHT_INIT_ARRAY
This section contains an array of pointers to initialization functions,
as described in ``Initialization and Termination Functions'' in Chapter
5. Each pointer in the array is taken as a parameterless procedure with
a void return.

which means that this becomes a libc specific decision. Glibc passes
down those args, musl doesn't. So this approach can't work. However, we
can at least remove the environment parsing part based on POSIX since
[1] mandates that there should be an environ variable defined in
unistd.h which provides access to the environment. See also the relevant
Open Group specification [1].

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/
[2]: http://www.sco.com/developers/gabi/latest/ch4.sheader.html#init_array

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-14 16:10:07 +01:00
Christian Brauner
7a80606d7b
Revert "rexec: remove needless /proc/cmdline parsing"
The ELF binary spec does specify in [1]:

SHT_INIT_ARRAY
This section contains an array of pointers to initialization functions,
as described in ``Initialization and Termination Functions'' in Chapter
5. Each pointer in the array is taken as a parameterless procedure with
a void return.

which means libcs other than glibc might not pass down argc and argv to
constructors.

This reverts commit 0c816b3467.

[1]: http://www.sco.com/developers/gabi/latest/ch4.sheader.html#init_array

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-14 14:37:46 +01:00
Stéphane Graber
257e396bed
Merge pull request #2850 from brauner/2019-02-13/simplify_argv_parsing
rexec: remove needless /proc/cmdline parsing
2019-02-13 17:25:05 -05:00
Christian Brauner
0c816b3467
rexec: remove needless /proc/cmdline parsing
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-13 23:09:18 +01:00