syscall: add memfd_create() (v3)

v2: Follow the kerndat style that "features" are described
just by global boolean variables.

v3: give NULL as a name to get EFAULT if memfd_create is supported
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
shmem: rework getting file descriptors for shared memory regions (v2)

/proc/PID/map_files are protected by the global CAP_SYS_ADMIN, so we
need to avoid using them to support user namespaces.

We are going to use memfd_create() to get the first file descriptor and
then all others processes will able to open it via /proc/PID/fd/X.

This patch reworks slave processes to not use map_files.

v2: add more comments
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
shmem: use memfd_create() to restore shared memory reqions (v2)

/proc/PID/map_files are protected by the global CAP_SYS_ADMIN, so we
need to avoid using them to support user namespaces.

We are going to use memfd_create() to get the first file descriptor and
then all others processes will able to open it via /proc/PID/fd/X.

In this patch memfd_create() is used to get a file descriptor, which is
associated with a shared memory region.

If memfd_create() isn't supported, the old scheme will be used.

v2: don't set a name for memfd. It isn't required.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm/maps01: extend maps01

It's bad idea to have only one target object.
In addition I add a shared region to the second process,
which is not mapped in the first.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm/static/xids00: print more information about errors (v2)

v2: typo fix
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm:Makefile increase wait timeout

This timeout is too small for tcp test cases.
This timeout should be bigger than TCP_RTO_MAX 120 seconds

Signed-off-by: Konstantin Neumoin <kneumoin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
mount: Allow to c/r empty mqueues

We don't support posix mqueues at the moment
but in case if this fs is simply mounted and
not used lets proceed without errors.

In case if someone is using it we detect it
because fs won't be empty and refuse to dump.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm/Makefile: show output for each test

In this case we have another chance to not skip errors.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: always show errors

Users don't like errors even if criu returns zero.
So I suggest to start looking at them.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
reg-files: Don't mangle ghost directories

Because directories are opened via direct mkdir
call with name taken from ghost path don't postfix
it with cr.%x.ghost, otherwise that's the name
directory will have after restore complete causing
cwd01 test to fail.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>