2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

5675 Commits

Author SHA1 Message Date
Cyrill Gorcunov
fe946bf4eb crtools: Fix potential nil dereference
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-16 15:40:12 +03:00
Andrew Vagin
355ae31fa3 page-xfer: wait when a connection will be closed from a client side
In this case a time wait bucket will be created on a client side,
where a port is allocated dinamically.

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-16 15:39:27 +03:00
Andrey Vagin
fa66faec4d zdtm/different_creds: return smth from main()
Reported-by: Mr. Travis
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 15:05:58 +03:00
Laurent Dufour
f9d1bb507e test/ppc64: introduce VSX registers test
This test, specific to the ppc64 architecture, is checking that the content
of the VSX registers is correctly checkpointed and restored.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:29 +03:00
Laurent Dufour
196727d7f9 test: remove powerpc architecture fix
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:28 +03:00
Laurent Dufour
7b5c88f35f zdtm: fpu, mmx and sse tests are x86 specific.
The following tests are failing when run on ppc64 and are designed for
x86 architecture.

Moving them to the x86's test list.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:10:27 +03:00
Laurent Dufour
09023677c0 ppc64: Fix checkpoint --leave-running
The commit ba7435095417 which introduces support for Altivec and VSX
support was breaking the checkpoint --leave-running.

The root cause is that the address of the Altivec and VSX registers in the
signal frame should be computed for the stack in the context of the
checkpointed process.

This patch fixes this issue through the sigreturn_prep_fpu_frame which is
designed to update the signal frame based on the remote address.

Fixes: ba7435095417 ("ppc64: Add Altivec and VSX support")
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Tested-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:09:14 +03:00
Andrew Vagin
a99d47e032 zdtm: use pthread_create to create a thread
If you call clone directly you are responsible for setting up the TLS area yourself.

