2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00
Commit Graph

9272 Commits

Author SHA1 Message Date
Kirill Tkhai
6c143e5eba pstree: Add helpers for ordered linking child task to parent
Place child reapers of pid namespaces at the beginning
of pstree_item::children list and sort them by nesting
level.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:26:44 +03:00
Kirill Tkhai
d82cd43b78 zdtm: Make possible to claim for features list
Currently, one feature is supported. Add possibility
for a test to depend on several features.

v2: Delete excess "if" as suggested by Andrey Vagin.
    Rename variables to decrise patch size.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:26:43 +03:00
Pavel Emelyanov
839837b99a pstree: Add extern to "current" declaration
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:59 +03:00
Kirill Tkhai
e997d34b0c criu: Add raw fork() implementation
Glibc has BUG with process creation:
https://sourceware.org/bugzilla/show_bug.cgi?id=21386

It doesn't behave well when parent and child are from
different pid namespaces and have the same pid.

Use raw syscall without glibc's asserts as workaround.

Also, use raw syscall for getpid() in tests too,
as these two function go in the pair (glibc's getpid()
relies on glibc's fork()).

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:59 +03:00
Pavel Tikhomirov
ad741662b8 pstree: use RB_EMPTY_NODE to check that node is not linked
When new rb_root is created for pidns it is initialized with
RB_ROOT, so ns->pid.rb_root.rb_node is NULL at first. Later
then insert first node in lookup_create_pid() to these rb-tree
it will have (NULL & color) in node->rb_parent_color.

So the check "!rb_parent(&found->ns[i].node)" will be true for
the rb-tree's root node, and criu will fail lookup these node.

We haven't hit that yet as to get to these check we need task in
at least two levels of pidns which at the same time is the root
in rb-tree on e.g. level 0.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:59 +03:00
Cyrill Gorcunov
d0ffc478ea sfd: Lift up own fd limit on bootup
This minimize chances to hit problem where files
used for page transfer are trying to use same number
reserved for service fd.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2017-11-30 01:24:58 +03:00
Cyrill Gorcunov
b55eb53c1e kdat: Add fetching files stat
Will need it to unlimit the files allocation
for service fd reserving and later for parasite code run
(which is implemented in vz7 instance and soon will be
ported into vanilla).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
8cd8f9736e files: Unexport collect_task_fd()
It has only one user, so unexport it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
2c2a253354 autofs: Add FD_TYPES__AUTOFS_PIPE type
Add a fake fd type for autofs. This allows functions
like find_file_desc() work as expected, without
having two different file_desc with the same type
and same id.

Also, later, it will allow to delete autofs_create_fle()
and to use generic helper.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
522d9c7180 utils: Make call_in_child_process() use parent's stack
1)Use CLONE_VFORK to create subprocess, as it's safe after patch
"clone_noasan: Allow to create CLONE_VM|CLONE_VFORK processe".

2)add more CLONE_XXX to flags to speedup the syscall.

3)Do not send SIGCHLD, as parent sees child's exit() synchronuos anyway.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
0315082e06 clone_noasan: Allow to create CLONE_VM|CLONE_VFORK processes
Picked from patch "[PATCH RFC] namespaces: use CLONE_VFORK
with CLONE_VM when it is possible" by Andrew Vagin.

Currenly parent touches child's stack, as in moment of clone() call
its stack pointer is above the child's (we allocate char stack[128]
on parent's stack). This prevents to create CLONE_VM|CLONE_VFORK
processes, because the child uses stack addresses occupied by parent.

The patch changes clone_noasan() behaviour and allows to do that
with the same memory consumption. We give a child memory, which
is not used by parent clone(), so parent's and child's stacks
have no tntersection.

This allows to create CLONE_VM|CLONE_VFORK processes.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
81097c837b pid_ns: Close sk in case of pid_ns_helper_sock() fails
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
943424a281 pid_ns: Do cleanups in do_create_pid_ns_helper()
Move switch_ns() down because __pstree_pid_by_virt()
does not need cleanup.
Add more goto labels and restore ns back in case of fail.

Also delete pr_err(), because the error is already printed
by request_set_next_pid().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
d4e1c5fb44 forking: Use last_pid_mutex for synchronization during clone()
Before this patch we used flock to order task creation,
but this way is not good. It took 5 syscalls to synchronize
a creation of a single child:

1)open()
2)flock(LOCK_EX)
3)flock(LOCK_UN)
4)close() in parent
5)close() in child

The patch introduces more effective way for synchronization,
which executes 2 syscalls only. We use last_pid_mutex,
and the syscalls number sounds definitely better.

