2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00
Commit Graph

305 Commits

Author SHA1 Message Date
Andrey Vagin
cbb6b2da3d PROT_WRITE isn't need for a mapping of a file with MAP_SHARED
A file destriptor is opened for read-only and mmap with PROT_WRITE fails.
We don't need PROT_WRITE for this case, because a file contains up to date
data.

lr-x------ 1 root root 64 Dec  1 19:10 20 -> /usr/lib64/gconv/gconv-modules.cache
pos:    0
flags:    0100000
41155 mmap(0x7f2c3d6cf000, 28672, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 20, 0 <unfinished ...>
41155 <... mmap resumed> )              = -1 EACCES (Permission denied)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-02 15:43:48 +04:00
Cyrill Gorcunov
fa28f40aaa restore: Tune up the resident code to restore threads via last-pid concept
v2:
 - Pavel reported there is no need to lock/unlock
   last-pid file in cycle, just lock it once before
   threads creation and unlock at the end.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2011-12-02 13:41:34 +04:00
Cyrill Gorcunov
20b0e29698 syscall: Add sys_gettid helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-02 12:07:47 +04:00
Cyrill Gorcunov
b9febd52bc syscall: Add sys_flock helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-02 12:07:33 +04:00
Cyrill Gorcunov
8d36f08765 restore: Switch to the new ns_last_pid kernel facility while forking children
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2011-12-01 18:53:20 +04:00
Cyrill Gorcunov
762a5a16a7 kernel: Drop no longer needed CLONE_CHILD_USEPID functionality
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-01 18:51:56 +04:00
Cyrill Gorcunov
63fea93076 dump: Switch to /proc/$pid/children parsing to obtain children set
This also depends on kernel's inteface being changed,
so kernel/ is updated as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2011-12-01 18:51:40 +04:00
Andrey Vagin
baf69d6757 Don't overwrite sigaction magic
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
2011-12-01 18:26:35 +04:00
Cyrill Gorcunov
9a544596fe Update README
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-01 11:16:37 +04:00
Cyrill Gorcunov
523cd85198 kernel: Add kernel.ns_last_pid control patch and update prctls
The patch "sysctl: Add the kernel.ns_last_pid control" is not
yet handled by crtools, still it's staged here to not loose
it and collect all Acks in place.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-12-01 00:08:01 +04:00
Cyrill Gorcunov
794b491a3d Fix potential memory leak in parasite_dump_sigacts_seized
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 23:44:15 +04:00
Cyrill Gorcunov
173c749da7 Fix potential memory leak in parasite_dump_pages_seized
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 23:37:37 +04:00
Cyrill Gorcunov
8324db69ee Fix comment on CR_FD_SIGACT
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 23:33:28 +04:00
Cyrill Gorcunov
5e829c8292 parasite: Unify error reporting scheme
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:57:36 +04:00
Cyrill Gorcunov
6661b555b9 dump: Don't forget to close opened file on error path
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:30:53 +04:00
Andrey Vagin
555efbb374 Set MAP_GROWSDOWN flag for stacks
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:29 +04:00
Andrey Vagin
146735f933 Dump direcory descriptor as a file descriptor
If I understand correct, they don't differ in linux.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:24 +04:00
Andrey Vagin
c04cffb7ce Restore pipe flags
pipe_loop00 passed with this patch.

When we restore a regular fd (not pipe) we do use flags
directly in open() call.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:20 +04:00
Andrey Vagin
6949e0f09f Dump memory character devices as a file.
It's work for /dev/zero, /dev/null and other simple devices.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:16 +04:00
Andrey Vagin
7553620298 Dump SigBlk instead of SigCgt
It's because this mask will be restored as rt_sigframe->uc.uc_sigmask.
uc_sigmask will be set as current->blocked in sigreturn, so we should
dump SigBlk in this case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:12 +04:00
Andrey Vagin
25434884e1 Dump and restore sigactions (v2)
A parasite code dumps all sigactions in sigact.pid.

v2: remove hard code for sizeof(sigset_t)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:09 +04:00
Andrey Vagin
287b7d2aa9 Generalization execution of parasite code.
It will be used for dumping sigactions too.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:05 +04:00
Andrey Vagin
bc1f9d728a Skip a standard destriptor only if it's tty (v2)
ZDTM tests redirect standart descriptors to /dev/null

