- 15 Mar, 2017 29 commits
-
-
Cyrill Gorcunov authored
We support compat mode now (at least partially) so the test should be allowed. Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
To support ia32 compat mode on x86-64 we need to things - extend fpu_state_t type to carry ia32 specifics - fill up additional members in fpu_state_ia32_t type before calling sigreturn (this also requires the uc_mcontext::fpstate won't be aligned on 32 bytes) Because we touches base types in compel the criu has been updated accordingly. Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
In compat mode the fpu frame won't be aligned on 32 bit due to kernel specifics. Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
It was never functional neither we plan to support native ia32 mode, so drop these incomplete code pieces out. - Presumably we will need TASK_SIZE for compat mode so I provide TASK_SIZE_IA32 for this sake - 32 bit syscalls are remaining for a while Acked-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
It's now obsoleted by compel library. Maybe-TODO: Add compel tool exec action? Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This is the difference between two commits criu-dev/b0f6f293/Unify own memcpy/memset/memcmp master/0367a1fe/Drop prefix from own memcpy/memset/memcmp that makes criu-dev after rebase on master with latter commit be the same as it was with former commit before rebase. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
First, TASK_* defines provided by compel should be prefixed with COMPEL_. The complication is, same constants are also used by CRIU, some are even writted into images (meaning we should not change their values). One way to solve this would be to untie compel values from CRIU ones, using some mapping between the two sets when needed (i.e. in calls to compel_wait_task() and compel_resume_task()). Fortunately, we can avoid implementing this mapping by separating the ranges used by compel and criu. With this patch, compel is using values in range 0x01..0x7f, and criu is reusing those, plus adding more values in range 0x80..0xff for its own purposes. Note tha the values that are used inside images are not changed (as, luckily, they were all used by compel). travis-ci: success for compel uapi cleanups (rev2) Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
infect.h includes compel.h, and compel.h includes infect.h. Surely, due to include guards it will be sorted out, but we'd rather just include what we need. travis-ci: success for compel uapi cleanups Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
travis-ci: success for compel uapi cleanups Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
We have ptrace defines and functions that are part of UAPI, and we have some internal stuff not to be exposed. Split ptrace.h into two files accordingly. While at it, do some cleanups: - add ptrace_ prefix to some functions and macros - remove (duplicated) PTRACE_* defines from .c files - rename ptrace_seccomp(), remove its duplicate - remove unused ptrace defines - remove unneeded (ptrace-related) includes travis-ci: success for compel uapi cleanups Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Reviewed-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrey Ryabinin authored
To run CRIU with ASan we have to use some non-default options: - detect_leaks=0 - We have to many leaks for know. Let's disable until fixed. - disable_coredump=0 - without this ASan library changes RLIMIT_CORE which break rlmimits00 tests. - log_path=asan.log - For some reason default output to stderr sometimes doesn't work in CRIU. So error log will be stored in asan.log.<pid> file instead. travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrey Ryabinin authored
ASan doesn't play nicely with clone if we use current stack for child task. ASan puts local variables on the fake stack to catch use-after-return bug: https://github.com/google/sanitizers/wiki/AddressSanitizerUseAfterReturn#algorithm So it's become easy to overflow this fake stack frame in cloned child. We need a real stack for clone(). To workaround this we add clone_noasan() not-instrumented wrapper for clone(). Unfortunately we can't use __attrbute__((no_sanitize_addresss)) for this because of bug in GCC > 6: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69863 So the only way is to put this wrapper in separate non-instrumented file. travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrey Ryabinin authored
This allows to build criu with AddressSanitizer enabled: make ASAN=1 -j<N> travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Andrey Ryabinin authored
This adds the reverse of CFLAGS_obj.o with CFLAGS_REMOVE_obj.o. This allows to prevent certain CFLAGS from being used to compile files. travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
We don't need gotpcrel inside parasite's blob: we handle relocations over remote map in compel library, reading them from parasite's blob header. travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
We need to copy only parasite, do copy page-aligned size, which will copy part of CRIU binary, that follows parasite blob. That will cross red-zones and fire asan error. travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy() Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Dmitry Safonov authored
Those symlinks were for building 32-bit objects with `-m32` to link them with 32-bit parasite. Since I have dropped second parasite, I cleaned Makefile rules for 32-bit parasite, but accidentally left those symlinks. Drop them now. travis-ci: success for x86/compat: clean symlinks left from second parasite Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
The functions it provides, send_fds() and receive_fds(), are already provided by compel/plugins/std.built-in.o (compel/plugins/std/fds.c) which is linked into both parasite and restorer. This fixes the following issue (for some reason, reported on ARMv7, see https://travis-ci.org/kolyshkin/criu/jobs/195367825): LINK criu/pie/parasite.built-in.o GEN criu/pie/parasite.built-in.bin.o criu/pie/pie.lib.a(util-fd.o): In function `send_fds': /criu/include/common/scm-code.c:56: multiple definition of `send_fds' criu/pie/parasite.built-in.o:/criu/include/common/scm-code.c:56: first defined here criu/pie/pie.lib.a(util-fd.o): In function `recv_fds': /criu/include/common/scm-code.c:79: multiple definition of `recv_fds' criu/pie/parasite.built-in.o:/criu/include/common/scm-code.c:79: first defined here criu/pie/Makefile:53: recipe for target 'criu/pie/parasite.built-in.bin.o' failed make[2]: *** [criu/pie/parasite.built-in.bin.o] Error 1 travis-ci: success for criu/pie: kill util-fd.c Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
In a manner similar to one of commit 9303ed3 ("Makefiles: move -Wa,--noexecstack out of CFLAGS"), let's move this option from assembler to linker flags (see the abovementioned commit for reasoning). This fixes generating dependencies for criu/arch/x86/call32.S when using clang: DEP criu/arch/x86/call32.d clang-3.8: error: argument unused during compilation: '-Wa,--noexecstack' DEP criu/arch/x86/call32.d clang-3.8: error: argument unused during compilation: '-Wa,--noexecstack' travis-ci: success for criu/arch/x86/Makefile: move -Wa out of asflags (rev2) Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
travis-ci: success for make: regenerate blobs on linker script (lds) change Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
The kernel does touch only relevant union member on x86_32. travis-ci: success for zdtm/sigpending/32: check only 12 bytes of _si_fields Cc: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
It's library plugin to CRIU - it needs to be 64-bit. travis-ci: success for zdtm/test/rtc: build 64-bit criu-rtc.so Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
For 32-bit fcntl() Glibc function calls sys_fcntl64(), which needs struct flock64, otherwise the kernel gets a wrong struct. For 64-bit, it's all the same. Also unset errno before fcntl() and check return value of the call. Cc: Qiang Huang <h.huangqiang@huawei.com> Cc: Begunkov Pavel <asml.silence@gmail.com> Cc: Pavel Emelyanov <xemul@virtuozzo.com> travis-ci: success for test/zdtm: use flock64 instead of flock Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Raw sys_mmap() returns address or error like -ENOMEM. Don't check MAP_FAILED, check that result is aligned by page. travis-ci: success for x86/compat: fix error-check for compat mmap() Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Initialy, I thought to name it "compat_restore", but after I've dropped the second 32-bit parasite (which surely made compat code lesser and easier), our parasite works in 64-bit in 32-bit task and ptrace() for setting registers in this long-jumped situation will work correctly only after v4.9 kernel. Maybe it can be work-arounded if needed, but yet no compatible dump for pre-v4.9 kernels. Requested-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 14 Mar, 2017 11 commits
-
-
Dmitry Safonov authored
As threads restore in parallel, stack32 may be reused concurrently leading to reusing others thread's data. So, let it lay on stack. It would still worth making 32-bit stack per-task reusing it in threads but at this moment introducing such complexity looks like premature optimization. It does not affect 64-bit C/R. Fixes: file_aio, sigaltstack, clone_fs, socket_aio, different_creds, futex travis-ci: success for 32-bit tests fixes Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
It's a workaround to clang-3.4, which doesn't handle numbers in asm macros rightly: https://llvm.org/bugs/show_bug.cgi?id=21500 Which resulted in: CC compel/arch/x86/plugins/std/parasite-head.o <instantiation>:3:2: error: too few operands for instruction pushq ^ compel/arch/x86/plugins/std/parasite-head.S:26:2: note: while in macro instantiation PARASITE_ENTRY ^ Fixes: https://travis-ci.org/0x7f454c46/criu/jobs/186099057 travis-ci: success for 32-bit tests fixes Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
Otherwise we'll try to set 32-bit register set to 64-bit task, which is not possible with ptrace - it uses register set size, according to processes mode. So we should set 32-bit regset only to tasks those are in 32-bit mode already. Please, see inline comment in the patch for more info. travis-ci: success for 32-bit tests fixes Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
We can be on v4.9 or newer kernel, but have no 32-bit multilib toolchain, which will result in !CONFIG_COMPAT but kdat_compat_sigreturn_test() will return true as we have new arch_prctls in kernel needed for compatible C/R. Fail compat test in this case. travis-ci: success for 32-bit tests fixes Reported-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Dmitry Safonov authored
As I've united k_rtsigset_t between native and compat ucontext's, it's 8-bytes aligned now. We don't care about align of this as we fill it always with memcpy()/memset(0). So after those changes, ucontext_ia32 has received new padding between uc_mcontext and uc_sigmask (4 bytes to align to 8-byte sized sigmask). Because of this, mask of blocked signals was restored with shift (wrongly). Fixes: signalfd00, file_attr tests. travis-ci: success for 32-bit tests fixes Signed-off-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
In this case it will work for any make commangs. For example: make COMPAT_TEST=y -C test/zdtm/lib travis-ci: success for zdtm: handle COMPAT_TEST from Makefile.inc Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
-
Kir Kolyshkin authored
Problem: if we do touch criu/arch/x86/cpu.c nothing is being rebuilt. For detailed analisys, see the previous commit ("criu/Makefile: fix rebuilding criu/pie/pie.lib.a"). Note there are other targets in criu/Makefile where one might want to add .FORCE to, but it's not needed as they all depend on another target which itself is marked as .PHONY. travis-ci: success for Makefiles: fix deps checking Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
As reported by Andrei Vagin: touch criu/pie/parasite-vdso.c does not lead to rebuild pie.lib.a and its dependencies. This happened because the real dependencies of criu/pie/pie.lib.a are listed in criu/pie/Makefile.library, which is never included or called with sub-make, because the criu/Makefile says: criu/pie/pie.lib.a: $(ARCH-LIB) $(Q) $(MAKE) $(call build-as,Makefile.library,criu/pie) all essentially saying we only need to call a sub-make with Makefile.library if the target is absent, or $(ARCH-LIB) is newer than the target. A workaround is to use .FORCE so that the Makefile.library is always called and so the dependencies are checked. Note the above is also true for any target that involves calling a sub-make -- it should either be used with .FORCE or otherwise depend on a phony target. I haven't checked all the CRIU makefiles but suspect there might be more cases like this one. travis-ci: success for Makefiles: fix deps checking Cc: Cyrill Gorcunov <gorcunov@openvz.org> Reported-by:
Andrei Vagin <avagin@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Reviewed-by:
Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Cyrill Gorcunov authored
travis-ci: success for .gitignore: Add compel and common asm symlinks Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Yet another nail in the coffin of compel cli usage complexity. Since commit cd1c9d9 ("compel: simplify usage wrt ids") landed, it became obvious that the newly introduced -p option can be made optional. First, prefix value is not very important; second, it can be easily generated from the input (or output) file name. This is what this commit does, also trying to check that the resulting prefix is adeqate for using in C code. In case it is not (say, file names used are 1.po 1.h), an error is printed, suggesting to use --prefix. The commit also makes use of this functionality by removing -p option from compel/test/infect and criu/pie Makefiles. While at it, let's also remove -l 4 and the kludge of hiding it. If the output generated by this is ever needed, one can easily run "compel hgen -l4 ..." manually. travis-ci: success for More polishing for compel cli Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Add "compel libs" that prints the list of libraries needed to link the parasite loader. Make compel/test/ and criu/ to use it. travis-ci: success for More polishing for compel cli Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-