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

48 Commits

Author SHA1 Message Date
Kir Kolyshkin
b11f24fd5d criu check: don't run as non-root
In case criu check is run as non-root, a lot of information is printed
to a user, with the only missing bit is it should run it as root.

Fix it.

I still don't like the fact that some other stuff is printed here,
like the timestamp and the __FILE__:__LINE__, but this should be
fixed separately.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-13 13:58:45 +04:00
Cyrill Gorcunov
ed20cef6a0 headers: Move prctl constants to prctl.h
Move prctl constants into own header. They are
arch independent.

The x86 specific ARCH_SET_GS should be fetched from <asm/prctl.h>
(instead of defining own ones).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-14 22:19:43 +04:00
Pavel Emelyanov
7097b5358a check: Soft-dirty support is upstream since v3.11
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-03 14:21:11 +04:00
Pavel Emelyanov
c2b7800740 check: Add tun support
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-23 19:18:47 +04:00
Pavel Emelyanov
72ec39f10c util: Rename pie's util-net.c into util.c
Will put more things there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-29 12:43:30 +04:00
Andrey Vagin
206187dbd4 check: check PTRACE_{GET,SET}SIGMASK
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-16 17:24:16 +04:00
Pavel Emelyanov
ca6c026a31 check: Netlink diag and peek-siginfo is in 3.10 already
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 18:24:24 +04:00
Pavel Emelyanov
1f5acc0242 check: Check that /proc/PID/timers file is here
It's required to get support for posix cpu timers and
it has appeared in v3.10

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-01 16:23:51 +04:00
Pavel Emelyanov
39ec482c15 cr: Fix permissions on several files
cr-check.c for some reason got x bit O_o

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-15 17:50:57 +04:00
Libo Chen
ab4338576c cr-check: potential fd leak in check_fdinfo_inotify
Without this patch, ifd will leak when inotify_add_watch fail.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:49:44 +04:00
Libo Chen
61d852e75c cr-check: potential fd leak in check_fdinfo_eventpoll
Without this patch, fd will leak when epoll_create fail!

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-05-02 22:49:43 +04:00
Libo Chen
69ca9aff1e cr-check: fix pipe fd leak
fix fdinfo leak.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-29 16:11:32 +04:00
Pavel Emelyanov
379abca968 check: Introduce --ms option
This option skips checking for features, that are known to
be absent in mainstream kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-23 23:38:47 +04:00
Pavel Emelyanov
8201e08081 check: Warn *diag absense always
To know what exactly is missing.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-23 23:25:13 +04:00
Pavel Emelyanov
199dba2361 soft-dirty: Check that kernel reports soft-dirty bits
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-15 13:24:32 +04:00
Cyrill Gorcunov
7c02f65b98 check: Drop \n from pr_perror
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-10 00:55:24 +04:00
Andrey Vagin
5d244ca1bd cr-check: don't forget close a test socket
CID 996206 (#3 of 3): Resource leak (RESOURCE_LEAK)
8. leaked_handle: Handle variable "sk" going out of scope leaks the handle.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-04-05 08:19:05 +04:00
Pavel Emelyanov
fd5bcbe733 check: More verbose messages when sock diag infratructure is missing.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-26 19:36:26 +04:00
Cyrill Gorcunov
e14d39abfa check: Return -1 on error
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-26 19:22:15 +04:00
Andrey Vagin
f5e8e1c7da check: check PTRACE_PEEKSIGINFO and sigqueueinfo with positive si_code (v2)
v2: fix indentations.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-25 23:43:39 +04:00
Cyrill Gorcunov
b8ebb4d260 check: Check for pipe return value in check_unaligned_vmsplice
| cr-check.c: In function ‘check_unaligned_vmsplice’:
| cr-check.c:372:2: error: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-22 15:56:50 +04:00
Andrey Vagin
ef4783a646 check: Check for ability to get tcp timestamp
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-14 20:27:55 +04:00
Pavel Emelyanov
fa35517082 check: Check for SO_BINDTODEVICE is get-able
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-12-04 16:35:58 +03:00
Stanislav Kinsbursky
03791bc2c3 ipc: add check for new IPC sysctls
This patch adds check for "/proc/sys/kernel/sem_next_id" to make sure, that
kernel supports restore of IPC objects.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-30 20:11:18 +04:00
Andrey Vagin
13a7498c2a crtools: add EOL to error messages
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-23 16:43:33 +04:00
Pavel Emelyanov
23bf4faa0d check: Set error log level before checking
Not to spoil screen with false warnings.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-12 17:04:24 +03:00
Pavel Emelyanov
64a4c40083 check: Check for ability to get socket filter
This is required to work with tcpdump.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-11-02 16:07:56 +03:00
Cyrill Gorcunov
d5dfab7745 check: Add check_tty
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-12 20:00:56 +04:00
Cyrill Gorcunov
bf94ff3a26 check: Don't forget to init mountns
Otherwise fstatat fails as

> > $ ./crtools check
> > Error (sk-unix.c: 283): Can't stat socket 12547 (./var/run/sdp): Bad file descriptor

Reported-by: "Muralidhar, Rajeev D" <rajeev.d.muralidhar@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-09-02 01:04:14 +04:00
Andrey Vagin
796d4ceb95 socket: switch netns for collecting sockets
All sockets should be collected in a target net name-space when the -n net
is specified.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-11 13:12:43 +04:00
Pavel Emelyanov
da2d59a2e7 signalfd: Checking code
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-02 12:27:45 +04:00
Pavel Emelyanov
9fc1d6bbeb fdinfo: Make fdinfo.type be an enum
This types specifies a strict set of what is hidden behind
the fd. Thus these numbers should be in the description of
the fdinfo message.

Plus protobuf makes shure nothing else will be there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 10:18:37 +04:00
Pavel Emelyanov
237ef3c809 pipe: Rework pipe data restore to use vmsplice
This serves two things -- kills annoying data offset management
which makes protobuf switch too ugly. And removes the need to
seek the pipe data image, which in turn is the prerequisity for
streaming migration.

Memory usage is still optimal, since we still use splice on dump
path and on restore stage we F_GIFT pipe buffers to the kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-12 06:57:20 +04:00
Pavel Emelyanov
76638fd5c3 check: Add check for inotify is shown proerly in fdinfo
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 10:26:46 +04:00
Pavel Emelyanov
a80e9e2eab check: Add check for epoll is shown proerly in fdinfo
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 09:55:10 +04:00
Pavel Emelyanov
7baadd7f1b check: Fix set_mm_exe_file prctl retcode
Now it is EBADF for bogus descriptor we pass

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 09:46:44 +04:00
Pavel Emelyanov
888bc286df check: Add check for evetfd is shown proerly in fdinfo
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 09:45:32 +04:00
Pavel Emelyanov
4ec76b285f tcp: Add code for "check"-ing TCP repair support
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-03 15:21:37 +04:00
Cyrill Gorcunov
6670d294fb prctl: Update PR_GET_TID_ADDR definition
To reflect the change in kernel v3.4-rc4
update PR_GET_TID_ADDR and rename it to
PR_GET_TID_ADDRESS as it named in kernel.

[xemul: this fixes futex test broken with 3.4 rebase]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-26 00:54:48 +04:00
Cyrill Gorcunov
87d2ff5ee7 check: We need CAP_SYS_RESOURCE granted to perform testing
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 21:32:40 +04:00
Cyrill Gorcunov
9e3befe046 check: Add test for /proc/pid/stat extension
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 16:39:35 +04:00
Cyrill Gorcunov
88ca24bb38 check: Add fcntl stub
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 16:38:54 +04:00
Cyrill Gorcunov
92b26d8804 check: prctl -- Add PR_SET_MM_AUXV test
The ability to set PR_SET_MM_AUXV is implemented
in kernel as a separate PR_SET_MM extension, so
we need to test if the kernel patch is applied
on a running system.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 16:38:36 +04:00
Cyrill Gorcunov
b264c6e2ed check: prctl -- Add PR_SET_MM_AUXV test
Add basic test for prctl PR_SET_MM opcodes support.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 16:38:15 +04:00
Cyrill Gorcunov
0cf8d1e158 check: Add kcmp test
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-05 15:39:18 +04:00
Pavel Emelyanov
65ebd845e5 check: Fix peek_off getting
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-03-24 15:28:10 +04:00
Pavel Emelyanov
e6c88abd62 check: Add some basic checks
* /proc/<pid>/map_files
* sock diag
* ns_last_pid sysctl
* SO_PEEK_OFF sockoptions

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-03-02 14:15:28 +04:00
Pavel Emelyanov
c39e759048 check: Initial skeleton
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-03-02 14:15:09 +04:00