v2: * Skip tty only if it's a standard descriptor.
    * No strcmps on names.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2011-11-30 22:04:00 +04:00
Cyrill Gorcunov
89dde261c2 kernel: Add rewviewed tag
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-30 10:07:10 +04:00
Cyrill Gorcunov
82fe01c35d kernel: Update prctl patch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-30 01:41:43 +04:00
Cyrill Gorcunov
24f33b86ea kernel: Add Ack and Review for a patch
So I wont forget.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-30 01:36:57 +04:00
Cyrill Gorcunov
5e2b5f098b kernel: Update kernel patches series
Tossing patches in git repo is a pure madness,
so stick back with quilt tool.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-30 01:13:38 +04:00
Cyrill Gorcunov
b8638a70ee Update README
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-30 01:11:00 +04:00
Cyrill Gorcunov
4dc0736697 dump,restore: Dump and restore vDSO area from userspace
There is no need to force kernel to remap vDSO area, we
can do that from the user-space as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-29 16:39:48 +04:00
Cyrill Gorcunov
f6ae59cdde test: Add trivial vDSO test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-29 16:37:43 +04:00
Cyrill Gorcunov
3d55b9d125 dump: Drop VMA_DUMP_ALL flag
It has been used at very early stage when
no mincore call was implemented. Not needed
anymore -- so drop it out.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-25 18:39:58 +04:00
Cyrill Gorcunov
42a661f5e4 kernel: Update patch series
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-25 18:35:54 +04:00
Pavel Emelyanov
bb3d02c281 crtools: Take MINCORE_ANON pages into account
Reduce the pages-xxx.img file size significantly (from 2.1M to ~100K for simple counter test)
by not dumping private file pages, that have not yet changed from its file prototype.

If you'll have problems with it, just let me know and comment the definition of PAGE_ANON not
to block your work.

This uses the implemented earlier flag from mincore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-25 18:31:18 +04:00
Pavel Emelyanov
605220e7f7 crtools: Cleanup the 'whether I should dump this page' decision
Just introduce a helper for further patches.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-25 18:30:44 +04:00
Cyrill Gorcunov
9eeb003766 util: Add K/M/G bytes helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-24 15:07:03 +04:00
Pavel Emelyanov
47b7404d73 crtools: Don't save vma's inode info in image
This one isn't used on restore process, since the file mapped is
stored in the fdinfo part of the images.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 14:03:24 +04:00
Pavel Emelyanov
9299d53d32 crtools: Don't show vma fd in --show output
This entry is for restorer only. In image the fd is -1 always.

Signed-off-by; Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 14:03:20 +04:00
Pavel Emelyanov
fb44c9d82b crtools: Don't hold pid on vma image
It's pointless. All vmas are stored in the per-pid image file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 14:03:14 +04:00
Cyrill Gorcunov
64f867f54e dump: Use absolute paths for page dump file
Otherwise the dumpee migh be unable to locate it.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 13:10:37 +04:00
Cyrill Gorcunov
f139959ead restore: Don't use +x permission for .out files
We don't execute them anymore.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 01:22:37 +04:00
Cyrill Gorcunov
7ce2761007 restore: Check for incomplete reading of vma-entry
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 01:18:01 +04:00
Cyrill Gorcunov
2beec2268b restore: Update error messages
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 01:12:38 +04:00
Cyrill Gorcunov
818651b22a restore: Continue restore even if sys_prctl failed
Need this fix until testing kernel get updated.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 00:58:21 +04:00
Cyrill Gorcunov
7b8dee7275 restore: Use pr_perror instead of plain perror
This prints line number as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 00:56:58 +04:00
Cyrill Gorcunov
ad93e59d57 restore: Drop redundant rst_mutex_lock
It leads to circular lockup.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-23 00:51:17 +04:00
Cyrill Gorcunov
122cae2111 dump: Add -k (kill dumped) option
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 22:09:28 +04:00
Cyrill Gorcunov
d3a30d6bb7 kernel: Update PR_ patch
It happened to not flush error code even if
syscall successed. Fixed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 21:13:08 +04:00
Cyrill Gorcunov
5aa22f131b dump: Print error codes if dumper failed in parasite section
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 20:07:20 +04:00
Cyrill Gorcunov
84e57b2a66 restore: Add prctl validation
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 19:25:35 +04:00
Cyrill Gorcunov
2e00d0199d docs: Add internals details
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-22 16:48:57 +04:00