2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00
Commit Graph

7617 Commits

Author SHA1 Message Date
Kirill Tkhai
d3ea14a125 scm: Allow to pass flags argument to recv_fds()
This will be used to pass MSG_DONTWAIT in next patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:22 +03:00
Kirill Tkhai
6a3cfcd550 scm: Return sensible error codes in recv_fds()
Replace "-1" return with errno codes.

ENOMSG and EBADFD were choosen to do not cross with
standard recvmsg() errors (described in its man page).

This patch is need as preparation to making recv_msg()
be able to be non-block, and return EAGAIN and EWOULDBLOCK
in case of no data.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:22 +03:00
Andrei Vagin
25d59cb2bf crtools: fix exit code for page-server
cr_page_server() returns pid, if it is executed as a daemon
otherwise it returns an error code.

crtools returns 0 only if cr_page_server() returns a positive value,
what is obviously wrong.

travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:22 +03:00
Andrei Vagin
68bfb80a51 test: check exit codes for criu page-server
travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:17 +03:00
Andrei Vagin
ac5cac188d crtools: close a signal descriptor after passing a preparation stage
This patch adds the --siganl-fd FD option to specify a file descriptor.
CRIU will write '\0' to this descriptor and close it after passing
a preparation stage.

It is alternative way to demonizing a criu process after a preparation
stage. It's imposiable to get exit code, if a process has daemonized.

The introduced way allows to wait a preparation stage and to get an exit
code. It can be easy used from shell and other script languages.

v3: fix a help message

v4: Here is a sequence of actions how it can be used:
     * open a pipe
     * run a service with the pipe[1] as status_fd
     * read(pipe[0]) to wait a moment when the service will be ready to
       accept connections
     * do a work which requires the service
     * wait the service process to gets its exit status to be sure that
       everything okey

travis-ci: success for crtools: close a signal descriptor after passing a preparation stage (rev6)
Cc: Mike Rapoport <mike.rapoport@gmail.com>
Cc: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 16:55:07 +03:00
Dmitry Safonov
7e815625be cr-check: add userns/loginuid checks to extra features
All kernel options, features that depend on kernel version
should be checked with `criu check`.

Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 16:54:26 +03:00
Pavel Begunkov
65214e44ae zdtm: Add checkskip scripts for OFD locks
This is needed in cases when kernel doesn't support OFD locks.
(OFD locks were added in 2014).

travis-ci: success for zdtm: Add checkskip scripts for OFD locks
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:33 +03:00
Andrei Vagin
3dd21b1bdd zdtm: improve socket-tcp-close-wait.c
* Don't send uninitialized data
* Close descriptors more carefully
* Add comments

travis-ci: success for zdtm: improve socket-tcp-close-wait.c
Reported-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:33 +03:00
Andrey Ryabinin
f2181eaed2 tests: add '/bin/ip' to deps in addition to '/sbin/ip'
Some distros put 'ip' util in /bin directory.

travis-ci: success for tests: add '/bin/ip' to deps in addition to '/sbin/ip'
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:33 +03:00
Andrey Ryabinin
ea8483eafd net: fix stack out-of-bounds access in dump_one_netdev()
'info' array is off-by-one, nla_parse_nested() requires destination
array (i.e. 'info') to have maxtype+1 (i.e. IFLA_INFO_MAX+1) elements:

	ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffef823e3f8
	WRITE of size 48 at 0x7ffef823e3f8 thread T0
	    #0 0x7f9ab7a3915b in __asan_memset (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x8d15b)
	    #1 0x7f9ab6d4e553 in nla_parse (/usr/lib64/libnl-3.so.200+0xa553)
	    #2 0x4acfb7 in dump_one_netdev criu/net.c:445
	    #3 0x4adb60 in dump_one_ethernet criu/net.c:594
	    #4 0x4adb60 in dump_one_link criu/net.c:665
	    #5 0x48af69 in nlmsg_receive criu/libnetlink.c:45
	    #6 0x48af69 in do_rtnl_req criu/libnetlink.c:119
	    #7 0x4b0e86 in dump_links criu/net.c:878
	    #8 0x4b0e86 in dump_net_ns criu/net.c:1651
	    #9 0x4a760d in do_dump_namespaces criu/namespaces.c:985
	    #10 0x4a760d in dump_namespaces criu/namespaces.c:1045
	    #11 0x451ef7 in cr_dump_tasks criu/cr-dump.c:1799
	    #12 0x424588 in main criu/crtools.c:736
	    #13 0x7f9ab67b171f in __libc_start_main (/lib64/libc.so.6+0x2071f)
	    #14 0x4253d8 in _start (/criu/criu/criu+0x4253d8)

	Address 0x7ffef823e3f8 is located in stack of thread T0 at offset 264 in frame
	    #0 0x4ac9ef in dump_one_netdev criu/net.c:364

	  This frame has 5 object(s):
	    [32, 168) 'netdev'
	    [224, 264) 'info' <== Memory access at offset 264 overflows this variable
	    [320, 1040) 'req'
	    [1088, 3368) 'path'
	    [3424, 3625) 'stable_secret'

