- 05 Oct, 2015 6 commits
-
-
Tycho Andersen authored
When in a userns, tasks can't write to certain sysctl files: (00.009653) 1: Error (sysctl.c:142): Can't open sysctl kernel/hostname: Permission denied See inline comments for details on affected namespaces. Mostly for my own education in what is required to port something to be userns restorable, I ported the sysctl stuff. A potential concern for this patch is that copying structures with pointers around is kind of gory. I did it ad-hoc here, but it may be worth inventing some mechanisms to make it easier, although I'm not sure what exactly that would look like (potentially re-using some of the protobuf bits; I'll investigate this more if it looks helpful when doing the cgroup user namespaces port?). Another issue is that there is not a great way to return non-fd stuff in memory right now from userns_call; one of the little hacks in this code would be "simplified" if we invented a way to do this. v2: coalesce the individual struct sysctl_req requests into one big sysctl_userns_req that is in a contiguous region of memory so that we can pass it via userns_call. Hopefully nobody finds my little ascii diagram too offensive :) v3: use the fork/setns trick to change the syctl values in the right ns for IPC/UTS nses; see inline comment for details v4: only use sysctl_userns_req when actually doing a userns_call. Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
CRIU should not affect process states when it can't dump them. Cc: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
v2: fix one more place Reported-by:
Pavel Emelyanov <xemul@parallels.com> Cc: Tycho Andersen <tycho.andersen@canonical.com> Acked-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
"ip route dump" dumps only ipv4 routes. Reported-by:
Ross Boucher <boucher@gmail.com> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To build piegen tool with different compiler/linker than gcc/ld -- simply run make as HOSTCC="host-compiler" HOSTLD="host-ld" make where host-compiler/ld is appropriate program needed. https://github.com/xemul/criu/issues/63Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by:
Christopher Covington <cov@codeaurora.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 30 Sep, 2015 3 commits
-
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This entry is only required if we have it, i.e. -- at restore stage in the tree we _built_. All other cases, in particular, local tree collection on restore, do not need such. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@odin.com>
-
Pavel Emelyanov authored
The rfi->path doesn't contain the leading /, neither does the ghost->rpath, so when attaching it to root don't forget to include one there. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@odin.com>
-
- 28 Sep, 2015 18 commits
-
-
Tycho Andersen authored
v2: use struct irmap directly in irmap_path_opt Signed-off-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
External socket can be used for other purpose. Reported-by:
Adrian Reber <adrian@lisas.de> Signed-off-by:
Andrey Vagin <avagin@openvz.org> Acked-by:
Adrian Reber <adrian@lisas.de> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
(00.004456) Error (sk-inet.c:188): Name resolved on unconnected socket (00.004466) Error (cr-dump.c:1255): Dump files (pid: 7944) failed with -1 (00.004680) Error (cr-dump.c:1617): Dumping FAILED. Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
If we try to dump inet socket with unsupported proto we may fail with strange error from get_unconn_sk(), since the socket will not be found in hashes. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Reported-by:
Julian Andres Klode <jak@jak-linux.org>
-
Pavel Emelyanov authored
Issue #18. When restore fails ghost files remain there. And to remove them we have to know their list, paths to original files (to construct the ghost name) and the namespace ghost lives in. For the latter we keep the restore task namespace at hands till the final stage and setns into it to kill ghosts. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Mappings from mount id to namespace will be required to remove ghosts on restore failure. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Info about ghosts presence and paths will be needed to remove the ghosts itself and thus are needed in criu. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This list is used to roll-back the link remap files on dump. I plan to re-use it to roll-back ghost files on restore, so clean the code a little bit towards this change. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
First -- avoid two memory copies by printing ns root directly, and second -- remove extra argument from create_ghost, the mnt_id value we need there can be found on the ghost_file object. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
So here it is. If root task dies on restore the roots yard dir remains unrmdired :( Since we already know its name, we can remove one from criu. By the time we get to this place the sub mount namespace(s) are already dead and yard dir is empty. But umounting should be done by tasks after successfull restore, so keep depopulation there. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Same thing as in previous patch -- we have too many generic clean_ and fini_ prefixes over the code. And we need more (see next patch), so let's specify what exactly we clean or fini. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Just to get rid of clean_something name. We have too many cleaners out there already :\ Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
In case root task restore failure we'll have to remove the roots yard dir from criu, so we have to create one by criu to at least have the dit name. It's OK to do it in criu, since the yards is created in the opts.root which is the same for any mnt ns we deal with on restore. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
There's already two things we do in criu namespaces before forking the init task (start unsd and keep netnsfd for back reference). Next patches will introduce the 3rd action for mount namespaces, so have a special pre-call for all this stuff. 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>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 25 Sep, 2015 2 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 24 Sep, 2015 3 commits
-
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We have many complains about errors restoring cgroup props, so print the exact values we restore _before_ doing this, not only after successful restore :) Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 23 Sep, 2015 4 commits
-
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
*** CID 150397: Memory - illegal accesses (UNINIT) /lib/criu.c: 696 in criu_local_add_irmap_path() 690 691 return 0; 692 693 err: 694 if (my_path) 695 free(my_path); >>> >>> CID 150397: Memory - illegal accesses (UNINIT) >>> >>> Using uninitialized value "m". 696 if (m) 697 free(m); 698 699 return -ENOMEM; 700 } 701 Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
Reported-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Andrew Vagin <avagin@openvz.org> Tested-by:
Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 21 Sep, 2015 4 commits
-
-
Pavel Emelyanov authored
Actually make use of the ns->type field and remove all getpid()'s and other strange/inconsistent checks. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We (may) have 3 types of namespace objects in criu -- criu's one, root task's one and others. All of them sometimes make sense and we differentiate them in a weird way -- by checking the ns->pid field against getpid() or by comparing with root_item's. The proposal is to mark ns_id objects explicitly with type field. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We don't need the read tree earlier. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-