- 10 Dec, 2018 3 commits
-
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 14 Oct, 2018 1 commit
-
-
Christian Brauner authored
Starting with commit 55956b59df33 ("vfs: Allow userns root to call mknod on owned filesystems.") Linux will allow mknod() in user namespaces for userns root if CAP_MKNOD is available. However, these device nodes are useless since static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns) { /* <snip> */ if (s->s_user_ns != &init_user_ns) s->s_iflags |= SB_I_NODEV; /* <snip> */ } will set the SB_I_NODEV flag on the filesystem. When a device node created in non-init userns is open()ed the call chain will hit: bool may_open_dev(const struct path *path) { return !(path->mnt->mnt_flags & MNT_NODEV) && !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV); } which will cause an EPERM because the device node is located on an fs owned by non-init-userns and thus doesn't grant access to device nodes due to SB_I_NODEV. This commit enables LXC to deal with such kernels. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 23 Aug, 2018 36 commits
-
-
Christian Brauner authored
The additional \0-byte space added is not needed since IFNAMSIZ needs to include the \0-byte. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Dereference after null check userns_exec_{1,full} are called from functions that might not have a conf. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
These files have never been used and as such have no dependencies in the codebase whatsoever. So remove them. If we need them we can simply pull them out of the git history. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Tycho Andersen authored
This always works fine... until your exec() fails and you try to go and free it, you've overwritten the allocator's metadata (and potentially other stuff) and it fails. Signed-off-by:Tycho Andersen <tycho@tycho.ws>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
This is already done in do_lxcapi_start{l}() so a) no need to do it again here and b) this would close the state socket pair sockets, corrup the fd, and lead to EBADF. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Tycho Andersen authored
The problem here is that lxc-init runs *inside* the container. So if a person has the log file set to /home/$USER/foo, lxc-init ends up making a directory /home/$USER/foo inside the container to put the log file in. What we really want are the logs to be propagated from inside the container to the outside. We accomplish this by passing an fd without O_CLOEXEC, and telling lxc-init to log to that file. Signed-off-by:Tycho Andersen <tycho@tycho.ws>
-
Christian Brauner authored
Use after free Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
There's no need to do string comparisons. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
If they aren't available fallback to BSD flock()s. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Unchecked return value Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Unchecked return value Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Unchecked return value Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Unused value Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
LiFeng authored
Signed-off-by:LiFeng <lifeng68@huawei.com>
-
LiFeng authored
Signed-off-by:LiFeng <lifeng68@huawei.com>
-
Kaarle Ritvanen authored
Always use 022 as the umask when creating the rootfs directory and executing the template. A too loose umask may cause security issues. A too strict umask may cause programs to fail inside the container. Signed-off-by:Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
-
Christian Brauner authored
We should always default to mounting devpts with gid=5 but we should fallback to mounting without gid=5. This let's us cover use-cases such as container started with only a single mapping e.g.: lxc.idmap = u 1000 1000 1 lxc.idmap = g 1000 1000 1 Closes #2257. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Closes #2248. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
C0deAi authored
Value stored is never read. Closes #2262. Signed-off-by:
C0deAi <techsupport@mycode.ai> Signed-off-by:
Christian Brauner <christian.brauner@ubuntu.com>
-
Tycho Andersen authored
The problem here is that these two clauses were ordered backwards: we first check if the signal came from not the init pid, and if it did, then we give a notice and return. The comment notes that this is intended to protect against SIGCHLD, but we don't in fact know if the signal is a SIGCHLD yet, because that's tested in the next hunk. The symptom is that if I e.g. send SIGTERM from the outside world to the container init, it ignores it and gives this notice. If we re-order these clauses, it forwards non SIGCHLD signals, and ignores SIGCHLD signals from things that aren't the real container process. Signed-off-by:Tycho Andersen <tycho@tycho.ws>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
If they aren't available fallback to BSD flock()s. Closes #2245. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Otherwise lxc.hook.mount hooks that try to inspect /proc/<pid>/* will fail. Cc: Jonathan Calmels <jcalmels@nvidia.com> Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
This function was way more syscall heavy than it needed to be. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
fliiiix authored
Signed-off-by:Felix <de-ch@hotmail.de>
-