v2: Don't use flock() at all

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
e032b85c51 forking: Introduce last_pid_mutex and helpers
Introduce mutex for synchronization ns_last_pid file
on restore.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
a90aad23a4 namespace: Group unlocking/closing operations in do_create_pid_ns_helper()
Group them for 1)error and 2)parent cases. This minimize the code
and will be used in next patches.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
e31ad5f195 pid_ns: Move parent pid_ns's helper check to create_pid_ns_helper()
It's impossible to create a task from a pid_ns if its helper
is not created, because we wait in wait_pid_ns_helper_prepared()
for that. So, such situation here is a bug.
Move the wait and convert it to BUG().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
56719a3e52 pid_ns: Simplify do_create_pid_ns_helper() using ns helpers
Get pid_ns fd from INIT_PID task of this namespace and
use switch_ns() and restore_ns().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
3ba6ed7fcd pid_ns: Pass namespace init task to do_create_pid_ns_helper()
This will be used in next patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
f88ed85618 pid_ns: Rename do_destroy_pid_ns_helper()
It must sound do_destroy_pid_ns_helpers() with *s*.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
a6505c5f56 restore: Always set real pid in restore_task_with_children()
In next patches, root_item will need to have its real pid
to be sure, usernsd already sees it.

Also add a comment, explaning why set real pid in two places.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
6191677b75 restore: Delete excess code in call_clone_fn()
We never call this function for root_item.
It's for dropping user ns, which may happen
with the rest of tasks only.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:32 +03:00
Kirill Tkhai
f7b1e3fc77 restore: Simplify do_fork_with_pid() #2
Move xfree() up

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
1314e0d2e8 restore: Simplify do_fork_with_pid()
memcpy() is not need here, as we rewrite all the fields later.
Also, use PID_SIZE() helper.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
fce6be3c9b zdtm: Mark ns tests as auto
Check the features and delete "noauto".

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
20d1d08f30 ns: Add ns_get_parent() feature
Check for NS_GET_PARENT nsfs ioctl().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
10ed43f2d5 ns: Add ns_get_userns() feature
Check for NS_GET_USERNS nsfs ioctl().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
c739646659 zdtm: Fixup netns_sub_veth test hang
This patch fixes the test hang, which happens in my envinronment.

==================== Run zdtm/static/netns_sub_veth in uns =====================
Start test
Test is SUID
./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.out

==== ALARM ====
  PID TTY      STAT   TIME COMMAND
 1991 ?        Ssl    0:40  \_ /usr/lib/gnome-terminal/gnome-terminal-server
 2124 pts/1    Ss+    0:00  |   \_ bash
 2416 pts/2    Ss+    0:00  |   \_ bash
 4064 pts/4    Ss     0:00  |   \_ bash
 4075 pts/4    S      0:00  |   |   \_ su
 4085 pts/4    S      0:00  |   |       \_ bash
 1556 pts/4    S+     0:00  |   |           \_ python2 ./test/zdtm.py run -t zdtm/static/netns_sub_veth
 1590 pts/4    S+     0:00  |   |               \_ ./zdtm_ct zdtm.py
 1605 pts/4    S+     0:00  |   |               |   \_ python2 zdtm.py
 1616 pts/4    S+     0:00  |   |               |       \_ python2 zdtm.py
 1960 pts/4    S+     0:00  |   |               |           \_ make --no-print-directory -C zdtm/static netns_sub_veth.pid
 1969 pts/4    S+     0:00  |   |               |               \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.out
 1970 ?        Ss     0:00  |   |               |                   \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_veth.
 1973 ?        S      0:00  |   |               |                       \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_sub_v
 1974 ?        Ss     0:00  |   |               |                           \_ ./netns_sub_veth --pidfile=netns_sub_veth.pid --outfile=netns_s
 1975 ?        Z      0:00  |   |               |                               \_ [netns_sub_veth] <defunct>
 1979 pts/4    R+     0:00  |   |               \_ ps axf

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
de463c61b3 pid_ns: Destroy helpers via kill()
When INIT_PID of a pid_ns emergency exits, kernel
kills all processes belonging to the namespace.
So, it's hopelessly to wait helper answer to destroy
request. Use kill() to destroy instead of that.
It will be noop in case of a handler is already
killed, and we won't stuck.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
e299352705 zdtm: Return tun test back as "auto"
After last patches for net ns the test works again (as envinronment changed),
so return it back.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
4677d05e1a pstree: Delete checks of always existing pstree_item::ids on restore
pid, net, ipc, uts, mnt ids exist always, and we check
for them when we are reading ids img (see previous
patch "pstree: Check for always existing task ids").
Also, pstree_item::ids exist always too (we populate
them even for dead tasks, see read_pstree_image()).
So, delete the excess checks and simplify the code.

Also, in restore_one_alive_task() check for has_user_ns_id
instead of ids, as ids always exist.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
3396508044 pstree: undef ADD_OR_COPY_ID()
Limit the scope of this macros and make visible its borders.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
6748de2720 pstree: Fix alignment in read_pstree_ids()
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
594c69206c pstree: Delete excess check in read_pstree_ids()
has_pid_ns_id is checked above. In could go together with
previous patch, but I separated them for easier review.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
80e9ca5b01 pstree: Check for always existing task ids on restore
All alive task must have have ids and the fields,
implemented before the img format became stable
(see commit 2105e18eee).

