Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sk-unix: add fake queuers only for sockets without peer #1197

Open
wants to merge 118 commits into
base: criu-dev
Choose a base branch
from

Commits on Jul 16, 2020

  1. util: Fix addr casting for IPv4/IPv6 in autobind

    When saddr.ss_family is AF_INET6 we should cast &saddr to
    (struct sockaddr_in6 *).
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    669da42 View commit details
    Browse the repository at this point in the history
  2. remote: Use tmp file buffer when restore ip dump

    When CRIU calls the ip tool on restore, it passes the fd of remote
    socket by replacing the STDIN before execvp. The stdin is used by the
    ip tool to receive input. However, the ip tool calls ftell(stdin)
    which fails with "Illegal seek" since UNIX sockets do not support file
    positioning operations. To resolve this issue, read the received
    content from the UNIX socket and store it into temporary file, then
    replace STDIN with the fd of this tmp file.
    
     # python test/zdtm.py run -t zdtm/static/env00 --remote -f ns
     === Run 1/1 ================ zdtm/static/env00
    
     ========================= Run zdtm/static/env00 in ns ==========================
     Start test
     ./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST
     Adding image cache
     Adding image proxy
     Run criu dump
     Run criu restore
     =[log]=> dump/zdtm/static/env00/31/1/restore.log
     ------------------------ grep Error ------------------------
     RTNETLINK answers: File exists
     (00.229895)      1: do_open_remote_image RDONLY path=route-9.img snapshot_id=dump/zdtm/static/env00/31/1
     (00.230316)      1: 	Running ip route restore
     Failed to restore: ftell: Illegal seek
     (00.232757)      1: Error (criu/util.c:712): exited, status=255
     (00.232777)      1: Error (criu/net.c:1479): IP tool failed on route restore
     (00.232803)      1: Error (criu/net.c:2153): Can't create net_ns
     (00.255091) Error (criu/cr-restore.c:1177): 105 killed by signal 9: Killed
     (00.255307) Error (criu/mount.c:2960): mnt: Can't remove the directory /tmp/.criu.mntns.dTd7ak: No such file or directory
     (00.255339) Error (criu/cr-restore.c:2119): Restoring FAILED.
     ------------------------ ERROR OVER ------------------------
     ################# Test zdtm/static/env00 FAIL at CRIU restore ##################
     ##################################### FAIL #####################################
    
    Fixes checkpoint-restore#311
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    66fb18f View commit details
    Browse the repository at this point in the history
  3. pipes: loop over splice() when dumping a pipe's data

    Instead of erroring, we should loop until we get the desired number of
    bytes written, like regular I/O loops.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    db31a64 View commit details
    Browse the repository at this point in the history
  4. img-streamer: introduction of criu-image-streamer

    This adds the ability to stream images with criu-image-streamer
    
    The workflow is the following:
    1) criu-image-streamer is started, and starts listening on a UNIX
       socket.
    2) CRIU is started. img_streamer_init() is invoked, which connects to the
       socket. During dump/restore operations, instead of using local disk to
       open an image file, img_streamer_open() is called to provide a UNIX pipe
       that is sent over the UNIX socket.
    3) Once the operation is done, img_streamer_finish() is called, and the
       UNIX socket is disconnected.
    
    criu-image-streamer can be found at:
    https://github.com/checkpoint-restore/criu-image-streamer
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    4666aa6 View commit details
    Browse the repository at this point in the history
  5. tests: run tests with criu-image-streamer with --stream

    One can pass --stream to zdtm.py for testing criu with image streaming.
    criu-image-streamer should be installed in ../criu-image-streamer
    relative to the criu project directory. But any path will do providing
    that criu-image-streamer can be found in the PATH env.
    
    Added a few tests to run on travis-ci to make sure streaming works.
    We run test that are likely to fail. However, it would be good to once
    in a while run all tests with `--stream -a`.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    c88f611 View commit details
    Browse the repository at this point in the history
  6. crns.py: New attempt to have --unshare option

    So, here's the enhanced version of the first try.
    
    Changes are:
    
    1. The wrapper name is criu-ns instead of crns.py
    2. The CLI is absolutely the same as for criu, since the script
       re-execl-s criu binary. E.g.
    	   scripts/criu-ns dump -t 1234 ...
       just works
    3. Caller doesn't need to care about substituting CLI options,
       instead, the scripts analyzes the command line and
       a) replaces -t|--tree argument with virtual pid __if__ the
          target task lives in another pidns
       b) keeps the current cwd (and root) __if__ switches to another
          mntns. A limitation applies here -- cwd path should be the
          same in target ns, no "smart path mapping" is performed. So
          this script is for now only useful for mntns clones (which
          is our main goal at the moment).
    
    Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Looks-good-to: Andrey Vagin <avagin@openvz.org>
    xemul authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    cc063ef View commit details
    Browse the repository at this point in the history
  7. page-read: Warn about async read w/o completion cb

    Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
    Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
    xemul authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    7913521 View commit details
    Browse the repository at this point in the history
  8. python: Replace xrange with range

    In Py2 `range` returns a list and `xrange` creates a sequence object
    that evaluates lazily. In Py3 `range` is equivalent to `xrange` in Py2.
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    98abfc9 View commit details
    Browse the repository at this point in the history
  9. util: Remove deprecated print_data() routine

    The print_data() function was part of the deprecated (and removed)
    'show' action, and it was moved in util.c with the following commit:
    
    	a501b48
    	The 'show' action has been deprecated since 1.6, let's finally drop it.
    
    	The print_data() routine is kept for yet another (to be deprecated too)
    	feature called 'criu exec'.
    
    The criu exec feature was removed with:
    
    	909590a
    	Remove criu exec code
    
    	It's now obsoleted by compel library.
    	Maybe-TODO: Add compel tool exec action?
    
    Therefore, now we can drop print_data() as well.
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    d56cad8 View commit details
    Browse the repository at this point in the history
  10. criu-ns: Convert to python3 style print() syntax

    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    0f896d8 View commit details
    Browse the repository at this point in the history
  11. criu-ns: Print usage info when no args provided

    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    b7daa02 View commit details
    Browse the repository at this point in the history
  12. criu-ns: Convert c_char_p strings to bytes object

    class ctypes.c_char_p
        Represents the C char * datatype when it points to a zero-
        terminated string. For a general character pointer that may
        also point to binary data, POINTER(c_char) must be used.
        The constructor accepts an integer address, or a bytes object.
    
    https://docs.python.org/3/library/ctypes.html#ctypes.c_char_p
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    6dc283d View commit details
    Browse the repository at this point in the history
  13. net: fix coverity RESOURCE_LEAK

    criu-3.12/criu/net.c:2043: overwrite_var: Overwriting "img" in "img =
    open_image_at(-1, CR_FD_IP6TABLES, 0UL, pid)" leaks the storage that
    "img" points to.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    1aea4b7 View commit details
    Browse the repository at this point in the history
  14. mips:compel/arch/mips: Add architecture support to compel tool and li…

    …braries
    
         This patch only adds the support but does not enable it for building.
    
    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    895392b View commit details
    Browse the repository at this point in the history
  15. mips:compel: Enable mips in compel/

    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    7d0baea View commit details
    Browse the repository at this point in the history
  16. mips:proto: Add mips to protocol buffer files

    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    ebc9280 View commit details
    Browse the repository at this point in the history
  17. mips:criu/arch/mips: Add mips parts to criu

    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    0665df7 View commit details
    Browse the repository at this point in the history
  18. mips:criu: Enable mips in criu

    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    496c561 View commit details
    Browse the repository at this point in the history
  19. mips:support docker-cross compile

    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    39a6b8d View commit details
    Browse the repository at this point in the history
  20. style: fix typos

    Oddly, one of the test had a typo which should be fatal.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    993747b View commit details
    Browse the repository at this point in the history
  21. test/jenkins: use bash to run shell scripts

    We permanently have issues like this:
    ./test/jenkins/criu-iter.sh: 3: source: not found
    
    It looks like a good idea to use one shell to run our jenkins scripts.
    
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    7b2607b View commit details
    Browse the repository at this point in the history
  22. mips: impliment arch_shmat()

    On MIPS CPUs with VIPT caches also has aliasing issues, just like ARMv6.
    To overcome this issue, page coloring 0x40000 align for shared mappings was introduced (SHMLBA) in kernel.
        https://github.com/torvalds/linux/blob/master/arch/mips/include/asm/shmparam.h
    
    Related to this, zdtm test suites ipc.c shm.c shm-unaligned.c and shm-mp.c are passed.
    
    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    aa49836 View commit details
    Browse the repository at this point in the history
  23. mips: fix fail when run zdtm test pthread01.c

    k_rtsigset_t is 16Bytes in mips architecture but not 8Bytes.
    so blk_sigset_extended be added in TaskCoreEntry and ThreadCoreEntry for dumping
    extern 8Bytes data in parasite-syscall.c, restore extern 8Bytes data in cr-restore.c
    
    Signed-off-by: Guoyun Sun <sunguoyun@loongson.cn>
    sunny868 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    59babee View commit details
    Browse the repository at this point in the history
  24. soccr/test: Fix error logging in libsoccr tcp-test

    Signed-off-by: Joshua Abraham <sinisterpatrician@gmail.com>
    jabedude authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    b168624 View commit details
    Browse the repository at this point in the history
  25. Remove dupe of "deprecated stuff on" msg

    A similar one is already printed in check_options().
    
    Before this patch:
    > $ ./criu/criu -vvvvvv --deprecated --log-file=/dev/stdout xxx
    > (00.000000) Turn deprecated stuff ON
    > ...
    > (00.029680) DEPRECATED ON
    > (00.029687) Error (criu/crtools.c:284): unknown command: xxx
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    3b7721c View commit details
    Browse the repository at this point in the history
  26. travis: use bionic almost everywhere

    A few tests were still running on xenial because at some point they were
    hanging. This switches now all tests to bionic except one docker test
    which still uses xenial to test with overlayfs.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    c03a9a0 View commit details
    Browse the repository at this point in the history
  27. tests: move cross compilation to github actions

    This moves the cross compilation tests to github actions, to slightly
    reduce the number of Travis tests and run them in parallel on github
    actions.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    b070c37 View commit details
    Browse the repository at this point in the history
  28. cr-service: fix wording in debug messages

    The message "Overwriting RPC settings with values from <filename>" is
    misleading, giving the impression that file is being read and consumed.
    It really puzzled me, since <filename> didn't exist.
    
    What it needs to say is "Would overwrite", i.e. if a file with such name
    is present, it would be used.
    
    Also, add actual "Parsing file ..." so it will be clear which files are
    being used.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    65c1be8 View commit details
    Browse the repository at this point in the history
  29. cr-service: spell out an error

    While working on runc checkpointing, I incorrectly closed status_fd
    prematurely, and received an error from CRIU, but it was
    non-descriptive.
    
    Do print the error from open().
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    516080b View commit details
    Browse the repository at this point in the history
  30. libcriu: Add orphan pts master

    The orphan pts master option was introduced with commit [1]
    to enable checkpoint/restore of containers with a pty pair
    used as a console.
    
    [1] checkpoint-restore@6afe523
    
    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    a70eabc View commit details
    Browse the repository at this point in the history
  31. libcriu: Use spaces around '='

    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    7eeaa1d View commit details
    Browse the repository at this point in the history
  32. libcriu: Add space between 'if' and parenthesis

    Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
    rst0git authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    4b4e3a2 View commit details
    Browse the repository at this point in the history
  33. coverity: fix RESOURCE_LEAK criu/timens.c: 67

     7. criu-3.14/criu/timens.c:67: leaked_storage: Variable "img" going out of scope leaks the storage it points to.
        65|   	if (id == 0 && empty_image(img)) {
        66|   		pr_warn("Clocks values have not been dumped\n");
        67|-> 		return 0;
        68|   	}
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    e368b3a View commit details
    Browse the repository at this point in the history
  34. coverity: fix FORWARD_NULL in criu/proc_parse.c: 1481

    8. criu-3.14/criu/proc_parse.c:1511: var_deref_model: Passing null pointer "f" to "fclose", which dereferences it.
      1509|   	exit_code = 0;
      1510|   out:
      1511|-> 	fclose(f);
      1512|   	return exit_code;
      1513|   }
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    1c8b0a3 View commit details
    Browse the repository at this point in the history
  35. clang: Branch condition evaluates to a garbage value

    criu-3.14/criu/namespaces.c:692:7: warning: Branch condition evaluates to a garbage value
    
    criu-3.14/criu/namespaces.c:690:3: note: 'supported' declared without an initial value
                  protobuf_c_boolean supported;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:691:8: note: Calling 'get_ns_id'
                  id = get_ns_id(pid, &time_for_children_ns_desc, &supported);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:479:9: note: Calling '__get_ns_id'
          return __get_ns_id(pid, nd, supported, NULL);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:454:6: note: Assuming 'proc_dir' is < 0
          if (proc_dir < 0)
              ^~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:454:2: note: Taking true branch
          if (proc_dir < 0)
          ^
    criu-3.14/criu/namespaces.c:455:3: note: Returning without writing to '*supported'
                  return 0;
                  ^
    criu-3.14/criu/namespaces.c:479:9: note: Returning from '__get_ns_id'
          return __get_ns_id(pid, nd, supported, NULL);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:479:2: note: Returning without writing to '*supported'
          return __get_ns_id(pid, nd, supported, NULL);
          ^
    criu-3.14/criu/namespaces.c:691:8: note: Returning from 'get_ns_id'
                  id = get_ns_id(pid, &time_for_children_ns_desc, &supported);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    criu-3.14/criu/namespaces.c:692:7: note: Branch condition evaluates to a garbage value
                  if (!supported || !id) {
                      ^~~~~~~~~~
    690|   		protobuf_c_boolean supported;
    691|   		id = get_ns_id(pid, &time_for_children_ns_desc, &supported);
    692|-> 		if (!supported || !id) {
    693|   			pr_err("Can't make timens id\n");
    694|
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    480ca17 View commit details
    Browse the repository at this point in the history
  36. close_service_fd: rename to status_ready

    The name close_service_fd() is misleading, as it not just closes the
    status_fd, but also writes to it. On a high level, though, it signals
    the other side that we are ready, so rename to status_ready.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    94adcfa View commit details
    Browse the repository at this point in the history
  37. swrk: send notification instead of using status fd

    When we use swrk, we have a mechanism to send notifications over RPC.
    It is cleaner and more straightforward than sending \0 to status fd.
    
    For now, both mechanisms are supported, although status fd request
    option is now deprecated, so a warning is logged in case it's used.
    
    Guess we can remove it in a few years.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    5d8b376 View commit details
    Browse the repository at this point in the history
  38. criu: optimize find_unix_sk_by_ino()

    Fixes: checkpoint-restore#339
    Replaced the linear search with a hashtable lookup.
    
    Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
    ZeyadYasser authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    0d81417 View commit details
    Browse the repository at this point in the history
  39. lib/c: add criu_get_version()

    Although the CRIU version is exported in macros in version.h it only
    contains the CRIU version of libcriu during build time.
    
    As it is possible that CRIU is upgraded since the last time something
    was built against libcriu, this adds functions to query the actual CRIU
    binary about its version.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    ce6e00b View commit details
    Browse the repository at this point in the history
  40. test/others/libcriu: test version library calls

    This adds the previously added libcriu version functions to the libcriu
    tests.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    76db453 View commit details
    Browse the repository at this point in the history
  41. Also report clone3() errors correctly

    Without clone3() CRIU was able to detect a process with a wrong PID only
    in the already created child process. With clone3() this error can
    happen before the process is created.
    
    In the case of EEXIST this error will now be correctly forwarded to an
    RPC client.
    
    This was detected by running test/others/libcriu on a clone3() system.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    a041d81 View commit details
    Browse the repository at this point in the history
  42. Travis: use Vagrant to run VMs

    This adds the minimal configuration to run Fedora 31 based VMs on
    Travis.
    
    This can be used to test cgroupv2 based tests, tests with vdso=off and
    probably much more which requires booting a newer kernel.
    
    As an example this builds CRIU on Fedora 31 and reconfigures it to boot
    without VDSO support and runs one single test.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    2653404 View commit details
    Browse the repository at this point in the history
  43. criu swrk: fix usage, allow common options

    TL;DR: this makes possible -v with criu swrk, and removes showing usage
    which is useless in swrk mode.
    
    1. Since criu swrk command is not described in usage, there is no sense
       in showing it. Instead, show a one-line hint about how to use it.
    
    2. In case some global options (like -v) are used, argv[1] might not
       point to "swrk". Use optind to point to a correct non-option
       argument.
    
    3. While at it, also error out in case we have extra arguments.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    0f8cd38 View commit details
    Browse the repository at this point in the history
  44. arch/x86: Fix calculation of xstate_size

    The layout of xsave frame in a standart format is predefined by the hardware.
    Lets make sure we're increasing in frame offsets and use latest offset where
    appropriate.
    
    checkpoint-restore#1042
    
    Reported-by: Ashutosh Mehra <mehra.ashutosh@ibm.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
    cyrillos authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    6b8cb15 View commit details
    Browse the repository at this point in the history
  45. Add CONTRIBUTING.md

    Move the existing contribution guidelines to a dedicated file for future
    extensions.
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    864b6ea View commit details
    Browse the repository at this point in the history
  46. CONTRIBUTING.md: import "How to submit patches" from criu.org

    Import "How to submit patches" article from CRIU wiki and update its
    format to match GitHub markdown.
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    38aa06a View commit details
    Browse the repository at this point in the history
  47. CONTRIBUTING.md: minor formatting fixes

    * Mark lowcase criu as code in the environment section
    * Add missing brace around the reference to https://criu.org/Secrity
    * Fixup an admolition block that GitHub cannot render
    * Spelling fixups
    * s/github/GitHub/g
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    ec8f742 View commit details
    Browse the repository at this point in the history
  48. CONTRIBUTING.md: add sections about patch description and splitting

    Shamelessly stolen from the Linux kernel [1], shortened a bit and
    relaxed to match CRIU.
    
    [1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    4c9e08c View commit details
    Browse the repository at this point in the history
  49. CONTRIBUTING.md: add pull request guidelines

    Following the discussion at [1] describe best practices for pull request
    creation.
    
    [1] checkpoint-restore#1096
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    aa64cc6 View commit details
    Browse the repository at this point in the history
  50. uffd: uffd_open prints info, caller prints error

    When uffd_open is called from kerndat_uffd, userfaultfd failure is not
    considered an error, so the goal is to suppress the error message --
    instead, we print this message as info.
    
    If the function fails, it is the responsibility of the caller
    to print the error message.
    
    Signed-off-by: Angie Ni <avtni@google.com>
    Angie Ni authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    09e26cc View commit details
    Browse the repository at this point in the history
  51. test: skip vdso test on non-vdso systems

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    c246f27 View commit details
    Browse the repository at this point in the history
  52. Add flog to CRIU

    Change made through this commit:
    - Include copy of flog as a seperate tree.
    - Modify the makefile to add and compile flog code.
    
    Signed-off-by: prakritigoyal19 <prakritigoyal19@gmail.com>
    prakritigoyal19 authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    9069073 View commit details
    Browse the repository at this point in the history
  53. mount: restore_task_mnt_ns - Lookup for mount namespace conditionally

    In case if our parent is a dead task (zombie) we should lookup
    for parent ids which will be inherited on restore. Otherwise
    parent->ids may be nil and SIGSEGV produced.
    
    Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
    
    Rework and port from vzcriu:
    87b320964 ("vz7: mount: restore_task_mnt_ns - Lookup for mount namespace
    conditionally")
    
    Fixes: checkpoint-restore#1066
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Cyrill Gorcunov authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    0f3d578 View commit details
    Browse the repository at this point in the history
  54. cgroup: make prepare_task_cgroup lookup current cgset in ancestors

    In case if our parent is a dead task (zombie) or a helper which in it's
    turn has zombie parent, and parent thus has zero cg_set we should look
    for current cgset deeper.
    
    Fixes: checkpoint-restore#1066
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Snorch authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    45d43fc View commit details
    Browse the repository at this point in the history
  55. zdtm: add zombie_leader test

    Create a session leader and it's child - session member, make leader
    zombie. To restore this criu will need to create a helper task a child
    of our zombie so that member can inherit session. Before fixes in this
    patchset we segfault on empty ids and fail to restore cgroups because of
    empty cg_set
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Snorch authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    d6f93c9 View commit details
    Browse the repository at this point in the history
  56. pidns: add pidns image file definition

    TODO: create correct magic
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    6dbf185 View commit details
    Browse the repository at this point in the history
  57. pidns: write and read pidns information

    This loads and stores the key for an external PID namespace if specified
    by the user using: --external pid[<inode>]:<label>
    
    Preparation for restoring into existing PID namespaces.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    5df2d75 View commit details
    Browse the repository at this point in the history
  58. pidns: support external PID namespaces

    This allows CRIU to restore a process into an existing PID namespace.
    During checkpointing the PID namespace can be marked as external using:
    
       --external pid[<inode>]:<label>
    
    This can be the host PID namespace or any other PID namespace.
    
    During restore a process can be restored into an existing PID namespace
    using:
    
      --inherit-fd fd[<FD>]:<label>
    
    The <label> has to be the same for checkpoint and restore. CRIU uses
    the <label> to know which resource the user means.
    
    A process can start in the host PID namespace and can be moved to
    another namespace or the other way around. Any PID namespace can be
    used.
    
    This is necessary to checkpoint containers in a POD which share certain
    namespaces and this code to support external PID namespaces is the first
    step towards checkpointing and restoring containers which belong to a
    POD.
    
    This is not using the --join-ns functionality as it is not possible to
    move existing process to a PID namespace using setns(). Only child
    process will be created in the PID namespace and that is why setns()
    needs to be called before clone().
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    b7540a9 View commit details
    Browse the repository at this point in the history
  59. pidns: add external pidns to man-page

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    ad7237e View commit details
    Browse the repository at this point in the history
  60. test: test external namespace support

    Adapt netns_ext tests to also work with pid namespaces and move it from
    test/others/netns_ext/ to test/others/ns_ext/.
    
    Also enable ns_ext tests in Travis runs.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    27b13b2 View commit details
    Browse the repository at this point in the history
  61. Add error logging to kerndat init

    CRIU sometimes returns 1 from main() with no explanation.
    These changes add additional logging for initialization errors in kerndat.
    
    Signed-off-by: Angie Ni <avtni@google.com>
    Angie Ni authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    1177e82 View commit details
    Browse the repository at this point in the history
  62. Add error logging to config + crtools init

    CRIU sometimes returns 1 from main() with no explanation.
    Changes made add more logging in the case of
    initialization errors in config and crtools.
    
    Signed-off-by: Angie Ni <avtni@google.com>
    Angie Ni authored and avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    df2610b View commit details
    Browse the repository at this point in the history
  63. test/zdtm/autofs: use sigaction instead of the deprecated siginterrupt

    Reported-by: Mr Travis
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 16, 2020
    Configuration menu
    Copy the full SHA
    958b750 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2020

  1. tests: criu-image-streamer change dev branch to master branch

    Now that the new CRIU to criu-image-streamer protocol is in, we can use
    the master branch of criu-image-streamer.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and avagin committed Jul 17, 2020
    Configuration menu
    Copy the full SHA
    99370dd View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2020

  1. restore: skip unnecessary setgroups calls

    When groups already have desired values, we skip calling setgroups.
    Furthermore, this check allows us to restore when in an
    unprivileged user namespace that cannot use setgroups.
    
    Signed-off-by: Angie Ni <avtni@google.com>
    Angie Ni authored and rppt committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    0d6b8be View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2020

  1. images/regfile.proto: adds additional fields to RegFileEntry

    This adds build-id, checksum, checksum-config and checksum-parameter fields
    to RegFileEntry to store metadata used for file verification.
    
    build_id: Holds the build-id if it could be obtained
    
    checksum: Holds the checksum if it could be obtained
    
    checksum_config: Holds the configuration of bytes for which checksum has
    been calculated (The entire file, first N bytes or every Nth byte)
    
    checksum_parameter: Specifies the value of 'N', if required, for the
    configuration of bytes
    
    Signed-off-by: Ajay Bharadwaj <ajayrbharadwaj@gmail.com>
    AnorexicAtticusFinch authored and avagin committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    770bbae View commit details
    Browse the repository at this point in the history
  2. criu/files-reg.c: add build-id validation functionality

    efi.h: Required for accessing the build-id of .efi files
    
    This adds functions to find, store and compare with the stored build-id.
    get_build_id() calls 32-bit or 64-bit helper functions depending on
    the bitness of the ELF file after first ensuring that it is actually
    an ELF file by checking for the magic number.
    
    The number of iterations while searching the elf file for the
    build-id before giving up (500 while searching the note section)
    are limited.
    
    Signed-off-by: Ajay Bharadwaj <ajayrbharadwaj@gmail.com>
    AnorexicAtticusFinch authored and avagin committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    6d81a70 View commit details
    Browse the repository at this point in the history
  3. criu/config.c: added cli option for build-id

    file_validation_method field added to cr_options structure in
    "criu/include/cr_options.h" along with the constants:
    FILE_VALIDATION_FILE_SIZE
    FILE_VALIDATION_BUILD_ID
    FILE_VALIDATION_DEFAULT (Equal to FILE_VALIDATION_BUILD_ID)
    
    Usage and description information is yet to be added
    
    Usage:
    --file-validation="filesize" (To use only the file size check)
    --file-validation="buildid" (To try and use only the build-id check)
    
    Signed-off-by: Ajay Bharadwaj <ajayrbharadwaj@gmail.com>
    AnorexicAtticusFinch authored and avagin committed Jul 22, 2020
    Configuration menu
    Copy the full SHA
    90bc459 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2020

  1. pidns: fixup

    I pushed the wrong branch to the pidns PR
    
    checkpoint-restore#1056
    
    which resulted in the wrong patches getting merged.
    
    This is the actual result from the review.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Jul 23, 2020
    Configuration menu
    Copy the full SHA
    1c8306d View commit details
    Browse the repository at this point in the history
  2. cgroup: Add the initial support for cgroup2

    This change is very straightforward. We don't skip the cgroup2
    controller and dump it as any other controllers.
    
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 23, 2020
    Configuration menu
    Copy the full SHA
    f82b8a6 View commit details
    Browse the repository at this point in the history
  3. zdtm.py: add the cgroup2 freezer support

    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 23, 2020
    Configuration menu
    Copy the full SHA
    996fdbe View commit details
    Browse the repository at this point in the history
  4. tests: skip cgroup04 and cgroup_ifpriomap on pure cgroup2 systems

    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 23, 2020
    Configuration menu
    Copy the full SHA
    ce67ab3 View commit details
    Browse the repository at this point in the history
  5. zdtm: make cgroup_yard to be aware of cgroup2

    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Jul 23, 2020
    Configuration menu
    Copy the full SHA
    395353f View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2020

  1. compel: add error message for COMMON symbols

    COMMON symbols are emitted for global variable that are not initialized
    in shared libraries.
    They typically end up in the .bss section when linking an executable.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    0bceb02 View commit details
    Browse the repository at this point in the history
  2. compel: pass the parasite_blob_desc to compel_relocs_apply()

    compel_relocs_apply() was taking arguments mostly from the struct
    parasite_blob_desc. Instead of passing all the arguments, we pass a
    pointer to the struct itself.
    
    This makes the code safer, as cr-restore.c calls compel_relocs_apply().
    It previously needed to poke into what can be considered private
    variables of the restorer-pie.h file.
    
    To allow the parasite_blob_desc struct to be populated without a
    parasite_ctl struct, we expand the compel API to export a
    parasite_setup_c_header_desc() in the generated pie.h.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    dd5b9c8 View commit details
    Browse the repository at this point in the history
  3. compel: remove "addr_" from offset variable names

    It removes the potential confusion when it comes to virtual address vs
    offsets. Further, doing so makes naming more consistent with the rest of
    the parasite_blob_desc struct.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    3d2eb41 View commit details
    Browse the repository at this point in the history
  4. compel: stop rounding up the parasite blob size and args region to PA…

    …GE_SIZE
    
    It is unnecessary and potentially confusing for understanding the memory
    layout requirement of the parasite blob.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    67965cb View commit details
    Browse the repository at this point in the history
  5. compel: rewrite parasite cmd and args manipulation from assembly to C

    Previously, __export_parasite_cmd was located in parasite-head.S, and
    __export_parasite_args located exactly at the end of the parasite blob.
    This is not ideal for various reasons:
    1) These two variables work together. It would be preferrable to have
    them in the same location
    2) This prevent us from allocating another section betweeen the parasite
    blob and the args area. We'll need this to allocate a GOT table
    
    This commit changes the allocation of these symbols from assembly/linker
    script to a C file.
    
    Moreover, the assembly entry points that invoke parasite_service()
    prepares arguments with hand crafted assembly. This is unecessary.
    This commit rewrite this logic with regular C code.
    
    Note: if it wasn't for the x86 compat mode, we could remove all
    parasite-head.S files and directly jump to parasite_service() via
    ptrace.  An int3 architecture specific equivalent could be called at the
    end of parasite_service() with an inline asm statement.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    d7353b9 View commit details
    Browse the repository at this point in the history
  6. compel: x86 parasite_service entry point simplification

    We don't need to push 0 on the stack. This seems to be a remnant of the
    initial commit of 2011 that had a `pushq $0`.
    
    The 16 bytes %rsp alignment was added with commit 2a0cea2 in 2012.
    This is no longer necessary as we already guarantee that %rsp is 16
    bytes aligned. A BUG_ON() is added to enforce this guarantee.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    ea263bc View commit details
    Browse the repository at this point in the history
  7. compel: remove x86/prologue.S

    This file has been ignored since commit 19fadee from 2016.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    aa02d0e View commit details
    Browse the repository at this point in the history
  8. compel: allocate the GOT table to avoid memory corruption

    Previously, the GOT table was using the same memory location as the
    args region, leading to difficult to debug memory corruption bugs.
    
    We allocate the GOT table between the parasite blob and the args region.
    The reason this is a good placement is:
    1) Putting it after the args region is possible but a bit combersome as
    the args region has a variable size
    2) The cr-restore.c code maps the parasite code without the args region,
    as it does not do RPC.
    
    Another option is to rely on the linker to generate a GOT section, but I
    failed to do so despite my best attempts.
    
    Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
    nviennot authored and 0x7f454c46 committed Jul 27, 2020
    Configuration menu
    Copy the full SHA
    703f453 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2020

  1. compel/infect: Don't adjust stack/args alignment

    Instead, fail to infect task and let compel cure it.
    
    Signed-off-by: Dmitry Safonov <dima@arista.com>
    0x7f454c46 authored and avagin committed Jul 29, 2020
    Configuration menu
    Copy the full SHA
    b0d9dab View commit details
    Browse the repository at this point in the history
  2. criu/files-reg.c: build-id from multiple headers fix

    This addresses a bug when the ELF file contains multiple PT_NOTE program
    headers but only the first header is checked for the build-id.
    
    Signed-off-by: Ajay Bharadwaj <ajayrbharadwaj@gmail.com>
    AnorexicAtticusFinch authored and avagin committed Jul 29, 2020
    Configuration menu
    Copy the full SHA
    1eeb215 View commit details
    Browse the repository at this point in the history
  3. criu/files-reg.c: build-id size bug fix

    This addresses a bug where the RegFileEntry n_build_id field would be
    populated with incorrect data, causing dump to crash at times.
    
    Signed-off-by: Ajay Bharadwaj <ajayrbharadwaj@gmail.com>
    AnorexicAtticusFinch authored and avagin committed Jul 29, 2020
    Configuration menu
    Copy the full SHA
    3d27343 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. vagrant: Update to Fedora 32

    Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
    rst0git authored and avagin committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    eccd06c View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2020

  1. check: Use pr_foo macros

    Instead of directly calling the print_on_level.
    The pr_msg/pr_warn seems to be better choise for all those cases.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    8d22817 View commit details
    Browse the repository at this point in the history
  2. proc_parse: Do not feed loglevel into restore_loginuid

    If a helper routine doesn't know whether its failure leads
    to the error, then it should just emit a warning and return
    -1. It's the caller who should print (or not) the error.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    9200c10 View commit details
    Browse the repository at this point in the history
  3. ipc: Use pr_info() instead of print_on_level(PR_INFO...)

    All the cases here are naturally and de-facto pr_info-s.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    846452a View commit details
    Browse the repository at this point in the history
  4. util: Use pr_info in vma printing

    Same as previous patch -- all users are coded as pr_info-s
    and are naturally such.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    e7f69d2 View commit details
    Browse the repository at this point in the history
  5. log: Hide vprint_on_level in log.c

    This one is not used outside of log.c.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    17d4697 View commit details
    Browse the repository at this point in the history
  6. log: Ask developers not to use print_on_level directly

    The decision whether a log message is info/warning/error should
    be made by the place in code where it's shown, not by any other
    expression. This makes it pointless to use the print_on_level
    directly, as in each particular place the needed pr_foo() helper
    can be chosen.
    
    However, we cannot (easily) make this function static, so keep
    it in header, but ask people to think twise (or more times) before
    calling it directly.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 4, 2020
    Configuration menu
    Copy the full SHA
    c513730 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2020

  1. lib/c: extend receive to handle incoming FDs

    When using libcriu with the notify callback functionality CRIU transmits
    an FD during 'orphan-pts-master' back to libcriu user. This is message
    is sent via sendmsg() to transmit the FD and not via write() as all
    other protobuf messages.
    
    libcriu was using recv() and to be able to receive the FD this needs to
    be changed to recvmsg() and if an FD is attached to it (currently only
    for 'orphan-pts-master' this FD is stored in a variable which can be
    retrieved with the function criu_get_orphan_pts_master_fd().
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    eeff0e1 View commit details
    Browse the repository at this point in the history
  2. CONTRIBUTING.md: clarify placement of Fixes: tags

    The description of the Fixes: tags could be misleading and may be
    understood as if "Fixes: " should be the commit summary.
    
    Add a sentence with explicit description of Fixme: tags placement.
    
    Reported-by: Otto Bittner <otto-bittner@gmx.de>
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt committed Aug 5, 2020
    Configuration menu
    Copy the full SHA
    1d77961 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2020

  1. Merge pull request checkpoint-restore#1168 from rppt/misc/CONTRIBUTE.md

    CONTRIBUTING.md: clarify placement of Fixes: tags
    rppt committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    487cd0f View commit details
    Browse the repository at this point in the history
  2. python: Handle byte strings when converting protobuf to dict

    Fixes checkpoint-restore#1165
    Traceback (most recent call last):
      File "../criu/crit/crit-python3", line 6, in <module>
        cli.main()
      File "/home/xcv/repos/criu/crit/pycriu/cli.py", line 410, in main
        opts["func"](opts)
      File "/home/xcv/repos/criu/crit/pycriu/cli.py", line 43, in decode
        json.dump(img, f, indent=indent)
      File "/usr/lib/python3.8/json/__init__.py", line 179, in dump
        for chunk in iterable:
      File "/usr/lib/python3.8/json/encoder.py", line 431, in _iterencode
        yield from _iterencode_dict(o, _current_indent_level)
      File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
        yield from chunks
      File "/usr/lib/python3.8/json/encoder.py", line 325, in _iterencode_list
        yield from chunks
      File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
        yield from chunks
      File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
        yield from chunks
      File "/usr/lib/python3.8/json/encoder.py", line 438, in _iterencode
        o = _default(o)
      File "/usr/lib/python3.8/json/encoder.py", line 179, in default
        raise TypeError(f'Object of type {o.__class__.__name__} '
    TypeError: Object of type bytes is not JSON serializable
    
    Co-authored-by: Julian <jb@futureplay.de>
    Signed-off-by: Otto Bittner <otto-bittner@gmx.de>
    2 people authored and avagin committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    5106b23 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2020

  1. Makefiles: do not re-generate magic.py every time

    I always wondered why re-running make on a criu checkout always prints
    out
    
      GEN      magic.py
    
    even if no file has changed. It seems the Makefile was looking for the
    file in the wrong location. Providing the full path to the file will now
    only rebuild magic.py if something actually changed that requires a
    rebuild.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    65a930d View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2020

  1. travis: loop over apt-get to recover from errors

    One of the most common CI errors we see is that package install fails
    due to some hashsum mismatch or some DNS errors.
    
    This adds a loop around each apt-get install call to do a clean, update
    and install and if one of the steps fails it repeats it up to 10 times.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    170f59c View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2020

  1. actions: create file for daily rebuild

    This adds a definition to do a daily rebuild of all cross-compile tests
    on the master and criu-dev branch.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    09ea966 View commit details
    Browse the repository at this point in the history
  2. criu: the type of a socket inode has to be "unsigned int"

    (00.015271) unix: 	Add a peer: ino 2203289876 peer_ino 2203289875 family    1 type    1 state  1 name /mnt/test/zdtm/static/sockets03.test
    (00.015277) Warn  (criu/sk-unix.c:475): unix: Shutdown mismatch -2091677421:1 -> -2091677420:0
    
    Reported-by: Mr Jenkins
    Signed-off-by: Andrei Vagin <avagin@gmail.com>
    avagin committed Aug 11, 2020
    Configuration menu
    Copy the full SHA
    779c36d View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2020

  1. github: disable cross-compule for mips on master branch

    Master branch does not have mips support yet, so automated builds for
    mips on the master branch fail.
    
    Temporarily split mips cross-build into a separate files until mips
    support will be mergded into the master branch.
    
    Suggested-by: Adrian Reber <areber@redhat.com>
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Aug 14, 2020
    Configuration menu
    Copy the full SHA
    dc96b17 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. contrib: Add python-future to Debian packages

    This one contains builtins module from which zdtm.py imports.
    
    Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
    xemul authored and avagin committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    7562f3a View commit details
    Browse the repository at this point in the history
  2. travis: switch travis to Python 3

    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    1acfb4c View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2020

  1. travis: add a focal based test run

    It seems travis supports now Ubuntu 20.04. Let's run at least one test
    also on 20.04 (focal).
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    c6ea085 View commit details
    Browse the repository at this point in the history
  2. images: protobuf definitions for BPF map meta-data and data

    This commit adds protobuf definitions needed to checkpoint and
    restore BPF map files along with the data they contain
    
    Source files added:
    
    * bpfmap-file.proto - Stores the meta-data about BPF maps
    
    * bpfmap-data.proto - Stores the data (key-value pairs) contained
    in BPF maps
    
    Source files modified:
    
    * fdinfo.proto - Added BPF map as a new kind of file descriptor.
    'message file_entry' can now hold information about BPF map file
    descriptors
    
    * Makefile - Now generates build artifacts for bpfmap-file.proto
    and bpfmap-data.proto
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    737caa8 View commit details
    Browse the repository at this point in the history
  3. criu: define constants for c/r of BPF maps

    This commit defines constants and includes necessary headers to c/r
    BPF maps
    
    Source files modified:
    
    * magic.h - Defining BPFMAP_FILE_MAGIC and BPFMAP_DATA_MAGIC
    
    * image-desc.h - Defining CR_FD_BPFMAP_FILE and CR_FD_BPFMAP_DATA
    
    * image-desc.c - Create new entries for bpfmap-file and bpfmap-data
    in CRIU's file descriptor set
    
    * protobuf-desc.h - Defining PB_BPFMAP_FILE and PB_BPFMAP_DATA
    
    * protobuf-desc.c - Including headers for BPF map protobuf images
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    c325572 View commit details
    Browse the repository at this point in the history
  4. Set Makefile config variables for libbpf

    Source files modified:
    
    * Makefile.config - Checks whether libbpf is installed on the system.
    If so, we add -lbpf to LIBS_FEATURES, -DCONFIG_HAS_LIBBPF to
    FEATURE_DEFINES and set CONFIG_HAS_LIBBPF. This allows us to check for
    the presence of libbpf before compiling or executing BPF c/r code and
    ZDTM tests.
    
    * Makefile - Set CONFIG_HAS_LIBBPF to clean all files.
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    4d5fc9f View commit details
    Browse the repository at this point in the history
  5. criu: parse information about BPF maps from procfs

    This commit enables CRIU to:
    (a) identify an anonymous inode as being a BPF map
    (b) parse information about BPF maps from procfs
    
    Source files modified:
    
    * files.c - Checks anonymous inodes to see whether they are BPF maps.
    If so, sets struct fdtype_ops *ops to a structure that knows how to
    dump BPF maps
    
    * proc_parse.c - Function parse_fdinfo_pid_s() now checks whether the
    current file being processed is a BPF map. If so, it calls a newly
    defined function parse_bpfmap() which knows how to parse information
    about BPF maps from procfs
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    adf2da9 View commit details
    Browse the repository at this point in the history
  6. criu: dumping meta-data about BPF map files

    This commit enables CRIU to dump meta-data about BPF maps files by
    prividing the structures and functions needed by other parts of the
    code-base.
    
    Source files added:
    
    * bpfmap.c - defines new structures and functions:
    
        (a) struct fdtype_ops bpfmap_dump_ops:
                sets up the function handler to dump BPF maps
    
        (b) is_bpfmap_link():
                checks whether an anonymous inode is a BPF map file
    
        (c) dump_one_bpfmap():
                parses information for a BPF map file from procfs and
    			dumps it
    
    * include/bpfmap.h - structure and function declarations
    
    Source files modified:
    
    * Makefile.crtools - generates build artifacts for bpfmap.c
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    62941bd View commit details
    Browse the repository at this point in the history
  7. criu: dumping BPF map data

    This commit enables CRIU to dump data(key-value) pairs stored in BPF
    maps
    
    Source files modified:
    
    * bpfmap.c
    
        - Function dump_one_bpfmap_data() reads the map's keys and
        values into two buffers using bpf_map_lookup_batch() and then
        writes them out to a protobuf image along with the number of
        key-value pairs read
    
        - Function dump_one_bpfmap() now dumps the data as well before
        returning
    
    * include/bpfmap.h - Includes headers and declares functions needed to
    dump BPF map data
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    c46225e View commit details
    Browse the repository at this point in the history
  8. crit: add BPF map data decoding

    This commit enables CRIT to decode the contents of a protobuf image
    that stores information related to BPF map
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    f1f1f6a View commit details
    Browse the repository at this point in the history
  9. criu: restoring BPF maps (without data)

    This commit enables CRIU to restore a process' BPF map file
    descriptors.
    
    Source files modified:
    
    * bpfmap.c - Structure and function definitions needed to:
        (a) collect a BPF map's information from its protobuf image
        (b) create and open a BPF map with the same parameters as when
        it was dumped
        (c) add the newly opened BPF map to the process' file descriptor
        list
    
    * include/bpfmap.h - Structure declarations for restoring BPF maps
    
    * files.c - Collects a BPF map's file entry during the restoration
    phase
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    af561db View commit details
    Browse the repository at this point in the history
  10. criu: restoring BPF map data

    This commit restores the data of BPF maps. A hash table (indexed by
    the map's id) is used to store data objects for multiple BPF map
    files that a process may have opened. Collisions are resolved with
    chaining using a linked list.
    
    Source files modified:
    
    * bpfmap.c - Structure and function definitions needed to:
        (a) collect the protobuf image containing BPF map data
        (b) read the BPF map's data from the image and store it in the
        hash table
        (c) restore the map's data using bpf_map_update_batch()
    
    * include/bpfmap.h
        - Defines the size of the hash table and maks to be used while
    	indexing into it
    	- Structure and function declarations that are used while restoring
    	BPF map data
    
    * cr-restore.c - Collects the protobuf image containing BPF map data
    during the restoration phase
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    87ea954 View commit details
    Browse the repository at this point in the history
  11. zdtm: adding tests for BPF maps

    This commit adds ZDTM tests for c/r of processes with BPF maps as open
    files
    
    Source files added:
    
    * zdtm/static/bpf_hash.c - Tests for c/r of the data and meta-data of
    BPF map type BPF_MAP_TYPE_HASH
    
    * zdtm/static/bpf_array.c - Tests for c/r of the data and meta-data
    of BPF map type BPF_MAP_TYPE_ARRAY
    
    Source files modified:
    
    * zdtm/static/Makefile - Generating build artifacts for BPF tests
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    f0f104f View commit details
    Browse the repository at this point in the history
  12. scripts: adding libbpf for Travis tests

    Source files modified:
    
    * travis/vagrant.sh - Adding libbpf-devel
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    d848867 View commit details
    Browse the repository at this point in the history
  13. criu: don't use the deprecated security_context_t (SELinux)

    This change fixes the error:
    error: 'security_context_t' is deprecated
    [-Werror=deprecated-declarations]
    
    Source files modified:
    
    * lsm.c
    * net.c
    
    Please refer to:
    SELinuxProject/selinux@9eb9c9327
    
    Signed-off-by: Abhishek Vijeev <abhishek.vijeev@gmail.com>
    abhishekvijeev authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    7a576bf View commit details
    Browse the repository at this point in the history
  14. travis: restore lazy-pages tests for uns flavor

    Since commit cdd08cd ("uffd: use userns_call() to execute
    ioctl(UFFDIO_API)") UFFD_API ioctl() is wrapped with userns_call() and this
    allows runing lazy-pages tests on recent kernels in uns.
    
    Restore testing of lazy-pages in uns in travis.
    
    Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
    rppt authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    2c5ea59 View commit details
    Browse the repository at this point in the history
  15. travis: use Fedora rawhide images from Fedora

    The docker hub container registry is not updated as fast as Fedora's
    registry at registry.fedoraproject.org. Fedora's registry gets a new
    image whenever there is a new version of rawhide, docker hub's rawhide
    image can take a couple of weeks because the process is not automated.
    
    Especially when Fedora branches of a new release we see lot's of errors
    in CRIU's Fedora rawhide based Travis runs. Switch to Fedora's registry
    to always have the newest rawhide images for our tests.
    
    Signed-off-by: Adrian Reber <areber@redhat.com>
    adrianreber authored and avagin committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    bbd33a4 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2020

  1. sk-unix: add fake queuers only for sockets without peer

    Fake queuers needed for sockets which are connected
    but has closed peer (see zdtm/static/socket_close_data(01)).
    We support this for both STREAM and DRGAM sockets, but
    for DGRAM sockets our check in add_fake_unix_queuers
    isn't correct - we should add fake queuer only and only if
    DGRAM socket has no peer.
    
    This change not fix real visible bug, but remove incorrect and
    unnecessary actions during sockets restore which may follow bug
    in the future.
    
    This code covered by zdtm/static/socket_close_data(01).c testcases.
    
    Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
    mihalicyn committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    95a0c82 View commit details
    Browse the repository at this point in the history