- 23 Sep, 2014 4 commits
-
-
Tycho Andersen authored
We can't remap these files correctly anyway, so we should just return success if we find one of these files to remap. v2: don't try to remap accessible files in /proc Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel authored
We currently have all mouninfo-s from all mnt namespaces collected in one big list. On dump we scan through it to find the namespaces we need to dump. This can be optimized by walking the list of namespaces instead. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Andrey Vagin authored
Fix compilation on ARM: pie/restorer.c: In function ‘wait_helpers’: pie/restorer.c:728:3: error: implicit declaration of function ‘sys_waitpid’ [-Werror=implicit-function-declaration] cc1: all warnings being treated as errors Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrey Vagin <avagin@parallels.com>
-
- 22 Sep, 2014 7 commits
-
-
Andrey Vagin authored
Unfortunately the kernel doesn't flush hw breakpoints on detaching ptrace. If a breakpoint is triggered without ptrace, it will be killed by SIGTRAP. Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Since we now can return port to user in autobind case, it's ok to request page-server without setting ps_info. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
On restore parasite_stop_on_syscall() can be called after PTRACE_SYSCALL and after a breakpoint. parasite_stop_on_syscall() must be called only after PTRACE_SYSCALL, so all tests where is one process stuck. Reported-by: Mr Jenkins Signed-off-by:
Andrew Vagin <avagin@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Here is a race now: ./zdtm.sh --ct -d -C -x static/cgroup02 ns/static/pipe02 &> ns_static_pipe02.log || \ { flock Makefile cat ns_static_pipe02.log; exit 1; } ./zdtm.sh --ct -d -C -x static/cgroup02 ns/static/busyloop00 &> ns_static_busyloop00.log || \ { flock Makefile cat ns_static_busyloop00.log; exit 1; } make[3]: `zdtm_ct' is up to date. mkdir: cannot create directory ‘zdtm.GgIjUS/holder’: File exists Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 19 Sep, 2014 12 commits
-
-
Andrey Vagin authored
Currently CRIU traces syscalls to catch a moment, when sigreturn() is called. Now we trace recv(cmd), close(logfd), close(cmdfd), sigreturn(). We can reduce a number of steps by using hw breakpoints. A breakpoint is set before sigreturn, so we will need to trace only it. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently CRIU traces syscalls to catch a moment, when sigreturn() is called. Now we trace recv(cmd), close(logfd), close(cmdfd), sigreturn(). We can reduce a number of steps by using hw breakpoints. A breakpoint is set before sigreturn, so we will need to trace only it. v2: In the first version a breakpoint is set after sigreturn. In this case we have a problem with signals. If a process has pending signals, it will start to precess them after exiting from sigreturn(), but before returning to userspace. So the breakpoint will not be triggered. And at the end Here are a few numbers how we catch sigreturn. Before this patch criu executes 36 syscalls and gets 12 signals. With this patch criu executes 18 syscalls and gets 5 signals. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
The control socket has enough buffer for one command and the target process will not wait a new command, so we will avoid extra context switches. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Tikhomirov authored
Test maps 17 pages and mlocks them, then changes user id from root to 18943, after c/r checks that MAP_LOCKED bit is set for that vma. Signed-off-by:
Pavel Tikhomirov <ptikhomirov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Tikhomirov authored
Signed-off-by:
Pavel Tikhomirov <ptikhomirov@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
If a file like /proc/20/mountinfo is open, but 20 is a zombie (or doesn't exist any more), we can't read this file at all, so a link remap won't work. Instead, we add a new remap, called the dead process remap, which forks a TASK_HELPER as that dead pid so that the restore task can open the new /proc/20/mountinfo instead. This commit also adds a new stage CR_STATE_RESTORE_SHARED. Since new TASK_HELPERS are added when loading the shared resource images, we need to wait to start forking tasks until after these resources are loaded. v2: fix a mutex bug Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
In order to use TASK_HELPERS to open files from dead processes, they should persist until criu is done restoring the filesystem, which happens in the RESTORE stage. To do this, we need to pass each helper's PIDs to the restorer blob, so that it can wait() on them when the restore stage is done. This commit is in preparation for the remap_dead_pid commits. v2: wait() on helpers after restore stage is over v3: add CR_STATE_RESTORE_FS stage v4: CR_STATE_RESTORE_FS waits for nr_tasks + nr_helpers, not nr_threads v5: ditch CR_STATE_RESTORE_FS in favor of passing helpers to restorer blob Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently here is a bug, because when we see criu's mount namespace, we go to the "out" mark and don't validate mounts. Reported-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The same reasoning as for personality file -- switch to plan open + read + close. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
It turned out, that fdopen (used in fopen_proc) always maps a 4k buffer for reads and this buffer gets unmap-ed later on fclose. Taking into account the amount of proc files we read (~20 per task plus one file per opened file descriptor) this mmap+munmap result in quite a lot of useless CPU time. E.g. for a container of 20 tasks we have 1000 calls taking ~8% of total dump time. So lets first stop doing this for simple cases -- one line proc files. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
So it won't depend on the order in declaration. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Sep, 2014 13 commits
-
-
Pavel Emelyanov authored
They don't change these objects, so can share them with parent (will be created slightly faster :) ). The plan is to make them CLONE_VM, but it's not that easy. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
When clone-ing kids we can set their stack on current, as it will anyway be COW-ed later. One thing to note -- we do need to reserve some space on the stack for glibc's arguments and retcode allocation. 128 bytes should be enough for 16 pointers while clone has 5 arguments. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tycho Andersen authored
Maintain backwards compatibility for old images, but don't set the REMAP_GHOST bit going forward, only use the remap_type field. v2: * preserve remap_id in GHOST_REMAP case * protobuf field is remap_type enum not u32 Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
In cr_dump_tasks() we expect restore_root_task to return < 0 if error ocures. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
If there is no separator in first place we should avoid implicit + 1 which make @name = 1 in worst case. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Matthias Neuer authored
My debian testing produces the following output for uname: $ uname -r 3.14-2-amd64 and so: $ set -- `uname -r | sed 's/\./ /g'` $ echo $1 3 $ echo $2 14-2-amd64 this causes zdtm.sh to fail for me on line 293: [ $1 -eq 3 -a $2 -ge 11 ] && return 0 because "14-2-amd64 -ge 11" is false. Signed-off-by:
Matthias Neuer <matthias.neuer@uni-ulm.de> Reviewed-by:
Christopher Covington <cov@codeaurora.org> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Ruslan Kuprieiev authored
This makes only root to be able to modify images by default. When using criu with suid bit set, group of the images is set to user group, which is not safe, considering current CR_FD_PERM. Signed-off-by:
Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
If @ticks is zero the kernel returns error because on creation the @ticks is already zero, so simply setup @ticks if real value present. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The PTRACE_SYSCALL traps task twice -- first on enter into and then on exit from syscall. If we trace a single task (and we do it on dump two times per task) we may skip half of all getregs calls -- on exit we don't need them. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We have the same check a few lines above. v2: fix the subject Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 16 Sep, 2014 3 commits
-
-
Andrey Vagin authored
$ cat /proc/self/mountinfo ... 1 1 0:2 / / rw - rootfs rootfs rw,size=373396k,nr_inodes=93349 ... You can see that mnt_id and parent_mnt_id are equals here. This patch interpretes this case as a root mount in a tree. 0'th mount is rootfs, which is mounted in init_mount_tree(). We don't see it in cases when system makes chroot, because of static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) ... /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); Cc: beproject criu <beprojectcriu@gmail.com> Cc: Christopher Covington <cov@codeaurora.org> Reported-by:
beproject criu <beprojectcriu@gmail.com> Reviewed-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Pid is 10 chars maximum. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
When we compare sets in cg_set_compare() we presume that controller names are properly sorted but because of use of strcmp(cc->path, path) it's not true. In particular in case if there are two same sets which differ in paths only (00.126812) cg: `- New css ID 2 (00.127051) cg: `- [memory] -> [/vz-1] (00.127079) cg: `- [name=systemd] -> [/vz-1] (00.127108) cg: `- [net_cls] -> [/vz-1] (00.239829) cg: `- New css ID 3 (00.240067) cg: `- [memory] -> [/vz-1] (00.240096) cg: `- [net_cls] -> [/vz-1] (00.240154) cg: `- [name=systemd] -> [/vz-1/system.slice/dbus.service] we currently refuse to dump such configuretion. Thus remove path comparision from the first place. CC: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Acked-by:
Andrew Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 15 Sep, 2014 1 commit
-
-
Andrey Vagin authored
mntinfo contains mounts from all namespaces, so we can validate it only once after collecting mounts. v2: add a fake comment about goto v3: add a real comment about goto Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-