Check for them in the only place (in additional to the
check for has_pid_ns_id, which we already have)
and this will allow to remove checks for item->ids and
for item->ids->has_xxx_ns_id from the rest of code
and make it simplier. See patch "pstree: Delete checks
of always existing pstree_item::ids on restore" in further)

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
b3bbece27f pstree: Delete excess check it read_pstree_image()
This is already checked, when we check for parent->ids.
So, delete excess check.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
a58717c908 namespaces: Silence coverity on get_service_fd()
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
709d934489 namespaces: Unexport pid_ns_helper_sock()
It's used in the same file, where it's declarated.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
9c336c04ba pstree: Return in case of error in parse_threads()
Add missed return on memory allocation fail branch.
Found by coverity.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
dfc97293e0 pidns: Optimize set_next_pid()
Do not use pid namespace helper when there is one-level pid.
If it's one-level, then the created task is in root pid ns.
Also, as a parent's level is less or equal a child's,
then parent is in root pid ns too. So, write next pid directly.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Pavel Tikhomirov
9fd53e95e0 pstree/pidns: initialize tid->ns[i].virt for threads
That is for if-unset check in dump_task_thread(), which compares virt
and -1. It is ok not to initialize virt if kernel has NSpid in
/proc/pid/status as parse_pid_status() will rewrite zeroes, but on
VZ7 kernel it will fail:

https://ci.openvz.org/job/CRIU/job/CRIU-virtuozzo/job/criu-dev/2021/
Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>

======================== Run zdtm/static/clone_fs in h =========================
Start test
./clone_fs --pidfile=clone_fs.pid --outfile=clone_fs.out
Run criu dump
=[log]=> dump/zdtm/static/clone_fs/24/1/dump.log
------------------------ grep Error ------------------------
(00.007511) Dumping general registers for 25 in native mode
(00.007525) Dumping GP/FPU registers for 25
(00.007535) 25 has 0 sched policy
(00.007542) 	dumping 0 nice for 25
(00.007549) Error (criu/cr-dump.c:863): Parasite and /proc/[pid]/status gave different tids
------------------------ ERROR OVER ------------------------
Run criu restore
=[log]=> dump/zdtm/static/clone_fs/24/1/restore.log
------------------------ grep Error ------------------------
(00.000497) Add user ns 2 pid 24
(00.000500) Add pid ns 1 pid 24
(00.000503) Add ipc ns 4 pid 24
(00.000506) Add uts ns 5 pid 24
(00.000514) Error (criu/pstree.c:501): Can't skip zero pids levels (0) or find {parent,} ns (1)
(00.000520) Error (criu/pstree.c:813): BUG at criu/pstree.c:813
------------------------ ERROR OVER ------------------------

Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Andrei Vagin
6136002e15 restore: create tansport socket for pidns helpers from the root task
The root task can live in another netns and it has to be restored
before executing setup-namespaces scripts.

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Looks-good-to: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Andrei Vagin
44117eb743 restore: create the root netns before running setup-namespaces scripts
runc restore executes criu with --emptyns network and set
a setup-namespaces script to restore a network namespace.

https://github.com/xemul/criu/issues/314

Looks-good-to: Pavel Emelyanov <xemul@virtuozzo.com>
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Fixes: 2189b9c71d3d ("net: allow to dump and restore more than one network namespace")
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
3a4a17cf39 ns: Nested pid_ns support
Allow nested pid_ns, but turn restoring of pgid and sid off for the cases,
when there are child pid namespaces. This functionality will be realized
by Pavel Tikhomirov, he is working on that.

v4: Also make restore_before_setsid() always return false if there are
child pid namespaces

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
fa07478d54 pstree: Use CLONE_NEWPID only to create child reaper of pid_ns
If task has no INIT_PID, then clear this clone flag.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
514318dd7a pid: Check for equality of getpid() of child to last_level_pid
Make the sanity check working in case of mutli-level pids.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
3306436349 restorer: Set NStids in all pid_ns for thread before we create it.
If there is multi-level pid, ask helpers to populate /proc last pids
in their active pid namespaces. So, thread will be created with right
NStids.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
12263ba42a restorer: Close transport socket later
We need a socket to request NStids for tasks threads.
Transport socket will be used for that in next patches.
So, close it later, after threads are created.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
fb39caaabb pid: Teach set_next_pid() working with nested pid_ns
Request helpers to set ns_last_pid in their active pid_ns.
Of course, optimizations are possible here, but not for now.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00
Kirill Tkhai
e1269b5594 pid_ns: Set user_ns before creation of pid_ns
Since child's pid_ns may have user_ns not equal
to parent's, and we do not want to lose parent's
user_ns (as it's not impossible to restore it back),
create the child from a sub-process.

v3: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:24:31 +03:00