Increase 'info' size to fix this.

Fixes: b705dcc34d ("net: pass the struct nlattrs to dump() functions")
travis-ci: success for net: fix stack out-of-bounds access in dump_one_netdev()
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:32 +03:00
Andrey Ryabinin
ec40484e03 files-reg: fix use-after-free in open_remap_ghost()
Ghost file entry used right after it has been freed:
	ERROR: AddressSanitizer: heap-use-after-free on address 0x60700000dc50
	READ of size 4 at 0x60700000dc50 thread T0
	    #0 0x46e819 in open_remap_ghost criu/files-reg.c:312
	    #1 0x46e819 in prepare_one_remap criu/files-reg.c:461
	    #2 0x46e819 in prepare_remaps criu/files-reg.c:507
	    #3 0x45af00 in root_prepare_shared criu/cr-restore.c:235
	    #4 0x45af00 in restore_task_with_children criu/cr-restore.c:1421
	    #5 0x7efc71e85f0c in clone (/lib64/libc.so.6+0xe7f0c)

	0x60700000dc50 is located 32 bytes inside of 80-byte region [0x60700000dc30,0x60700000dc80)
	freed by thread T0 here:
	    #0 0x7efc7305184a in __interceptor_free (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x9884a)
	    #1 0x46e4df in open_remap_ghost criu/files-reg.c:309
	    #2 0x46e4df in prepare_one_remap criu/files-reg.c:461
	    #3 0x46e4df in prepare_remaps criu/files-reg.c:507

	previously allocated by thread T0 here:
	    #0 0x7efc73051b82 in malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x98b82)
	    #1 0x7efc7277a8ea in protobuf_c_message_unpack (/usr/lib64/libprotobuf-c.so.1+0x48ea)
	    #2 0xd528232002838017  (<unknown module>)

Just move freeing after the last 'gfe' usage to fix this.

Fixes: d0097b2db0 ("files: Support ghost directories restore")
travis-ci: success for files-reg: fix use-after-free in open_remap_ghost()
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:32 +03:00
Pavel Tikhomirov
de7a21443c zdtm: do not run cow0x tests in userns
Opening /proc/<pid>/pagemap in userns is only available since linux
v4.3 or later, after commit 1c90308e7a77 (pagemap: hide physical
addresses from non-privileged users). So those tests fail on older
kernels:
https://ci.openvz.org/job/CRIU/job/CRIU-virtuozzo/job/criu-dev/1402

travis-ci: success for zdtm: do not run cow0x tests in userns
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:32 +03:00
Cyrill Gorcunov
8cbb8a7be1 tty: Print rdev and dev pair in case of error
For more detailed error description.

travis-ci: success for Add multiple devpts support
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:32 +03:00
Cyrill Gorcunov
5bd350f64b tty: Unify id printing
Always use %#x format for ID priting
for better readability.

travis-ci: success for Add multiple devpts support
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:31 +03:00
Cyrill Gorcunov
f823681acc docs: criu -- Explain pre-resume stage
travis-ci: success for Add "pre-resume" stage
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:31 +03:00
Cyrill Gorcunov
1a16b60075 action-scripts: Add "pre-resume" stage
The main idea is to be able to operate with container
at the moment where its processess and resources are
already restored but the processes are not yet in
running state, ie just before we kick them.

