[v3,00/55] Nested pid namespaces support

Submitted by Andrey Vagin on April 11, 2017, 4:26 a.m.

Details

Message ID 20170411042620.GA27141@outlook.office365.com
State New
Headers show

Patch hide | download patch | download mbox

=== Run 1/1 ================ zdtm/static/pidns00

======================== Run zdtm/static/pidns00 in ns =========================
make[1]: Nothing to be done for 'default'.
Start test
Test is SUID
make[1]: Nothing to be done for 'default'.
./pidns00 --pidfile=pidns00.pid --outfile=pidns00.out
Run criu dump
Run criu restore
################ Test zdtm/static/pidns00 FAIL at CRIU restore #################
##################################### FAIL #####################################
[root@fc24 criu]# dmesg -c
[439441.751893] traps: pidns00[27458] general protection ip:7f9b3183d642 sp:7ffc2d9587c0 error:0
[439441.751900]  in libc.so.6[7f9b31806000+1bd000]
[439441.768416] systemd-journald[13102]: Successfully sent stream file descriptor to service manager.
[439441.886503] systemd-journald[13102]: Compressed data object 1176 -> 652 using LZ4
[439441.887834] systemd-journald[13102]: Compressed data object 1658 -> 653 using LZ4
[439441.889093] systemd-journald[13102]: Compressed data object 3128 -> 1774 using LZ4
[439442.037519] criu[27482]: segfault at 12 ip 000000000047e4d3 sp 00007ffc190820a8 error 4 in criu[400000+117000]
[439442.058973] systemd-journald[13102]: Successfully sent stream file descriptor to service manager.
[439442.211795] systemd-journald[13102]: Compressed data object 1150 -> 665 using LZ4
[439442.213101] systemd-journald[13102]: Compressed data object 5493 -> 1619 using LZ4
[root@fc24 criu]# 
[root@fc24 criu]# git diff
diff --git a/test/zdtm/static/pidns00.c b/test/zdtm/static/pidns00.c
index e3ed74b..e86d488 100644
--- a/test/zdtm/static/pidns00.c
+++ b/test/zdtm/static/pidns00.c
@@ -54,6 +54,11 @@  futex_t *futex;
 
 int child(void)
 {
+       int fd = open("/proc/self/ns/pid", O_RDONLY);
+       unshare(CLONE_NEWPID);
+       if (fork())
+               setns(fd, CLONE_NEWPID);
+       close(fd);
        futex_wait_while_lt(futex, 1);
        return 0;
 }