- 12 May, 2018 9 commits
-
-
Andrew Vagin authored
tun test in nested net ns wrapper. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> ktkhai: Makefile hunks Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Andrew Vagin authored
This adds new tunfile_entry::ns_id field and populates it in standard socket way. Restore uses this ns_id to choose correct namespace. Note, we could completelly skip set_netns() on restore in case of !has_ns_id, but using top_net_ns invents some definite behaviour. Signed-off-by:
Andrew Vagin <avagin@virtuozzo.com> ktkhai: comment written/code movings Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
Similar to socket logic, abort the dump, if tun is not related to any net ns, seen before. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
Refactoring, no functional change. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
LAZY_PAGES_SK_OF is need only once for every process, and it's not frequently used, so we can place it to fdstore. https://travis-ci.org/tkhai/criu/builds/343405755Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com>
-
Kirill Tkhai authored
Sockets are sent via SCM_CREDENTIALS, and this kernel interface needs to have uid and gid mapped (see __scm_send() in kernel). So, set them before send_fds() use. Also, move prep_usernsd_transport() below to be after this for uniformity. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
https://github.com/checkpoint-restore/criu/issues/466Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 29 Mar, 2018 1 commit
-
-
Pavel Emelyanov authored
A bug sneaked into the --shell-job restore while doing 3.8 merge. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 27 Mar, 2018 1 commit
-
-
Andrei Vagin authored
When the "core: Init fdstore even earlier" commit was moved into the master branch, one hunk was lost. https://github.com/checkpoint-restore/criu/issues/460Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 13 Mar, 2018 1 commit
-
-
Pavel Emelyanov authored
We've slowed down a little, but still new features and bugfixes appear. This time we've improved lazy migration, completed SCM messages support, added nesting netns support (now we have two of them -- net and mnt) and did many small fixes here and there. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
- 02 Mar, 2018 28 commits
-
-
Dmitry Safonov authored
Coverity has informed: *** CID 188251: Error handling issues (CHECKED_RETURN) /criu/arch/x86/crtools.c: 196 in kdat_x86_has_ptrace_fpu_xsave_bug_child() 190 return 0; 191 } 192 #endif 193 194 static int kdat_x86_has_ptrace_fpu_xsave_bug_child(void *arg) 195 { >>> CID 188251: Error handling issues (CHECKED_RETURN) >>> Calling "ptrace" without checking return value (as is done elsewhere 46 out of 51 times). 196 ptrace(PTRACE_TRACEME, 0, 0, 0); 197 kill(getpid(), SIGSTOP); 198 pr_err("Continue after SIGSTOP.. Urr what?\n"); 199 _exit(1); 200 } 201 Also added checks for kill() and waitpid(). Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Child may see close() result before it receives signal, while it shouldn't see it. Instead of games with later close(), just stop do it. sys_exit() after program finish will close them all. Reported-by:
Andrey Vagin <avagin@virtuozzo.com> Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Currently we save only attributes with non-zero values. For example, a default value for IFLA_IPTUN_PROTO is IPPROTO_IPV6 (41), so we have to save even attributes with zero values. https://github.com/checkpoint-restore/criu/issues/445 Fixes: 4a044e6a ("net: Dump regular sit device") Cc: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
We open ns_fd via ioctl(SIOCGSKNS), but never close. Fix that. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
x86's kerndat section in crtools.c has grown too much. Let's make it more readable and *looking at cleared include-list*, it'll better parallelize build. Maybe we should turn __weak function into 0-defines. Or clean 0-defines with ifdefs in generic file. I have no strong opinion on that. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
The --lazy-migrate option allows testing of lazy migration when running ns or uns flavor. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com>
-
Andrei Vagin authored
CID 85039 (#1 of 1): Unchecked return value (CHECKED_RETURN) 6. check_return: Calling ptrace without checking return value (as is done elsewhere 44 out of 49 times). Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 155804 (#1 of 1): Unchecked return value (CHECKED_RETURN) 2. check_return: Calling umount2 without checking return value (as is done elsewhere 8 out of 9 times). Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 172198 (#1 of 1): Resource leak (RESOURCE_LEAK) 9. leaked_storage: Variable sk going out of scope leaks the storage it points to. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 154076 (#1 of 1): Unchecked return value from library (CHECKED_RETURN) 1. check_return: Calling setsockopt(sk, 6, 1, &val, 4U) without checking return value. This library function may fail and return an error code. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
CID 161693 (#1 of 1): Resource leak (RESOURCE_LEAK) 5. leaked_storage: Variable new going out of scope leaks the storage it points to. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
*** CID 179043: (USE_AFTER_FREE) close bfd fd safe so that we won't have double close *** CID 179041: Resource leaks (RESOURCE_LEAK) don't forget to close fd on error Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
*** CID 185302: Null pointer dereferences (NULL_RETURNS) /test/zdtm/static/cgroup_ifpriomap.c: 107 in read_one_priomap() >>> Dereferencing a pointer that might be null "out->ifname" when calling "strncpy". There is also a warning about using rand(), but.. Not sure that we need to entangle everything just for pleasing Coverity: >>> CID 185301: Security best practices violations (DC.WEAK_CRYPTO) >>> "rand" should not be used for security related applications, as linear congruential algorithms are too easy to break. Leaving that as-is and marking in Coverity as WONTFIX. Signed-off-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
I've also dropped `noauto' in this patch, reverting the commit be98273c ("zdtm: mark static/cgroup_ifpriomap as noauto") Don't see any sense to separate it as another patch. Fixes: #383 Signed-off-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Mike Rapoport authored
Currently, if pipe is shared between lazy and non-lazy PPBs lazy migration fails because data that should be transfered on demand is spliced into the images. Preventing pipe sharing between PPBs of different type resolves this issue. In order to still minimize pipe fragmentation, we track the last pipe that was used for certain PPB type and re-use it for the PPB of the same type. Signed-off-by:
Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Fixes: commit 925451c12b2e ("zdtm/x86: Add a mxcsr preserving fpu test") Signed-off-by:
Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
criu/sk-packet.c:443:3: error: 'strncpy' output may be truncated copying 14 bytes from a string of length 15 strncpy(addr_spkt.sa_data, req.ifr_name, sa_data_size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/img-remote.c:383:3: error: 'strncpy' specified bound 4096 equals destination size strncpy(snapshot_id, li->snapshot_id, PATHLEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/img-remote.c:384:3: error: 'strncpy' specified bound 4096 equals destination size strncpy(path, li->name, PATHLEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/files.c:288:3: error: 'strncpy' output may be truncated copying 4095 bytes from a string of length 4096 strncpy(buf, link->name, PATH_MAX - 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/sk-unix.c:239:36: error: '/' directive output may be truncated writing 1 byte into a region of size between 0 and 4095 snprintf(path, sizeof(path), ".%s/%s", dir, sk->name); ^ criu/sk-unix.c:239:3: note: 'snprintf' output 3 or more bytes (assuming 4098) into a destination of size 4096 snprintf(path, sizeof(path), ".%s/%s", dir, sk->name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/mount.c:2563:3: error: 'strncpy' specified bound 4096 equals destination size strncpy(path, m->mountpoint, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/cr-restore.c:3647:2: error: 'strncpy' specified bound 16 equals destination size strncpy(task_args->comm, core->tc->comm, sizeof(task_args->comm)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
fs.c:78:5: error: 'strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation] strncpy(m->fsname, fsname, sizeof(m->fsname)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
As it's aligned to 16, all structures that contain it should be also aligned to 16. In the kernel there is no such align as there two separate definitions of i387_fxsave_struct: one for ia32 and another for x86_64. Fixes newly introduced align warning in gcc-8.1: In file included from compel/include/uapi/compel/asm/sigframe.h:7, from compel/plugins/std/infect.c:13: compel/include/uapi/compel/asm/fpu.h:89:1: error: alignment 1 of 'struct xsave_struct_ia32' is less than 16 [-Werror=packed-not-aligned] } __packed; ^ It doesn't change the current align of the struct, as containing structures are __packed and it aligned already *by fact*. It only affects the function users of the struct's local variables: now they lay aligned on a stack. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
It helped a bit to debug Skylake ptrace() bug, let's put it in. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Ugh, I've spent 25 mins at 4 A.M. to figure out why the tests are failing. And the reason is stupied me, who defined a new flag after 0x8 as 0x16, not as 0x10. Simplify those definitions for such simple-minded living creatures like Dima. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
On Skylake processors and kernel older than v4.14 ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, iov) may return not full xstate, ommiting FP part (that is XFEATURE_MASK_FP). There is a patch which describes this bug: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1318800.html Anyway, it's fixed in v4.14 kernel by (what we believe with Andrey) this: https://patchwork.kernel.org/patch/9567939/ As we still support kernels from v3.10 and newer, we need to have a workaround for this kernel bug on Skylake CPUs. Big thanks to Shlomi for the reports, the effort and for providing an Amazon VM to test this. I wish more bug reporters were like you. Reported-by:
Shlomi Matichin <shlomi@binaris.com> Provided-test-env: Shlomi Matichin <shlomi@binaris.com> Investigated-with: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Mere cleanup. For Skylake workaround I'll call one after another, so it's better separate it in a small helpers. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
get_task_regs() needs to know if it needs to use workaround for a Skylake ptrace() bug. The next patch will introduce a new flag for that. I also thought about making 3 versions of get_task_regs() and adding them to ictx->get_task_regs() depending on the flags.. But get_task_regs() is a private function and infect_ctx is a uapi.. So, let's just pass context flags to get_task_regs(). Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
As we anyway define save_regs_t for other purposes, use it in the function declaration. To unify infect_ctx style, add make_sigframe_t. Mere cleanup. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
We need to know if ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, iov) returns xsave without FP state part. Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Error-path for failed fork(). Looks originally forgotten, oops! Also print a message on failed fork(). Signed-off-by:
Dmitry Safonov <dima@arista.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-