Beside the need of tuning up beancounters (which is vz7
specific feature) this might be useful to make some
additional debug tests from the script.

We can't reuse ACT_POST_RESTORE action or move it because
we can kill the restored processes here and resume them
on a source side as avagin@ explained.

[ xemul: In between POST_RESTORE and PRE_RESUME ghost files
  are cleaned up (an a little bit more), so two separate
  stages are required and the latter one cannot fail. ]

travis-ci: success for Add "pre-resume" stage
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:31 +03:00
Andrei Vagin
d02fe846aa zdtm/socket_aio: add a synchonization between processes
The test has to do nothing during c/r.

======================= Run zdtm/static/socket_aio in ns =======================
Start test
./socket_aio --pidfile=socket_aio.pid --outfile=socket_aio.out
Run criu dump
Run criu restore
5: Old maps lost: set(["7f0a5188a000-7f0a5188f000 ['rw-p']"])
5: New maps appeared: set(["7f0a51884000-7f0a5188f000 ['rw-p']", "7f0a51883000-7f0a51884000 ['---p']"])
Send the 9 signal to  97
Wait for zdtm/static/socket_aio(97) to die for 0.100000

Reported-by: Mr Jenkins
travis-ci: success for zdtm/socket_aio: add a synchonization between processes
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:31 +03:00
Andrei Vagin
d14beb1d5c zdtm: don't write out of bounds
CID 174800 (#1 of 1): Out-of-bounds write (OVERRUN)
5. overrun-local: Overrunning array buf of 1024 bytes at byte offset 1024 using index n (which evaluates to 1024).

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:31 +03:00
Andrei Vagin
673f18d05c zdtm: fix typo in socket-tcp-.*
CID 174774 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return 1;.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Andrei Vagin
621c83a520 zdtm: run more tests in userns
They pass in userns, so we can run them by default.

travis-ci: success for zdtm: run more tests in userns
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Andrei Vagin
6f971c1ac7 zdtm: fix a race in socket_udp and socket_udplite
If we have two sockets and send an upd message from one to another,
we can't be sure that it will be delivered immediately,
there is a change to get from recv(..., MSG_DONTWAIT) EGAIN.

This message is handled asynchronously in a kernel space, so
there may be a small timeout before we get it from another socket.

v2: fix socket6_udp too

Reported-by: Mr Travis
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Cyrill Gorcunov
fe68441bf4 zdtm.py: Fix eval error if empty desc file provided
If desc is empty we should not try to eval it,
otherwise it would lead to exceptio. So test
for its size as well.

travis-ci: success for zdtm.py: Fix eval error if empty desc file provided
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Andrei Vagin
d234b567ad zdtm: don't call ps from tests
It is an rudiment of zdtm.sh. Now we don't add ps to a test root
and we want to avoid forks in tests where it isn't supposed to be
called.

travis-ci: success for zdtm: don't call ps from tests
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:29 +03:00
Andrei Vagin
1988bc6e31 soccr: add one more test to check libsoccr_save/libsoccr_restore
The previous test uses only libsoccr_restore. This test
creates a tcp connection, then it dumps and restore it.

travis-ci: success for soccr: add one more test to check libsoccr_save/libsoccr_restore
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:29 +03:00
Pavel Begunkov
b504ec5c77 locks: Check syscalls return values in lock probing
travis-ci: success for series starting with [1/1] locks: Check syscalls return values in lock probing
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:29 +03:00
Vitaly Ostrosablin
52a047ba27 test: fix conntracks test
In some old distros -m state doesn't work correctly and test fails
because test output diverges from expected results. Here we replace
obsoleted -m state with -m conntrack.

travis-ci: success for series starting with [v2,1/2] test: replace cat in Makefiles with awk
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:29 +03:00
Vitaly Ostrosablin
911317ea93 test: replace cat in Makefiles with awk
cat *.pid works when we have only one running process at any moment.
That's because pidfiles contain no newlines and cat will just
concatenate content of all files present in directory. So, e.g., if we
have pidfiles:

31338
31359
31880
31884
31889

cat will build following string from those pidfiles:

3133831359318803188431889

Obviously, kill would fail to send signals to processes, because it's
now a single big number, which cannot be unambigously split back in
general case.

That's where awk comes in. We don't need to modify C part of tests to
print newlines at end of file. We just order awk to print content of
each file, which adds a newline at end - problem solved, kill can once
again parse, which PIDs it get and send proper signals to them. Also,
should be completely safe for zdtm.py, because it doesn't use Makefiles
and sends signals on it's own.

travis-ci: success for series starting with [v2,1/2] test: replace cat in Makefiles with awk
Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:28 +03:00
Pavel Emelyanov
4496bdff4c mount: Add ->collect callback
This helps cleanup cr-time mounts a little bit.

travis-ci: success for mount: Add ->collect callback
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:28 +03:00
Pavel Emelyanov
2be8b15035 mount: Move cgroup checks into callback
travis-ci: success for mount: Sanitize sb comparison code
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:28 +03:00
Pavel Emelyanov
da60bf30a5 mount: Move btrfs checks into callback
Introduce fstype->sb_equal and move btrfs-specific checks
into it.

travis-ci: success for mount: Sanitize sb comparison code
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:28 +03:00
Pavel Emelyanov
02b6716172 mount: Move some checks in mounts_sb_equal
travis-ci: success for mount: Sanitize sb comparison code
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:27 +03:00
Dmitry Safonov
2bc324f5a8 crtools/usage: error on excessive subcommands
Before:
  [~]# criu check lazy_pages
  Looks good.
  [~]# criu check --feature lazy_pages
  Error (criu/kerndat.c:588): Lazy pages are not available
After:
  [~]# criu check lazy_pages
  Error: excessive parameters for command check
  ...skipped usage() output...

Just a little improvement, not to mislead anyone.

Cc: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:27 +03:00
Dmitry Safonov
d6f18fa49b zdtm/fanotify00: fix fanotify_{init, mark} calls
O_* flags should be in event_f_flags parameter, according to
fanotify_init(2).
On x86_32 fanotify_mark() has second mask argument (as mask is 64-bit,
the higher parts of mask shouldn't be used):
> COMPAT_SYSCALL_DEFINE6(fanotify_mark,
> 				int, fanotify_fd, unsigned int, flags,
> 				__u32, mask0, __u32, mask1, int, dfd,
> 				const char  __user *, pathname)
> {
> 	return sys_fanotify_mark(fanotify_fd, flags,
> #ifdef __BIG_ENDIAN
> 				((__u64)mask0 << 32) | mask1,
> #else
> 				((__u64)mask1 << 32) | mask0,
> #endif
> 				 dfd, pathname);

travis-ci: success for 32-bit tests fixes
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 17:37:11 +03:00
Pavel Emelyanov
10e38c6300 zdtm: Fix race in locks08 test
The sub-process should wait for the parent task signal before
checking the locks status

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 17:37:11 +03:00
Begunkov Pavel
36faa04766 zdtm: Add OFD file locks test
There are 3 tests that cover the following cases:

1. single OFD lock
2. overlapped OFD locks
3. inhertited OFD locks

Tests logic is similar to logic of tests for other lock types.

OFD lock specific header-only library was added to avoid code
duplication in the tests.

travis-ci: success for series starting with [1/2] locks: Add ofd locks c/r
Signed-off-by: Begunkov Pavel <asml.silence@gmail.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 17:37:11 +03:00
Begunkov Pavel
34c9119acd locks: Add ofd locks c/r
OFD locks logic reuses existing locks c/r functionality.

https://github.com/xemul/criu/issues/42
travis-ci: success for series starting with [1/2] locks: Add ofd locks c/r
Signed-off-by: Begunkov Pavel <asml.silence@gmail.com>
Signed-off-by: Eugene Batalov <eabatalov89@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 17:37:11 +03:00
Andrei Vagin
cf72cedd5f Revert "zdtm: use a unix socket instead of a pipe to synchronizer processes"
Unfortunately the kernel wakes up only one waiter even
if they waits with MSG_PEEK, so the introduced scheme doesn't work.

Reported-by: Mr Jenkins
travis-ci: success for Revert "zdtm: use a unix socket instead of a pipe to synchronizer processes"
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-25 10:45:21 +03:00
Dmitry Safonov
d9486bd720 arm/pie/build: do not produce relocatable parasite object
With `-r` option relocation to parasite_service
was not made on ARM:
0x76dbc018:	bl	0x76dbc018		0xebfffffe
(You may saw it with objdump also).

This leaded to hang at "Putting tsock" message:
(01.368297) ----------------------------------------
(01.368321)
(01.368339) Collecting fds (pid: 13503)
(01.368360) ----------------------------------------
(01.368535) Found 3 file descriptors
(01.368564) ----------------------------------------
(01.368648) Dump private signals of 13503
(01.368708) Dump shared signals of 13503
(01.368761) Parasite syscall_ip at 0x10000
(01.369605) Set up parasite blob using memfd
(01.369641) Putting parasite blob into 0x76cc5000->0x76e1f000
(01.369755) Dumping GP/FPU registers for 13503
(01.369818) Putting tsock into pid 13503

Link against lib.a which also fixes build for aarm64.

Reported-by: alex vk <avankemp@gmail.com>
Reported-by: long.wanglong <long.wanglong@huawei.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Backported-from-criu-dev-by: Dmitry Safonov <dsafonov@virtuozzo.com>
2017-01-23 16:05:01 +03:00
Pavel Emelyanov
e6156f31dd criu: Version 2.10
So, this time we had TCP transitional states support, but it was
in semi-finished libsoccr library :) And in order to have the TCP
C/R fixed we fixed the library and are now ready to release them
both.

Said that, two main features of the Waxwing release are

* libsoccr -- the library for TCP sockets C/R
* TCP transitional states C/R

Also we have a set of bugfixes, caught performance issue on Xen
and a little bit more.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
v2.10
2017-01-16 12:06:01 +03:00
Pavel Emelyanov
a97be820a4 criu: Disable breakpoint-based restore temporarily
As described in issue #268, breakpoints degrades restore performance
in Xen guests. Untill we find out what's going on we disable them.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:12:41 +03:00
Pavel Emelyanov
b9b34d4276 soccr: Add call to release the soccr handler
It's the same as libsoccr_resume, but doesn't mess with
the socket file descriptor. Just release the handle.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:07:10 +03:00
Andrei Vagin
1fb852bb20 soccr: add a test
This test construct both ends of tcp connections and
check that it works in both directions.

travis-ci: success for soccr: add a test
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:50 +03:00
Pavel Emelyanov
d9132d45cc tcp: Move TCP-repair checking code into cr-check.c
travis-ci: success for series starting with [1/2] tcp: Move window checking code into cr-check.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:50 +03:00
Pavel Emelyanov
044a29af63 tcp: Move window checking code into cr-check.c
travis-ci: success for series starting with [1/2] tcp: Move window checking code into cr-check.c
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:50 +03:00
Andrei Vagin
67d548e9fe tcp: bind tcp sockets after enabling the repair mode
Only sockets in the repair mode can be bound to the same
port a few time, what is required to restore tcp connects.

v2: move bind() into libsoccr
v3: fix an error message
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:50 +03:00
Pavel Emelyanov
8664130b17 soccr: Move src/dst address from _data
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Pavel Emelyanov
ff4e387b09 soccr: Move queue pointers from _data
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Pavel Emelyanov
4b9b56b235 soccr: Introduce flags for memory passing
There will be calls that return objects from inside library
and vice versa -- accept objects from caller. Let's have a
flag controlling who's going to free the mem in question.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Pavel Emelyanov
332b945f79 soccr: Rename API calls to save/restore
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Andrei Vagin <avagin@virtuozzo.com>
2017-01-16 11:04:49 +03:00
Andrei Vagin
ed5081041c soccr: don't dereference data before null check
CID 173075 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking data suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

travis-ci: success for soccr: don't dereference data before null check
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00