$ abrt-cli ls  | grep different_creds | wc -l
39
$ gdb -c /var/spool/abrt/ccpp-2015-07-24-10\:21\:14-8014/coredump  different_creds
 Core was generated by `./different_creds --pidfile=different_creds.pid --outfile=different_creds.out'.
 Program terminated with signal SIGILL, Illegal instruction.
 #0  0x00007f86e2d8c7d9 in _dl_x86_64_restore_sse () from /lib64/ld-linux-x86-64.so.2
 Missing separate debuginfos, use: dnf debuginfo-install glibc-2.21-7.fc22.x86_64 libattr-2.4.47-9.fc22.x86_64 libcap-2.24-7.fc22.x86_64
 (gdb) bt
 #0  0x00007f86e2d8c7d9 in _dl_x86_64_restore_sse () from /lib64/ld-linux-x86-64.so.2
 #1  0x00007f86e2d84add in _dl_fixup () from /lib64/ld-linux-x86-64.so.2
 #2  0x00007f86e2d8bbc0 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2
 #3  0x0000000000402da3 in sys_futex (val3=0, uaddr2=0x0, timeout=0x0, val=0, op=0, uaddr=0x6063f0 <sig_received>) at lock.h:29
 #4  futex_wait_while (f=0x6063f0 <sig_received>, v=0) at lock.h:121
 #5  test_waitsig () at test.c:367
 #6  0x0000000000401c4b in main (argc=<optimized out>, argv=0x7ffce16432f8) at different_creds.c:82

Reported-by: Mr Jenkins
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>
2015-09-10 14:08:11 +03:00
Laurent Dufour
46f9285e81 ppc64/vdso: fixing debug trace
There was a \n missing.

CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:24 +03:00
Laurent Dufour
7f01d691c7 vdso: Rework vdso processing files
There were multiple copy of the same code spread over the different
architectures handling the vDSO.

This patch is merging the duplicated code in arch/*/vdso-pie.c and
arch/*/include/asm/vdso.h in the common files and let only the architecture
specific part in the arch/*/* files.

The file are now organized this way:

include/asm-generic/vdso.h
	contains basic definition which could be overwritten by
	architectures.

arch/*/include/asm/vdso.h
	contains per architecture definitions.
	It may includes include/asm-generic/vdso.h

pie/util-vdso.c
include/util-vdso.h
	These files contains code and definitions common to both criu and
	the parasite code.
	The file include/util-vdso.h includes arch/*/include/asm/vdso.h.

pie/parsite-vdso.c
include/parasite-vdso.h
	contains code and definition specific to the parasite code handling
	the vDSO.
	The file include/parasite-vdso.h includes include/util-vdso.h.

arch/*/vdso-pie.c
	contains the architecture specific code installing the vDSO
	trampoline.

vdso.c
include/vdso.h
	contains code and definition specific to the criu code handling the
	vDSO.
	The file include/vdso.h includes include/util-vdso.h.

CC: Christopher Covington <cov@codeaurora.org>
CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:22 +03:00
Laurent Dufour
6eaa4e92bf vdso: merge per arch vdso.c file in a common one
Merge arch/*/vdso.c files in vdso.c.

The merge has been done by copying arch/x86/vdso.c in vdso.c since it
contains patch a67e9f7bb930 ("vdso: don't play with a function exit code").

The commit f9ae6d9dd4e4 ("Replace remaining hard-coded TASK_SIZE use")
pushed in the aarch64 has been replicated since it should be cross
platform.

CC: Christopher Covington <cov@codeaurora.org>
CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:20 +03:00
Laurent Dufour
94807751aa ppc64: Fix pie Makefile
When building without the vDSO support on PowerPC (which is not a good
idea), the build is failing because few files are not included in the
build.

This fix moves those files inclusion outside of the vDSO directive.

CC: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:07:19 +03:00
Tycho Andersen
7f44f1dbf9 irmap: hardcode some more interesting paths
In ubuntu wily, these paths are inotify'd by various daemons, so we should
watch them as well.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:05:30 +03:00
Cyrill Gorcunov
1a135c48ef docs: Add --freeze-cgroup and update --ext-unix-sk
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:04:26 +03:00
Andrey Vagin
68923c974b test: a static test should do nothing after test_daemon()
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:03:51 +03:00
Cyrill Gorcunov
644c7659e9 kerndat: tcp_max_rshare -- Shrink default size
In commit 664659a0 we defined max possible
values for TCP queues but on low memory
machines (or on machinese whith custom limits
set via sysctl) this trick doesn't work well
all the time. We have to fetch the allowed values
from /proc/sys/net/ipv4/tcp_[wmem|rmem] which
might be simply missing on the environment
we run.

So lets stick with really small values here
got from kernel source code so instead of failing
we would be able to restore in a bit "slower"
than usual.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:02:55 +03:00
Cyrill Gorcunov
64cf10f88e mount: mnt_depth -- make it unsigned
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:02:04 +03:00
Cyrill Gorcunov
f21dfadfe4 mount: mnt_build_ids_tree -- Rework messages
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 14:00:22 +03:00
Cyrill Gorcunov
795267940c mount: mnt_build_ids_tree -- Rename @p to @parent
The function is too big and @p is too short.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-10 13:59:42 +03:00
Pavel Emelyanov
f1e8a9ce6b criu: Version 1.7
We have quite a lot of new stuff this time. More flexibility
in cgroup management code (and this story far from being over)
in the library and in the crit command line, preparations to
x66 32bit, that also helped the PPC port, freezer cgroup
filannly found its place in the code. We also had our first
CVE-s found :) and a LOT of bugs fixed.

So the plan for the 1.8 is: cgroups, secured containers and
bugfixes. x86 32bit is tempting too.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v1.7
2015-09-07 12:26:32 +03:00
Cyrill Gorcunov
a85b54ab54 zdtm: Fix building for @_BSD_SOURCE redefinition
Travis testing engine complained about @_BSD_SOURCE
which is not the case on my build environment.
Anyway lets do a safe thing -- conditional definition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 22:01:00 +03:00
Cyrill Gorcunov
eb02c8c1fd test: file_locks -- Use device from mountinfo for BTRFS
BTRFS uses own device numbering scheme so lets do a trick
close one to what we have in CRIU itself -- mangle
device to match mountinfo output.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:36:27 +03:00
Cyrill Gorcunov
954ba48d1d zdtm: Add filesystem specific helpers
In particular we have to find out if we're
running on btrfs filesystem for proper device
number mangling.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 19:35:59 +03:00
Andrey Vagin
ec31527be1 jenkins: include criu-lib.sh and call prep()
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:46:25 +03:00
Andrey Vagin
50d4d07367 netlink: increase the receive buffer size
Currently the buffer size is 4096. It always works because
we use hosts where PAGE_SIZE is 4096. PowerPC64 has a bigger PAGE_SIZE.

Here is a comment from the kernel code.
/*
 *      skb should fit one page. This choice is good for headerless malloc.
 *      But we should limit to 8K so that userspace does not have to
 *      use enormous buffer sizes on recvmsg() calls just to avoid
 *      MSG_TRUNC when PAGE_SIZE is very large.
 */

We set the buffer size to 16384, because it's the max length of recvmsg()
for this case. We will need less iterations to collect all data, so
the perfomance should be better.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:26:51 +03:00
Cyrill Gorcunov
675a84fbc9 mount: Rename get_widest_peer to find_widest_shared
It lookups over shared entries and finds widest.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:23:41 +03:00
Cyrill Gorcunov
f7d550323b mount: Fix comment style
We don't use C99 comments.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:20:52 +03:00
Andrey Vagin
2971fb187f jenkins: add a script to execute tests on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:43 +03:00
Andrew Vagin
f20dfbdd95 zdtm: skip linux-vdso64.so when a new root is contructed
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:12 +03:00
Andrew Vagin
edd552619e zdtm: fix compilation on PowerPC
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-04 18:18:11 +03:00
Cyrill Gorcunov
eb6dcc4070 mount: Fix restore deleted bindmounts for regfiles
- make sure it doesn't exist using O_EXCL
 - don't forget to close it

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 18:51:01 +03:00
Pavel Emelyanov
92fcb8691b Fix compilation after previous commit
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:53:31 +03:00
Hui Kang
19dbe25918 Skip root cgroup directories when restoring with manage-cgroup=full
Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:40:59 +03:00
Cyrill Gorcunov
911bb68283 test: mntns_deleted -- Add bindmount for regular files
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:33:58 +03:00
Cyrill Gorcunov
d27f5391d5 mount: Handle deleted bindmounts for regular files
1) Deleted bindmount for files should be restored
   by creating temp file. The kernel doesn't permit
   to mix bindmount in terms of file/dir relationship:
   either both source and target should be files or
   directories.

   Thus we can call stat on the target and figure out
   what kind of source we had.

2) Even for deleted entries better to use permissions
   from the target's stat call, this makes result close
   to how would it look if program hadn't been checkpointed.

Reported-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 15:33:46 +03:00
Andrew Vagin
bee835ebeb zdtm/file_locks01: fix testing devices
Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-02 13:18:28 +03:00
Andrey Vagin
4b0c0c5828 zdtm/file_locks03: don't use pipe for synchronization
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 15:20:36 +03:00
Andrew Vagin
2ce6a6a2af file_locks02: don't use pipe for synchronization
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 13:14:06 +03:00
Laurent Dufour
f2bc172f67 ppc64: fixing build issue
The commit 69d008d56788 ("Use run-time page_size() for mremap")
introduces the use of dynamic page size in rst-malloc.c.

The commit also add the include of unistd.h in
arch/aarch64/include/asm/page.h to allow the build to succeed on this
architecture.  Since ppc64 is also using the same way to deal with page
size, the same include is required in arch/ppc64/include/asm/page.h

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
CC: Christopher Covington <cov@codeaurora.org>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:30:56 +03:00
Andrey Vagin
83f79c7e8c ptrace: print error code for PTRACE_DETACH
*** CID 139494:  Error handling issues  (CHECKED_RETURN)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:26:03 +03:00
Andrey Vagin
35ec944304 file: reserve one byte in a string buffer for the null byte
*** CID 139492:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:25:39 +03:00
Andrey Vagin
f62fd61709 seize: fix used after free case
*** CID 139496:  Memory - illegal accesses  (USE_AFTER_FREE)

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-01 12:25:33 +03:00
Andrew Vagin
8189eda7b9 zdtm/file_locks1: compare devices in addition to inodes
You can see two equal inode numbers with differen devices and
it was a reason why the test failed.

4: C: 12491/12495/12496
4: c: 1: POSIX  ADVISORY  WRITE 0 fc:03:12468 0 EOF
4: c: 2: POSIX  ADVISORY  READ  0 fc:03:12421 0 EOF
4: c: 3: POSIX  ADVISORY  WRITE 0 00:14:16285 0 EOF
4: c: 4: FLOCK  MSNFS     READ  4 fc:03:12496 0 EOF
4: c: 5: FLOCK  ADVISORY  WRITE 4 fc:03:12495 0 EOF
4: c: 6: FLOCK  ADVISORY  READ  4 fc:03:12491 0 EOF
4: c: 7: POSIX  ADVISORY  WRITE 0 00:14:16280 0 EOF
4: c: 8: POSIX  ADVISORY  WRITE 0 00:14:12677 0 EOF
4: c: 9: FLOCK  ADVISORY  WRITE 0 00:14:12520 0 EOF
4: c: 10: FLOCK  ADVISORY  WRITE 0 00:14:12495 0 EOF
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:01:40 +03:00
Andrey Vagin
439de67a4b test/rpc: don't use the shell_job option
It isn't required.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:37 +03:00
Andrey Vagin
5075f278f6 test/rpc: don't call criu_resp__free_unpacked for NULL
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:29 +03:00
Andrey Vagin
bba4000c40 test/rpc: import the errno module
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:20 +03:00
Andrey Vagin
31475ffa6d test/rpc: track changes of the criu binary
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 16:00:13 +03:00
Andrey Vagin
f837310e13 zdtm/fdt_shared: wait until children finish the preparation stage
Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-25 15:59:59 +03:00
Cyrill Gorcunov
e6e56a6294 test: mount -- Add simple testcase for deleted bindmounts
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:25 +03:00
Cyrill Gorcunov
80ef8fd2fb mount: Handle deleted bindmounts
To handle deleted bindmounts we simply create
the former directory bindmount lived at, mount
the target and remove the directory back.

For this sake we add @deleted entry into the image.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-21 21:26:17 +03:00