├── .gitignore ├── .mailmap ├── .travis.yml ├── COPYING ├── CREDITS ├── Documentation ├── .gitattributes ├── .gitignore ├── HOWTO.cross-compile ├── Makefile ├── asciidoc.conf ├── crit.txt ├── criu.txt └── custom.xsl ├── INSTALL.md ├── Makefile ├── Makefile.compel ├── Makefile.config ├── Makefile.install ├── Makefile.versions ├── README.md ├── compel ├── .gitignore ├── Makefile ├── arch │ ├── aarch64 │ │ ├── plugins │ │ │ ├── include │ │ │ │ ├── asm │ │ │ │ │ ├── prologue.h │ │ │ │ │ └── syscall-types.h │ │ │ │ └── features.h │ │ │ └── std │ │ │ │ ├── parasite-head.S │ │ │ │ └── syscalls │ │ │ │ ├── Makefile.syscalls │ │ │ │ ├── gen-sys-exec-tbl.pl │ │ │ │ ├── gen-syscalls.pl │ │ │ │ ├── syscall-aux.S │ │ │ │ ├── syscall-aux.h │ │ │ │ ├── syscall-common.S │ │ │ │ └── syscall.def │ │ ├── scripts │ │ │ └── compel-pack.lds.S │ │ └── src │ │ │ └── lib │ │ │ ├── cpu.c │ │ │ ├── handle-elf-host.c │ │ │ ├── handle-elf.c │ │ │ ├── include │ │ │ ├── cpu.h │ │ │ ├── handle-elf.h │ │ │ ├── syscall.h │ │ │ └── uapi │ │ │ │ └── asm │ │ │ │ ├── .gitignore │ │ │ │ ├── breakpoints.h │ │ │ │ ├── cpu.h │ │ │ │ ├── fpu.h │ │ │ │ ├── infect-types.h │ │ │ │ ├── processor-flags.h │ │ │ │ └── sigframe.h │ │ │ └── infect.c │ ├── arm │ │ ├── plugins │ │ │ ├── include │ │ │ │ ├── asm │ │ │ │ │ ├── prologue.h │ │ │ │ │ └── syscall-types.h │ │ │ │ └── features.h │ │ │ └── std │ │ │ │ ├── parasite-head.S │ │ │ │ └── syscalls │ │ │ │ ├── Makefile.syscalls │ │ │ │ ├── gen-sys-exec-tbl.pl │ │ │ │ ├── gen-syscalls.pl │ │ │ │ ├── syscall-aux.S │ │ │ │ ├── syscall-aux.h │ │ │ │ ├── syscall-common.S │ │ │ │ └── syscall.def │ │ ├── scripts │ │ │ └── compel-pack.lds.S │ │ └── src │ │ │ └── lib │ │ │ ├── cpu.c │ │ │ ├── handle-elf-host.c │ │ │ ├── handle-elf.c │ │ │ ├── include │ │ │ ├── cpu.h │ │ │ ├── handle-elf.h │ │ │ ├── syscall.h │ │ │ └── uapi │ │ │ │ └── asm │ │ │ │ ├── .gitignore │ │ │ │ ├── breakpoints.h │ │ │ │ ├── cpu.h │ │ │ │ ├── fpu.h │ │ │ │ ├── infect-types.h │ │ │ │ ├── processor-flags.h │ │ │ │ └── sigframe.h │ │ │ └── infect.c │ ├── ppc64 │ │ ├── plugins │ │ │ ├── include │ │ │ │ ├── asm │ │ │ │ │ ├── prologue.h │ │ │ │ │ └── syscall-types.h │ │ │ │ └── features.h │ │ │ └── std │ │ │ │ ├── memcmp.S │ │ │ │ ├── memcpy.S │ │ │ │ ├── parasite-head.S │ │ │ │ └── syscalls │ │ │ │ ├── Makefile.syscalls │ │ │ │ ├── syscall-common-ppc64.S │ │ │ │ └── syscall-ppc64.tbl │ │ ├── scripts │ │ │ └── compel-pack.lds.S │ │ └── src │ │ │ └── lib │ │ │ ├── cpu.c │ │ │ ├── handle-elf-host.c │ │ │ ├── handle-elf.c │ │ │ ├── include │ │ │ ├── cpu.h │ │ │ ├── handle-elf.h │ │ │ ├── syscall.h │ │ │ └── uapi │ │ │ │ └── asm │ │ │ │ ├── .gitignore │ │ │ │ ├── breakpoints.h │ │ │ │ ├── cpu.h │ │ │ │ ├── fpu.h │ │ │ │ ├── infect-types.h │ │ │ │ ├── processor-flags.h │ │ │ │ ├── processor.h │ │ │ │ └── sigframe.h │ │ │ └── infect.c │ ├── s390 │ │ ├── plugins │ │ │ ├── include │ │ │ │ └── asm │ │ │ │ │ ├── prologue.h │ │ │ │ │ └── syscall-types.h │ │ │ └── std │ │ │ │ ├── parasite-head.S │ │ │ │ └── syscalls │ │ │ │ ├── Makefile.syscalls │ │ │ │ ├── syscall-common-s390.S │ │ │ │ ├── syscall-s390.tbl │ │ │ │ └── syscalls-s390.c │ │ ├── scripts │ │ │ └── compel-pack.lds.S │ │ └── src │ │ │ └── lib │ │ │ ├── cpu.c │ │ │ ├── handle-elf-host.c │ │ │ ├── handle-elf.c │ │ │ ├── include │ │ │ ├── handle-elf.h │ │ │ ├── syscall.h │ │ │ └── uapi │ │ │ │ └── asm │ │ │ │ ├── breakpoints.h │ │ │ │ ├── cpu.h │ │ │ │ ├── fpu.h │ │ │ │ ├── infect-types.h │ │ │ │ └── sigframe.h │ │ │ └── infect.c │ └── x86 │ │ ├── plugins │ │ ├── include │ │ │ ├── asm │ │ │ │ ├── prologue.h │ │ │ │ └── syscall-types.h │ │ │ └── features.h │ │ └── std │ │ │ ├── call32.S │ │ │ ├── memcpy.S │ │ │ ├── parasite-head.S │ │ │ ├── prologue.S │ │ │ └── syscalls │ │ │ ├── Makefile.syscalls │ │ │ ├── syscall-common-x86-32.S │ │ │ ├── syscall-common-x86-64.S │ │ │ ├── syscall32.c │ │ │ ├── syscall_32.tbl │ │ │ └── syscall_64.tbl │ │ ├── scripts │ │ ├── compel-pack-compat.lds.S │ │ └── compel-pack.lds.S │ │ └── src │ │ └── lib │ │ ├── cpu.c │ │ ├── handle-elf-host.c │ │ ├── handle-elf.c │ │ ├── include │ │ ├── cpu.h │ │ ├── handle-elf.h │ │ ├── syscall.h │ │ └── uapi │ │ │ └── asm │ │ │ ├── .gitignore │ │ │ ├── breakpoints.h │ │ │ ├── cpu.h │ │ │ ├── fpu.h │ │ │ ├── infect-types.h │ │ │ ├── processor-flags.h │ │ │ └── sigframe.h │ │ └── infect.c ├── compel-host ├── include │ ├── compel-cpu.h │ ├── elf32-types.h │ ├── elf64-types.h │ ├── errno.h │ ├── infect-priv.h │ ├── log.h │ ├── piegen.h │ ├── ptrace.h │ ├── rpc-pie-priv.h │ ├── shmem.h │ └── uapi │ │ ├── asm │ │ ├── common │ │ ├── compel │ │ ├── compel.h │ │ ├── cpu.h │ │ ├── handle-elf.h │ │ ├── infect-rpc.h │ │ ├── infect-util.h │ │ ├── infect.h │ │ ├── ksigset.h │ │ ├── log.h │ │ ├── loglevels.h │ │ ├── plugins │ │ ├── plugins.h │ │ ├── ptrace.h │ │ ├── sigframe-common.h │ │ └── task-state.h ├── plugins │ ├── Makefile │ ├── fds │ │ └── fds.c │ ├── include │ │ ├── std-priv.h │ │ └── uapi │ │ │ ├── plugin-fds.h │ │ │ ├── shmem.h │ │ │ ├── std.h │ │ │ └── std │ │ │ ├── asm │ │ │ └── .gitignore │ │ │ ├── fds.h │ │ │ ├── infect.h │ │ │ ├── log.h │ │ │ ├── string.h │ │ │ └── syscall-types.h │ ├── shmem │ │ └── shmem.c │ └── std │ │ ├── fds.c │ │ ├── infect.c │ │ ├── log.c │ │ ├── std.c │ │ └── string.c ├── src │ ├── lib │ │ ├── handle-elf-host.c │ │ ├── handle-elf.c │ │ ├── infect-rpc.c │ │ ├── infect-util.c │ │ ├── infect.c │ │ ├── log-host.c │ │ ├── log.c │ │ └── ptrace.c │ ├── main-host.c │ └── main.c └── test │ ├── fdspy │ ├── .gitignore │ ├── Makefile │ ├── parasite.c │ ├── spy.c │ └── victim.c │ ├── infect │ ├── .gitignore │ ├── Makefile │ ├── parasite.c │ ├── spy.c │ └── victim.c │ └── rsys │ ├── .gitignore │ ├── Makefile │ ├── spy.c │ └── victim.c ├── contrib ├── debian │ └── dev-packages.lst └── docker_cr.sh ├── coredump ├── criu-coredump ├── criu_coredump │ ├── .gitignore │ ├── __init__.py │ ├── coredump.py │ └── elf.py └── pycriu ├── crit ├── Makefile ├── crit-python2 ├── crit-python3 └── pycriu ├── criu ├── Makefile ├── Makefile.crtools ├── Makefile.packages ├── action-scripts.c ├── aio.c ├── arch │ ├── aarch64 │ │ ├── Makefile │ │ ├── bitops.S │ │ ├── cpu.c │ │ ├── crtools.c │ │ ├── include │ │ │ └── asm │ │ │ │ ├── dump.h │ │ │ │ ├── int.h │ │ │ │ ├── kerndat.h │ │ │ │ ├── parasite-syscall.h │ │ │ │ ├── parasite.h │ │ │ │ ├── restore.h │ │ │ │ ├── restorer.h │ │ │ │ ├── types.h │ │ │ │ └── vdso.h │ │ ├── intraprocedure.S │ │ ├── restorer.c │ │ ├── sigframe.c │ │ └── vdso-pie.c │ ├── arm │ │ ├── Makefile │ │ ├── bitops.S │ │ ├── cpu.c │ │ ├── crtools.c │ │ ├── include │ │ │ └── asm │ │ │ │ ├── dump.h │ │ │ │ ├── int.h │ │ │ │ ├── kerndat.h │ │ │ │ ├── parasite-syscall.h │ │ │ │ ├── parasite.h │ │ │ │ ├── restore.h │ │ │ │ ├── restorer.h │ │ │ │ └── types.h │ │ ├── restorer.c │ │ ├── sigframe.c │ │ └── uidiv.S │ ├── ppc64 │ │ ├── Makefile │ │ ├── cpu.c │ │ ├── crtools.c │ │ ├── include │ │ │ └── asm │ │ │ │ ├── dump.h │ │ │ │ ├── int.h │ │ │ │ ├── kerndat.h │ │ │ │ ├── parasite-syscall.h │ │ │ │ ├── parasite.h │ │ │ │ ├── restore.h │ │ │ │ ├── restorer.h │ │ │ │ ├── types.h │ │ │ │ └── vdso.h │ │ ├── misc.S │ │ ├── restorer.c │ │ ├── sigframe.c │ │ ├── vdso-pie.c │ │ └── vdso-trampoline.S │ ├── s390 │ │ ├── Makefile │ │ ├── cpu.c │ │ ├── crtools.c │ │ ├── include │ │ │ └── asm │ │ │ │ ├── dump.h │ │ │ │ ├── int.h │ │ │ │ ├── kerndat.h │ │ │ │ ├── parasite-syscall.h │ │ │ │ ├── parasite.h │ │ │ │ ├── restore.h │ │ │ │ ├── restorer.h │ │ │ │ ├── types.h │ │ │ │ └── vdso.h │ │ ├── restorer.c │ │ ├── sigframe.c │ │ └── vdso-pie.c │ └── x86 │ │ ├── Makefile │ │ ├── cpu.c │ │ ├── crtools.c │ │ ├── include │ │ └── asm │ │ │ ├── compat.h │ │ │ ├── dump.h │ │ │ ├── int.h │ │ │ ├── kerndat.h │ │ │ ├── parasite-syscall.h │ │ │ ├── parasite.h │ │ │ ├── restore.h │ │ │ ├── restorer.h │ │ │ ├── syscall32.h │ │ │ ├── types.h │ │ │ └── vdso.h │ │ ├── kerndat.c │ │ ├── restorer.c │ │ ├── restorer_unmap.S │ │ ├── sigaction_compat.c │ │ ├── sigaction_compat_pie.c │ │ ├── sigframe.c │ │ ├── sys-exec-tbl.c │ │ └── vdso-pie.c ├── autofs.c ├── bfd.c ├── bitmap.c ├── cgroup-props.c ├── cgroup.c ├── clone-noasan.c ├── config.c ├── cr-check.c ├── cr-dedup.c ├── cr-dump.c ├── cr-errno.c ├── cr-restore.c ├── cr-service.c ├── crtools.c ├── eventfd.c ├── eventpoll.c ├── external.c ├── fault-injection.c ├── fdstore.c ├── fifo.c ├── file-ids.c ├── file-lock.c ├── files-ext.c ├── files-reg.c ├── files.c ├── filesystems.c ├── fsnotify.c ├── image-desc.c ├── image.c ├── include │ ├── action-scripts.h │ ├── aio.h │ ├── asm-generic │ │ ├── int.h │ │ └── vdso.h │ ├── atomic.h │ ├── autofs.h │ ├── bfd.h │ ├── bitmap.h │ ├── bitops.h │ ├── bitsperlong.h │ ├── cgroup-props.h │ ├── cgroup.h │ ├── clone-noasan.h │ ├── cpu.h │ ├── cr-errno.h │ ├── cr-service-const.h │ ├── cr-service.h │ ├── cr_options.h │ ├── criu-log.h │ ├── criu-plugin.h │ ├── crtools.h │ ├── dump.h │ ├── eventfd.h │ ├── eventpoll.h │ ├── external.h │ ├── fault-injection.h │ ├── fcntl.h │ ├── fdinfo.h │ ├── fdstore.h │ ├── fifo.h │ ├── file-ids.h │ ├── file-lock.h │ ├── files-reg.h │ ├── files.h │ ├── filesystems.h │ ├── fs-magic.h │ ├── fsnotify.h │ ├── image-desc.h │ ├── image.h │ ├── imgset.h │ ├── inet_diag.h │ ├── infect-pie.h │ ├── int.h │ ├── ipc_ns.h │ ├── irmap.h │ ├── kcmp-ids.h │ ├── kcmp.h │ ├── kerndat.h │ ├── libnetlink.h │ ├── linux │ │ └── userfaultfd.h │ ├── log.h │ ├── lsm.h │ ├── magic.h │ ├── mem.h │ ├── mman.h │ ├── mount.h │ ├── namespaces.h │ ├── net.h │ ├── netfilter.h │ ├── netlink_diag.h │ ├── packet_diag.h │ ├── page-pipe.h │ ├── page-xfer.h │ ├── page.h │ ├── pagemap-cache.h │ ├── pagemap.h │ ├── parasite-syscall.h │ ├── parasite-vdso.h │ ├── parasite.h │ ├── path.h │ ├── pid.h │ ├── pipes.h │ ├── plugin.h │ ├── posix-timer.h │ ├── prctl.h │ ├── proc_parse.h │ ├── protobuf-desc.h │ ├── protobuf.h │ ├── pstree.h │ ├── ptrace-compat.h │ ├── rbtree.h │ ├── restore.h │ ├── restorer.h │ ├── rst-malloc.h │ ├── rst_info.h │ ├── seccomp.h │ ├── seize.h │ ├── servicefd.h │ ├── setproctitle.h │ ├── shmem.h │ ├── sigframe.h │ ├── signalfd.h │ ├── sk-inet.h │ ├── sk-packet.h │ ├── sk-queue.h │ ├── sockets.h │ ├── stats.h │ ├── string.h │ ├── sysctl.h │ ├── sysfs_parse.h │ ├── timerfd.h │ ├── tty.h │ ├── tun.h │ ├── types.h │ ├── uffd.h │ ├── unix_diag.h │ ├── util-pie.h │ ├── util-vdso.h │ ├── util.h │ ├── uts_ns.h │ ├── vdso.h │ ├── vma.h │ └── xmalloc.h ├── ipc_ns.c ├── irmap.c ├── kcmp-ids.c ├── kerndat.c ├── libnetlink.c ├── log.c ├── lsm.c ├── mem.c ├── mount.c ├── namespaces.c ├── net.c ├── netfilter.c ├── page-pipe.c ├── page-xfer.c ├── pagemap-cache.c ├── pagemap.c ├── parasite-syscall.c ├── path.c ├── pie-util-vdso-elf32.c ├── pie-util-vdso.c ├── pie-util.c ├── pie │ ├── Makefile │ ├── Makefile.library │ ├── parasite-vdso.c │ ├── parasite.c │ ├── pie-relocs.h │ ├── restorer.c │ ├── util-vdso-elf32.c │ ├── util-vdso.c │ └── util.c ├── pipes.c ├── plugin.c ├── proc_parse.c ├── protobuf-desc.c ├── protobuf.c ├── pstree.c ├── rbtree.c ├── rst-malloc.c ├── seccomp.c ├── seize.c ├── shmem.c ├── sigframe.c ├── signalfd.c ├── sk-inet.c ├── sk-netlink.c ├── sk-packet.c ├── sk-queue.c ├── sk-tcp.c ├── sk-unix.c ├── sockets.c ├── stats.c ├── string.c ├── sysctl.c ├── sysfs_parse.c ├── timerfd.c ├── tty.c ├── tun.c ├── uffd.c ├── util.c ├── uts_ns.c ├── vdso-compat.c └── vdso.c ├── images ├── Makefile ├── autofs.proto ├── binfmt-misc.proto ├── cgroup.proto ├── core-aarch64.proto ├── core-arm.proto ├── core-ppc64.proto ├── core-s390.proto ├── core-x86.proto ├── core.proto ├── cpuinfo.proto ├── creds.proto ├── eventfd.proto ├── eventpoll.proto ├── ext-file.proto ├── fdinfo.proto ├── fh.proto ├── fifo.proto ├── file-lock.proto ├── fown.proto ├── fs.proto ├── fsnotify.proto ├── ghost-file.proto ├── google │ └── protobuf │ │ └── descriptor.proto ├── inventory.proto ├── ipc-desc.proto ├── ipc-msg.proto ├── ipc-sem.proto ├── ipc-shm.proto ├── ipc-var.proto ├── macvlan.proto ├── mm.proto ├── mnt.proto ├── netdev.proto ├── ns.proto ├── opts.proto ├── packet-sock.proto ├── pagemap.proto ├── pipe-data.proto ├── pipe.proto ├── pstree.proto ├── regfile.proto ├── remap-file-path.proto ├── rlimit.proto ├── rpc.proto ├── sa.proto ├── seccomp.proto ├── siginfo.proto ├── signalfd.proto ├── sit.proto ├── sk-inet.proto ├── sk-netlink.proto ├── sk-opts.proto ├── sk-packet.proto ├── sk-unix.proto ├── stats.proto ├── sysctl.proto ├── tcp-stream.proto ├── time.proto ├── timer.proto ├── timerfd.proto ├── tty.proto ├── tun.proto ├── userns.proto ├── utsns.proto └── vma.proto ├── include └── common │ ├── arch │ ├── aarch64 │ │ └── asm │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── bitsperlong.h │ │ │ ├── linkage.h │ │ │ └── page.h │ ├── arm │ │ └── asm │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── bitsperlong.h │ │ │ ├── linkage.h │ │ │ ├── page.h │ │ │ └── processor.h │ ├── ppc64 │ │ └── asm │ │ │ ├── atomic.h │ │ │ ├── bitops.h │ │ │ ├── bitsperlong.h │ │ │ ├── cmpxchg.h │ │ │ ├── linkage.h │ │ │ └── page.h │ ├── s390 │ │ └── asm │ │ │ ├── atomic.h │ │ │ ├── atomic_ops.h │ │ │ ├── bitops.h │ │ │ ├── bitsperlong.h │ │ │ ├── linkage.h │ │ │ └── page.h │ └── x86 │ │ └── asm │ │ ├── atomic.h │ │ ├── bitops.h │ │ ├── bitsperlong.h │ │ ├── cmpxchg.h │ │ ├── linkage.h │ │ └── page.h │ ├── asm-generic │ └── bitops.h │ ├── bitops.h │ ├── bitsperlong.h │ ├── bug.h │ ├── compiler.h │ ├── err.h │ ├── list.h │ ├── lock.h │ ├── page.h │ ├── scm-code.c │ ├── scm.h │ └── xmalloc.h ├── lib ├── Makefile ├── c │ ├── Makefile │ ├── criu.c │ ├── criu.h │ └── criu.pc.in └── py │ ├── .gitignore │ ├── Makefile │ ├── __init__.py │ ├── cli.py │ ├── criu.py │ └── images │ ├── .gitignore │ ├── Makefile │ ├── __init__.py │ ├── images.py │ └── pb2dict.py ├── scripts ├── build │ ├── Dockerfile.aarch64.hdr │ ├── Dockerfile.aarch64.tmpl │ ├── Dockerfile.alpine │ ├── Dockerfile.armv7hf.hdr │ ├── Dockerfile.armv7hf.tmpl │ ├── Dockerfile.centos │ ├── Dockerfile.fedora-asan.hdr │ ├── Dockerfile.fedora-asan.tmpl │ ├── Dockerfile.fedora-rawhide-aarch64.hdr │ ├── Dockerfile.fedora-rawhide-aarch64.tmpl │ ├── Dockerfile.fedora-rawhide.hdr │ ├── Dockerfile.fedora-rawhide.tmpl │ ├── Dockerfile.fedora.tmpl │ ├── Dockerfile.ppc64le.hdr │ ├── Dockerfile.ppc64le.tmpl │ ├── Dockerfile.s390x.hdr │ ├── Dockerfile.s390x.tmpl │ ├── Dockerfile.tmpl │ ├── Dockerfile.x86_64.hdr │ ├── Dockerfile.x86_64.tmpl │ ├── Makefile │ ├── binfmt_misc │ └── extract-deb-pkg ├── crit-setup.py ├── fake-restore.sh ├── feature-tests.mak ├── flake8.cfg ├── install-debian-pkgs.sh ├── magic-gen.py ├── nmk │ ├── .gitignore │ ├── Documentation │ │ ├── Makefile │ │ └── nmk.txt │ ├── Makefile │ ├── README.md │ └── scripts │ │ ├── build.mk │ │ ├── include.mk │ │ ├── macro.mk │ │ ├── main.mk │ │ ├── msg.mk │ │ ├── tools.mk │ │ └── utils.mk ├── protobuf-gen.sh ├── systemd-autofs-restart.sh ├── tmp-files.sh └── travis │ ├── Makefile │ ├── asan.sh │ ├── docker-test.sh │ ├── docker.env │ ├── travis-after_success │ └── travis-tests ├── soccr ├── Makefile ├── soccr.c ├── soccr.h └── test │ ├── Makefile │ ├── local.sh │ ├── run.py │ ├── tcp-conn-v6.c │ ├── tcp-conn.c │ ├── tcp-constructor.c │ └── tcp-test.py └── test ├── .gitignore ├── Makefile ├── abrt.sh ├── check_actions.py ├── compel ├── Makefile ├── arch │ ├── aarch64 │ │ └── include │ │ │ └── arch_test_handle_binary.h │ ├── arm │ │ └── include │ │ │ └── arch_test_handle_binary.h │ ├── ppc64 │ │ └── include │ │ │ └── arch_test_handle_binary.h │ └── x86 │ │ └── include │ │ └── arch_test_handle_binary.h ├── handle_binary.c ├── handle_binary_32.c └── main.c ├── crit-recode.py ├── empty-netns-prep.sh ├── exhaustive ├── pipe.py └── unix.py ├── groups.desc ├── inhfd.desc ├── inhfd ├── fifo.py ├── fifo.py.desc ├── pipe.py ├── pipe.py.desc ├── socket.py ├── socket.py.desc ├── tty.py └── tty.py.desc ├── jenkins ├── _run_ct ├── actions.sh ├── crit.sh ├── criu-btrfs.sh ├── criu-by-id.sh ├── criu-dedup.sh ├── criu-dump.sh ├── criu-fault.sh ├── criu-fcg.sh ├── criu-groups.sh ├── criu-inhfd.sh ├── criu-iter.sh ├── criu-join-ns.sh ├── criu-lazy-common.sh ├── criu-lazy-migration.pipeline ├── criu-lazy-migration.sh ├── criu-lazy-pages.sh ├── criu-lib.sh ├── criu-other.sh ├── criu-overlay.sh ├── criu-pre-dump.sh ├── criu-remote-lazy-pages.sh ├── criu-sibling.sh ├── criu-snap.sh ├── criu-stop.sh ├── criu-user.sh ├── criu.sh └── run_ct ├── others ├── app-emu.sh ├── app-emu │ ├── java │ │ └── HelloWorld │ │ │ ├── HelloWorld.java │ │ │ └── run.sh │ ├── job │ │ ├── Makefile │ │ ├── job.c │ │ ├── job.exp │ │ └── run.sh │ ├── lxc │ │ ├── network-script.sh │ │ └── run.sh │ ├── make │ │ ├── Makefile │ │ ├── run.sh │ │ └── tmpl.c │ ├── screen │ │ └── run.sh │ ├── tarbz │ │ └── run.sh │ └── vnc │ │ ├── run.sh │ │ └── vnc-server.sh ├── bers │ ├── Makefile │ ├── bers.c │ └── bers.txt ├── crit │ ├── .gitignore │ ├── Makefile │ ├── loop.sh │ └── test.sh ├── criu-coredump │ ├── .gitignore │ ├── Makefile │ ├── loop.sh │ └── test.sh ├── env.sh ├── exec │ ├── Makefile │ └── run.sh ├── ext-links │ ├── Makefile │ ├── addmv.sh │ ├── addmv_raw.sh │ ├── mvlink.c │ ├── run.sh │ ├── run_ns.sh │ └── run_wait.sh ├── ext-tty │ └── run.py ├── functions.sh ├── libcriu │ ├── .gitignore │ ├── Makefile │ ├── lib.c │ ├── lib.h │ ├── run.sh │ ├── test_errno.c │ ├── test_iters.c │ ├── test_notify.c │ ├── test_self.c │ └── test_sub.c ├── make │ ├── Makefile │ └── uninstall.sh ├── mem-snap │ ├── Makefile │ ├── run-predump-2.sh │ ├── run-predump.sh │ ├── run-snap-auto-dedup.sh │ ├── run-snap-dedup-on-restore.sh │ ├── run-snap-dedup.sh │ ├── run-snap-maps04.sh │ ├── run-snap.sh │ └── run.sh ├── mnt-ext-dev │ ├── Makefile │ └── run.sh ├── mounts │ ├── ext │ │ ├── Makefile │ │ ├── ext-mount.c │ │ ├── ns_init.c │ │ └── run.sh │ ├── mounts.py │ ├── mounts.sh │ └── run.sh ├── netns_ext │ ├── Makefile │ ├── _run.sh │ └── run.sh ├── overlayfs │ ├── Makefile │ └── run.sh ├── pipes │ ├── Makefile │ └── pipe.c ├── rpc │ ├── .gitignore │ ├── Makefile │ ├── config_file.py │ ├── errno.py │ ├── loop.sh │ ├── ps_test.py │ ├── read.py │ ├── restore-loop.py │ ├── rpc.proto │ ├── run.sh │ ├── test-c.c │ ├── test.py │ └── version.py ├── security │ ├── Makefile │ ├── loop.sh │ └── run.sh ├── shell-job │ ├── Makefile │ └── run.py ├── socketpairs │ ├── Makefile │ └── socketpair.c ├── tcp │ ├── Makefile │ ├── cln.c │ ├── run.sh │ └── srv.c └── unix-callback │ ├── Makefile │ ├── lib │ ├── syslog-lib.so │ └── unix-lib.so │ ├── run.sh │ ├── syslog-lib.c │ ├── unix-client.c │ ├── unix-lib.c │ ├── unix-server.c │ └── unix.proto ├── pycriu ├── show_action.sh ├── umount2.c ├── zdtm.desc ├── zdtm.py ├── zdtm ├── .gitignore ├── Makefile ├── Makefile.inc ├── lib │ ├── Makefile │ ├── arch │ │ ├── aarch64 │ │ │ └── include │ │ │ │ └── asm │ │ │ │ └── atomic.h │ │ ├── arm │ │ │ └── include │ │ │ │ └── asm │ │ │ │ └── atomic.h │ │ ├── ppc64 │ │ │ └── include │ │ │ │ └── asm │ │ │ │ └── atomic.h │ │ ├── s390 │ │ │ └── include │ │ │ │ └── asm │ │ │ │ └── atomic.h │ │ └── x86 │ │ │ └── include │ │ │ └── asm │ │ │ └── atomic.h │ ├── cpuid.h │ ├── datagen.c │ ├── fs.c │ ├── fs.h │ ├── groups.c │ ├── groups.desc │ ├── lock.c │ ├── lock.h │ ├── msg.c │ ├── ns.c │ ├── ns.h │ ├── parseargs.c │ ├── parseargs.sh │ ├── stop_and_chk.sh │ ├── streamutil.c │ ├── tcp.c │ ├── test.c │ └── zdtmtst.h ├── static │ ├── Makefile │ ├── aio00.c │ ├── aio00.desc │ ├── aio01.c │ ├── aio01.desc │ ├── apparmor.c │ ├── apparmor.checkskip │ ├── apparmor.desc │ ├── apparmor.profile │ ├── arm-neon00.c │ ├── arm-neon00.desc │ ├── auto_dev-ioctl.h │ ├── autofs.c │ ├── autofs.desc │ ├── bind-mount.c │ ├── bind-mount.desc │ ├── binfmt_misc.c │ ├── binfmt_misc.desc │ ├── binfmt_misc.hook │ ├── bridge.c │ ├── bridge.desc │ ├── busyloop00.c │ ├── caps00.c │ ├── caps00.desc │ ├── cgroup00.c │ ├── cgroup00.desc │ ├── cgroup00.hook │ ├── cgroup01.c │ ├── cgroup01.desc │ ├── cgroup01.hook │ ├── cgroup02.c │ ├── cgroup02.desc │ ├── cgroup02.hook │ ├── cgroup03.c │ ├── cgroup03.desc │ ├── cgroup03.hook │ ├── cgroup04.c │ ├── cgroup04.desc │ ├── cgroup04.hook │ ├── cgroup_ifpriomap.c │ ├── cgroup_ifpriomap.desc │ ├── cgroup_ifpriomap.hook │ ├── cgroup_stray.c │ ├── cgroup_stray.desc │ ├── cgroupns.c │ ├── cgroupns.desc │ ├── child_opened_proc.c │ ├── chroot-file.c │ ├── chroot-file.desc │ ├── chroot.c │ ├── chroot.desc │ ├── clean_mntns.c │ ├── clean_mntns.desc │ ├── clone_fs.c │ ├── cmdlinenv00.c │ ├── cmdlinenv00.desc │ ├── config_inotify_irmap.c │ ├── config_inotify_irmap.desc │ ├── conntracks │ ├── conntracks.desc │ ├── console.c │ ├── console.desc │ ├── cow00.c │ ├── cow00.desc │ ├── cow01.c │ ├── cow01.desc │ ├── cr_veth.c │ ├── cr_veth.checkskip │ ├── cr_veth.desc │ ├── cr_veth.hook │ ├── criu-rtc.c │ ├── criu-rtc.proto │ ├── cwd00.c │ ├── cwd01.c │ ├── cwd02.c │ ├── del_standalone_un.c │ ├── del_standalone_un.desc │ ├── deleted_dev.c │ ├── deleted_dev.desc │ ├── deleted_unix_sock.c │ ├── different_creds.c │ ├── different_creds.desc │ ├── dumpable01.c │ ├── dumpable02.c │ ├── dumpable02.desc │ ├── env00.c │ ├── epoll.c │ ├── epoll.desc │ ├── eventfs00.c │ ├── fanotify00.c │ ├── fanotify00.desc │ ├── fd.c │ ├── fd01.c │ ├── fd01.desc │ ├── fdt_shared.c │ ├── fifo-ghost.c │ ├── fifo-rowo-pair.c │ ├── fifo.c │ ├── fifo_ro.c │ ├── fifo_wronly.c │ ├── file_append.c │ ├── file_attr.c │ ├── file_fown.c │ ├── file_fown.desc │ ├── file_lease00.c │ ├── file_lease00.desc │ ├── file_lease01.c │ ├── file_lease01.desc │ ├── file_lease02.c │ ├── file_lease02.desc │ ├── file_lease03.c │ ├── file_lease03.desc │ ├── file_lease04.c │ ├── file_lease04.desc │ ├── file_locks00.c │ ├── file_locks00.desc │ ├── file_locks01.c │ ├── file_locks01.desc │ ├── file_locks02.c │ ├── file_locks02.desc │ ├── file_locks03.c │ ├── file_locks03.desc │ ├── file_locks04.c │ ├── file_locks04.desc │ ├── file_locks05.c │ ├── file_locks05.desc │ ├── file_locks06.c │ ├── file_locks06.checkskip │ ├── file_locks06.desc │ ├── file_locks07.c │ ├── file_locks07.checkskip │ ├── file_locks07.desc │ ├── file_locks08.c │ ├── file_locks08.checkskip │ ├── file_locks08.desc │ ├── file_shared.c │ ├── fpu00.c │ ├── fpu00.desc │ ├── fpu01.c │ ├── fpu01.desc │ ├── fpu02.c │ ├── fpu02.desc │ ├── futex-rl.c │ ├── futex.c │ ├── get_smaps_bits.c │ ├── get_smaps_bits.h │ ├── ghost_holes00.c │ ├── ghost_holes01.c │ ├── ghost_holes02.c │ ├── groups.c │ ├── groups.desc │ ├── grow_map.c │ ├── grow_map.desc │ ├── grow_map02.c │ ├── grow_map02.desc │ ├── grow_map03.c │ ├── grow_map03.desc │ ├── helper_zombie_child.c │ ├── helper_zombie_child.desc │ ├── inotify00.c │ ├── inotify00.desc │ ├── inotify01.c │ ├── inotify01.desc │ ├── inotify02.c │ ├── inotify02.desc │ ├── inotify_irmap.c │ ├── inotify_irmap.desc │ ├── inotify_irmap.hook │ ├── inotify_system.c │ ├── inotify_system.desc │ ├── inotify_system_nodel.c │ ├── inotify_system_nodel.desc │ ├── ipc_namespace.c │ ├── ipc_namespace.desc │ ├── jobctl00.c │ ├── lib │ │ └── criu-rtc.so │ ├── link10.c │ ├── loginuid.c │ ├── loginuid.desc │ ├── macvlan.c │ ├── macvlan.desc │ ├── macvlan.hook │ ├── maps00.c │ ├── maps01.c │ ├── maps01.desc │ ├── maps02.c │ ├── maps03.c │ ├── maps03.desc │ ├── maps04.c │ ├── maps04.desc │ ├── maps05.c │ ├── maps06.c │ ├── maps_file_prot.c │ ├── mem-touch.c │ ├── mem-touch.desc │ ├── mlock_setuid.c │ ├── mlock_setuid.desc │ ├── mmx00.c │ ├── mmx00.desc │ ├── mnt_enablefs.c │ ├── mnt_enablefs.checkskip │ ├── mnt_enablefs.desc │ ├── mnt_ext_auto.c │ ├── mnt_ext_auto.desc │ ├── mnt_ext_dev.c │ ├── mnt_ext_dev.desc │ ├── mnt_ext_manual.c │ ├── mnt_ext_manual.desc │ ├── mnt_ext_master.c │ ├── mnt_ext_master.desc │ ├── mnt_ro_bind.c │ ├── mnt_ro_bind.desc │ ├── mnt_tracefs.c │ ├── mnt_tracefs.checkskip │ ├── mnt_tracefs.desc │ ├── mnt_tracefs.hook │ ├── mntns-deleted-dst │ ├── mntns_deleted.c │ ├── mntns_deleted.desc │ ├── mntns_ghost.c │ ├── mntns_ghost.desc │ ├── mntns_ghost01.c │ ├── mntns_ghost01.desc │ ├── mntns_link_ghost.c │ ├── mntns_link_ghost.desc │ ├── mntns_link_remap.c │ ├── mntns_link_remap.desc │ ├── mntns_open.c │ ├── mntns_open.desc │ ├── mntns_overmount.c │ ├── mntns_overmount.desc │ ├── mntns_remap.c │ ├── mntns_remap.desc │ ├── mntns_ro_root.c │ ├── mntns_ro_root.desc │ ├── mntns_root_bind.c │ ├── mntns_root_bind.desc │ ├── mntns_root_bind02.c │ ├── mntns_root_bind02.desc │ ├── mntns_rw_ro_rw.c │ ├── mntns_rw_ro_rw.desc │ ├── mntns_shared_bind.c │ ├── mntns_shared_bind.desc │ ├── mntns_shared_bind02.c │ ├── mntns_shared_bind02.desc │ ├── mntns_shared_bind03.c │ ├── mntns_shared_bind03.desc │ ├── mntns_shared_vs_private.c │ ├── mntns_shared_vs_private.desc │ ├── mount_paths.c │ ├── mount_paths.desc │ ├── mountpoints.c │ ├── mountpoints.desc │ ├── mprotect00.c │ ├── msgque.c │ ├── msgque.desc │ ├── mtime_mmap.c │ ├── netns-dev.c │ ├── netns-dev.desc │ ├── netns-nf.c │ ├── netns-nf.desc │ ├── netns.c │ ├── netns.desc │ ├── netns_sub.c │ ├── netns_sub.desc │ ├── netns_sub_veth.c │ ├── netns_sub_veth.desc │ ├── non_uniform_share_propagation.c │ ├── non_uniform_share_propagation.desc │ ├── ofd_file_locks.c │ ├── ofd_file_locks.h │ ├── oom_score_adj.c │ ├── overmount_dev.c │ ├── overmount_dev.desc │ ├── overmount_fifo.c │ ├── overmount_fifo.desc │ ├── overmount_file.c │ ├── overmount_file.desc │ ├── overmount_sock.c │ ├── overmount_sock.desc │ ├── overmount_with_shared_parent.c │ ├── overmount_with_shared_parent.desc │ ├── packet_sock.c │ ├── packet_sock.desc │ ├── packet_sock_mmap.c │ ├── packet_sock_mmap.desc │ ├── packet_sock_spkt.c │ ├── packet_sock_spkt.desc │ ├── pdeath_sig.c │ ├── pid00.c │ ├── pid00.desc │ ├── pipe00.c │ ├── pipe01.c │ ├── pipe02.c │ ├── pipe03.c │ ├── poll.c │ ├── poll.desc │ ├── posix_timers.c │ ├── private_bind_propagation.c │ ├── private_bind_propagation.desc │ ├── proc-self.c │ ├── pstree.c │ ├── pthread00.c │ ├── pthread01.c │ ├── pthread02.c │ ├── pthread02.desc │ ├── ptrace_sig.c │ ├── ptrace_sig.desc │ ├── pty-console.c │ ├── pty-console.desc │ ├── pty00.c │ ├── pty01.c │ ├── pty01.desc │ ├── pty02.c │ ├── pty03.c │ ├── pty03.desc │ ├── pty04.c │ ├── remap_dead_pid.c │ ├── remap_dead_pid.desc │ ├── remap_dead_pid_root.c │ ├── remap_dead_pid_root.desc │ ├── rlimits00.c │ ├── rmdir_open.c │ ├── route_rules │ ├── rtc.c │ ├── rtc.desc │ ├── s390x_gs_threads.c │ ├── s390x_mmap_high.c │ ├── s390x_mmap_high.desc │ ├── s390x_regs_check.c │ ├── s390x_regs_check.desc │ ├── s390x_runtime_instr.c │ ├── sched_policy00.c │ ├── sched_policy00.desc │ ├── sched_prio00.c │ ├── sched_prio00.desc │ ├── scm00.c │ ├── scm01.c │ ├── scm02.c │ ├── scm03.c │ ├── scm04.c │ ├── scm05.c │ ├── scm06.c │ ├── scm06.desc │ ├── seccomp_filter.c │ ├── seccomp_filter.desc │ ├── seccomp_filter_inheritance.c │ ├── seccomp_filter_inheritance.desc │ ├── seccomp_filter_threads.c │ ├── seccomp_filter_threads.desc │ ├── seccomp_filter_tsync.c │ ├── seccomp_filter_tsync.desc │ ├── seccomp_strict.c │ ├── seccomp_strict.desc │ ├── selfexe00.c │ ├── sem.c │ ├── sem.desc │ ├── session00.c │ ├── session00.desc │ ├── session01.c │ ├── session01.desc │ ├── session02.c │ ├── session02.desc │ ├── session03.c │ ├── session03.desc │ ├── shared_mount_propagation.c │ ├── shared_mount_propagation.desc │ ├── shared_slave_mount_children.c │ ├── shared_slave_mount_children.desc │ ├── shm-mp.c │ ├── shm-mp.desc │ ├── shm-unaligned.c │ ├── shm-unaligned.desc │ ├── shm.c │ ├── shm.desc │ ├── sigaltstack.c │ ├── signalfd00.c │ ├── sigpending.c │ ├── sit.c │ ├── sit.desc │ ├── sk-freebind-false.c │ ├── sk-freebind.c │ ├── sk-netlink.c │ ├── sk-netlink.desc │ ├── sk-unix-mntns.c │ ├── sk-unix-mntns.desc │ ├── sk-unix-rel.c │ ├── sk-unix-unconn.c │ ├── sk-unix01.c │ ├── sk-unix01.desc │ ├── skip-me.c │ ├── sleeping00.c │ ├── sock_filter.c │ ├── sock_opts00.c │ ├── sock_opts00.desc │ ├── sock_opts01.c │ ├── sock_opts01.desc │ ├── sock_peercred.c │ ├── sock_peercred.desc │ ├── socket-ext.c │ ├── socket-ext.desc │ ├── socket-tcp-close-wait.c │ ├── socket-tcp-close-wait.desc │ ├── socket-tcp-close-wait.hook │ ├── socket-tcp-close0.c │ ├── socket-tcp-close0.desc │ ├── socket-tcp-close1.c │ ├── socket-tcp-close1.desc │ ├── socket-tcp-closed-last-ack.c │ ├── socket-tcp-closed-last-ack.desc │ ├── socket-tcp-closed-last-ack.hook │ ├── socket-tcp-closed.c │ ├── socket-tcp-closed.desc │ ├── socket-tcp-closed.hook │ ├── socket-tcp-closing.c │ ├── socket-tcp-closing.desc │ ├── socket-tcp-closing.hook │ ├── socket-tcp-fin-wait1.c │ ├── socket-tcp-fin-wait1.desc │ ├── socket-tcp-fin-wait1.hook │ ├── socket-tcp-fin-wait2.c │ ├── socket-tcp-fin-wait2.desc │ ├── socket-tcp-fin-wait2.hook │ ├── socket-tcp-last-ack.c │ ├── socket-tcp-last-ack.desc │ ├── socket-tcp-last-ack.hook │ ├── socket-tcp-local.c │ ├── socket-tcp-local.desc │ ├── socket-tcp-local.hook │ ├── socket-tcp-nfconntrack.c │ ├── socket-tcp-nfconntrack.desc │ ├── socket-tcp-reseted.c │ ├── socket-tcp-reseted.desc │ ├── socket-tcp-reseted.hook │ ├── socket-tcp-reuseport.c │ ├── socket-tcp-reuseport.desc │ ├── socket-tcp-syn-sent.c │ ├── socket-tcp-syn-sent.desc │ ├── socket-tcp-syn-sent.hook │ ├── socket-tcp-unconn.c │ ├── socket-tcp-unconn.desc │ ├── socket-tcp.c │ ├── socket-tcp.desc │ ├── socket-tcp4v6-close-wait.c │ ├── socket-tcp4v6-close-wait.desc │ ├── socket-tcp4v6-closed.c │ ├── socket-tcp4v6-closed.desc │ ├── socket-tcp4v6-closing.c │ ├── socket-tcp4v6-closing.desc │ ├── socket-tcp4v6-fin-wait1.c │ ├── socket-tcp4v6-fin-wait1.desc │ ├── socket-tcp4v6-fin-wait2.c │ ├── socket-tcp4v6-fin-wait2.desc │ ├── socket-tcp4v6-last-ack.c │ ├── socket-tcp4v6-last-ack.desc │ ├── socket-tcp4v6-local.c │ ├── socket-tcp4v6-local.desc │ ├── socket-tcp4v6.c │ ├── socket-tcp4v6.desc │ ├── socket-tcp6-close-wait.c │ ├── socket-tcp6-close-wait.desc │ ├── socket-tcp6-closed.c │ ├── socket-tcp6-closed.desc │ ├── socket-tcp6-closing.c │ ├── socket-tcp6-closing.desc │ ├── socket-tcp6-closing.hook │ ├── socket-tcp6-fin-wait1.c │ ├── socket-tcp6-fin-wait1.desc │ ├── socket-tcp6-fin-wait2.c │ ├── socket-tcp6-fin-wait2.desc │ ├── socket-tcp6-last-ack.c │ ├── socket-tcp6-last-ack.desc │ ├── socket-tcp6-local.c │ ├── socket-tcp6-local.desc │ ├── socket-tcp6-unconn.c │ ├── socket-tcp6-unconn.desc │ ├── socket-tcp6.c │ ├── socket-tcp6.desc │ ├── socket-tcpbuf-local.c │ ├── socket-tcpbuf-local.desc │ ├── socket-tcpbuf.c │ ├── socket-tcpbuf.desc │ ├── socket-tcpbuf6-local.c │ ├── socket-tcpbuf6-local.desc │ ├── socket-tcpbuf6.c │ ├── socket-tcpbuf6.desc │ ├── socket6_udp.c │ ├── socket_aio.c │ ├── socket_aio.desc │ ├── socket_close_data.c │ ├── socket_close_data01.c │ ├── socket_dgram_data.c │ ├── socket_listen.c │ ├── socket_listen4v6.c │ ├── socket_listen6.c │ ├── socket_queues.c │ ├── socket_snd_addr.c │ ├── socket_snd_addr.desc │ ├── socket_udp-corked.c │ ├── socket_udp-corked.desc │ ├── socket_udp.c │ ├── socket_udp_shutdown.c │ ├── socket_udplite.c │ ├── sockets00.c │ ├── sockets00.desc │ ├── sockets01.c │ ├── sockets02.c │ ├── sockets03.c │ ├── sockets03.desc │ ├── sockets_dgram.c │ ├── sockets_spair.c │ ├── sse00.c │ ├── sse00.desc │ ├── sse20.c │ ├── sse20.desc │ ├── stopped.c │ ├── stopped01.c │ ├── stopped02.c │ ├── stopped12.c │ ├── tempfs.c │ ├── tempfs.desc │ ├── tempfs_overmounted.c │ ├── tempfs_overmounted.desc │ ├── tempfs_overmounted01.c │ ├── tempfs_overmounted01.desc │ ├── tempfs_ro.c │ ├── tempfs_ro.desc │ ├── tempfs_ro02.c │ ├── tempfs_ro02.desc │ ├── tempfs_subns.c │ ├── tempfs_subns.desc │ ├── thread_different_uid_gid.c │ ├── thread_different_uid_gid.desc │ ├── timerfd.c │ ├── timerfd.desc │ ├── timers.c │ ├── tty00.c │ ├── tty02.c │ ├── tty03.c │ ├── tun.c │ ├── tun.desc │ ├── tun_ns.c │ ├── tun_ns.desc │ ├── uffd-events.c │ ├── umask00.c │ ├── unbound_sock.c │ ├── unhashed_proc.c │ ├── unhashed_proc.desc │ ├── unlink_fifo.c │ ├── unlink_fifo_wronly.c │ ├── unlink_fstat00.c │ ├── unlink_fstat00.hook │ ├── unlink_fstat01+.c │ ├── unlink_fstat01.c │ ├── unlink_fstat02.c │ ├── unlink_fstat03.c │ ├── unlink_fstat03.desc │ ├── unlink_fstat04.c │ ├── unlink_fstat04.desc │ ├── unlink_fstat041.c │ ├── unlink_largefile.c │ ├── unlink_largefile.desc │ ├── unlink_mmap00.c │ ├── unlink_mmap00.desc │ ├── unlink_mmap01.c │ ├── unlink_mmap01.desc │ ├── unlink_mmap02.c │ ├── unlink_mmap02.desc │ ├── unlink_multiple_largefiles.c │ ├── unlink_multiple_largefiles.desc │ ├── unlink_regular00.c │ ├── unlink_regular00.desc │ ├── unsupported_children_collision.c │ ├── unsupported_children_collision.desc │ ├── uptime_grow.c │ ├── uptime_grow.desc │ ├── utsname.c │ ├── utsname.desc │ ├── vdso-proxy.c │ ├── vdso00.c │ ├── vdso01.c │ ├── vdso01.desc │ ├── vdso02.c │ ├── vfork00.c │ ├── vfork00.desc │ ├── vsx.c │ ├── vsx.desc │ ├── vt.c │ ├── vt.desc │ ├── wait00.c │ ├── write_read00.c │ ├── write_read01.c │ ├── write_read02.c │ ├── write_read10.c │ ├── xids00.c │ ├── zombie00.c │ ├── zombie01.c │ └── zombie01.desc └── transition │ ├── Makefile │ ├── epoll.c │ ├── fifo_dyn.c │ ├── fifo_dyn.desc │ ├── fifo_loop.c │ ├── file_aio.c │ ├── file_read.c │ ├── fork.c │ ├── fork2.c │ ├── ipc.c │ ├── ipc.desc │ ├── lazy-thp.c │ ├── maps007.c │ ├── maps007.desc │ ├── maps008.c │ ├── maps008.desc │ ├── netlink00.c │ ├── netlink00.desc │ ├── pid_reuse.c │ ├── pid_reuse.desc │ ├── pipe_loop00.c │ ├── pipe_shared00.c │ ├── ptrace.c │ ├── ptrace.desc │ ├── shmem.c │ ├── socket-tcp.c │ ├── socket-tcp.desc │ ├── socket-tcp6.c │ ├── socket-tcp6.desc │ ├── socket_loop00.c │ ├── thread-bomb.c │ ├── thread-bomb.desc │ └── unix_sock.c ├── zdtm_ct.c ├── zdtm_mount_cgroups └── zdtm_umount_cgroups /.mailmap: -------------------------------------------------------------------------------- 1 | Stanislav Kinsbursky 2 | Pavel Emelyanov 3 | Andrey Vagin 4 | Andrey Vagin 5 | Andrey Vagin Andrew Vagin 6 | Cyrill Gorcunov 7 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | The following people provided invaluable help to CRIU project 2 | (in alphabetical order) 3 | ------------------------------------------------------------------- 4 | 5 | Andrew Morton 6 | David Miller 7 | Eric Dumazet 8 | Eric W. Biederman 9 | H. Peter Anvin 10 | Kees Cook 11 | KOSAKI Motohiro 12 | Li Yu 13 | Linus Torvalds 14 | Oleg Nesterov 15 | Serge Hallyn 16 | Tejun Heo 17 | -------------------------------------------------------------------------------- /Documentation/.gitattributes: -------------------------------------------------------------------------------- 1 | *.txt whitespace 2 | -------------------------------------------------------------------------------- /Documentation/.gitignore: -------------------------------------------------------------------------------- 1 | *.xml 2 | *.html 3 | *.[1-8] 4 | *.pdf 5 | *.ps 6 | footer.txt 7 | -------------------------------------------------------------------------------- /Documentation/asciidoc.conf: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Documentation/custom.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 1 6 | 1 7 | 8 | 9 | -------------------------------------------------------------------------------- /compel/.gitignore: -------------------------------------------------------------------------------- 1 | arch/x86/plugins/std/sys-exec-tbl-64.c 2 | arch/x86/plugins/std/syscalls-64.S 3 | arch/arm/plugins/std/syscalls/syscalls.S 4 | arch/aarch64/plugins/std/syscalls/syscalls.S 5 | arch/s390/plugins/std/syscalls/syscalls.S 6 | arch/ppc64/plugins/std/syscalls/syscalls.S 7 | include/version.h 8 | plugins/include/uapi/std/asm/syscall-types.h 9 | plugins/include/uapi/std/syscall-64.h 10 | plugins/include/uapi/std/syscall-codes-64.h 11 | plugins/include/uapi/std/syscall-codes.h 12 | plugins/include/uapi/std/syscall.h 13 | plugins/include/uapi/std/syscall-aux.h 14 | plugins/include/uapi/std/syscall-aux.S 15 | -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/include/asm/prologue.h: -------------------------------------------------------------------------------- 1 | ../../../../../arch/x86/plugins/include/asm/prologue.h -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_ARCH_FEATURES_H 2 | #define __COMPEL_ARCH_FEATURES_H 3 | 4 | #endif /* __COMPEL_ARCH_FEATURES_H */ 5 | -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/Makefile.syscalls: -------------------------------------------------------------------------------- 1 | ../../../../arm/plugins/std/syscalls/Makefile.syscalls -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/gen-sys-exec-tbl.pl: -------------------------------------------------------------------------------- 1 | ../../../../arm/plugins/std/syscalls/gen-sys-exec-tbl.pl -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/gen-syscalls.pl: -------------------------------------------------------------------------------- 1 | ../../../../arm/plugins/std/syscalls/gen-syscalls.pl -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/syscall-aux.h: -------------------------------------------------------------------------------- 1 | #ifndef __NR_openat 2 | # define __NR_openat 56 3 | #endif 4 | -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/syscall-common.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | 3 | syscall_common: 4 | svc #0 5 | ret 6 | 7 | 8 | .macro syscall name, nr 9 | ENTRY(\name) 10 | mov x8, \nr 11 | b syscall_common 12 | END(\name) 13 | .endm 14 | 15 | 16 | ENTRY(__cr_restore_rt) 17 | mov x8, __NR_rt_sigreturn 18 | svc #0 19 | END(__cr_restore_rt) 20 | -------------------------------------------------------------------------------- /compel/arch/aarch64/plugins/std/syscalls/syscall.def: -------------------------------------------------------------------------------- 1 | ../../../../arm/plugins/std/syscalls/syscall.def -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/aarch64/src/lib/include/cpu.h -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/handle-elf.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_HANDLE_ELF_H__ 2 | #define COMPEL_HANDLE_ELF_H__ 3 | 4 | #include "elf64-types.h" 5 | 6 | #define __handle_elf handle_elf_aarch64 7 | #define arch_is_machine_supported(e_machine) (e_machine == EM_AARCH64) 8 | 9 | extern int handle_elf_aarch64(void *mem, size_t size); 10 | 11 | #endif /* COMPEL_HANDLE_ELF_H__ */ 12 | -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_SYSCALL_H__ 2 | #define __COMPEL_SYSCALL_H__ 3 | #define __NR(syscall, compat) __NR_##syscall 4 | #endif 5 | -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/uapi/asm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/aarch64/src/lib/include/uapi/asm/.gitignore -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/uapi/asm/breakpoints.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_BREAKPOINTS_H__ 2 | #define __COMPEL_BREAKPOINTS_H__ 3 | #define ARCH_SI_TRAP TRAP_BRKPT 4 | 5 | static inline int ptrace_set_breakpoint(pid_t pid, void *addr) 6 | { 7 | return 0; 8 | } 9 | 10 | static inline int ptrace_flush_breakpoints(pid_t pid) 11 | { 12 | return 0; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/uapi/asm/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_CPU_H__ 2 | #define UAPI_COMPEL_ASM_CPU_H__ 3 | 4 | typedef struct { } compel_cpuinfo_t; 5 | 6 | #endif /* UAPI_COMPEL_ASM_CPU_H__ */ 7 | -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/uapi/asm/fpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_FPU_H__ 2 | #define __CR_ASM_FPU_H__ 3 | 4 | #endif /* __CR_ASM_FPU_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/aarch64/src/lib/include/uapi/asm/processor-flags.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ 2 | #define UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ 3 | 4 | #endif /* UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/arm/plugins/include/asm/prologue.h: -------------------------------------------------------------------------------- 1 | ../../../../../arch/x86/plugins/include/asm/prologue.h -------------------------------------------------------------------------------- /compel/arch/arm/plugins/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_ARCH_FEATURES_H 2 | #define __COMPEL_ARCH_FEATURES_H 3 | 4 | #endif /* __COMPEL_ARCH_FEATURES_H */ 5 | -------------------------------------------------------------------------------- /compel/arch/arm/plugins/std/syscalls/syscall-aux.S: -------------------------------------------------------------------------------- 1 | nr_sys_mmap: 2 | .long 192 3 | 4 | ENTRY(sys_mmap) 5 | push {r4, r5, r7, lr} 6 | ldr r4, [sp, #16] 7 | ldr r5, [sp, #20] 8 | lsr r5, #12 9 | adr r7, nr_sys_mmap 10 | ldr r7, [r7] 11 | svc 0x00000000 12 | pop {r4, r5, r7, pc} 13 | END(sys_mmap) 14 | -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/cpu.c: -------------------------------------------------------------------------------- 1 | ../../../aarch64/src/lib/cpu.c -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/arm/src/lib/include/cpu.h -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/handle-elf.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_HANDLE_ELF_H__ 2 | #define COMPEL_HANDLE_ELF_H__ 3 | 4 | #include "elf32-types.h" 5 | 6 | #define __handle_elf handle_elf_arm 7 | #define arch_is_machine_supported(e_machine) (e_machine == EM_ARM) 8 | 9 | extern int handle_elf_arm(void *mem, size_t size); 10 | 11 | #endif /* COMPEL_HANDLE_ELF_H__ */ 12 | -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_SYSCALL_H__ 2 | #define __COMPEL_SYSCALL_H__ 3 | #define __NR(syscall, compat) __NR_##syscall 4 | #endif 5 | -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/uapi/asm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/arm/src/lib/include/uapi/asm/.gitignore -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/uapi/asm/breakpoints.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_BREAKPOINTS_H__ 2 | #define __COMPEL_BREAKPOINTS_H__ 3 | #define ARCH_SI_TRAP TRAP_BRKPT 4 | 5 | static inline int ptrace_set_breakpoint(pid_t pid, void *addr) 6 | { 7 | return 0; 8 | } 9 | 10 | static inline int ptrace_flush_breakpoints(pid_t pid) 11 | { 12 | return 0; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/uapi/asm/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_CPU_H__ 2 | #define UAPI_COMPEL_ASM_CPU_H__ 3 | 4 | typedef struct { } compel_cpuinfo_t; 5 | 6 | #endif /* UAPI_COMPEL_ASM_CPU_H__ */ 7 | -------------------------------------------------------------------------------- /compel/arch/arm/src/lib/include/uapi/asm/fpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_FPU_H__ 2 | #define __CR_ASM_FPU_H__ 3 | 4 | #endif /* __CR_ASM_FPU_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/ppc64/plugins/include/asm/prologue.h: -------------------------------------------------------------------------------- 1 | ../../../../../arch/x86/plugins/include/asm/prologue.h -------------------------------------------------------------------------------- /compel/arch/ppc64/plugins/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_ARCH_FEATURES_H 2 | #define __COMPEL_ARCH_FEATURES_H 3 | 4 | #define ARCH_HAS_MEMCPY 5 | #define ARCH_HAS_MEMCMP 6 | 7 | #endif /* __COMPEL_ARCH_FEATURES_H */ 8 | -------------------------------------------------------------------------------- /compel/arch/ppc64/plugins/std/syscalls/syscall-common-ppc64.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | #include /* for __NR_ipc */ 3 | 4 | #define SYSCALL(name, opcode) \ 5 | ENTRY(name); \ 6 | li r0, opcode; \ 7 | b __syscall_common; \ 8 | END(name) 9 | 10 | .text 11 | .align 4 12 | 13 | ENTRY(__syscall_common) 14 | sc 15 | bnslr+ /* if no error return to LR */ 16 | neg r3,r3 /* r3 = -r3 to return -errno value */ 17 | blr 18 | END(__syscall_common) 19 | 20 | ENTRY(__cr_restore_rt) 21 | li r0, __NR_rt_sigreturn 22 | b __syscall_common 23 | END(__cr_restore_rt) 24 | 25 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/cpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/ppc64/src/lib/include/cpu.h -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/handle-elf.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_HANDLE_ELF_H__ 2 | #define COMPEL_HANDLE_ELF_H__ 3 | 4 | #include "elf64-types.h" 5 | 6 | #define ELF_PPC64 7 | 8 | #define __handle_elf handle_elf_ppc64 9 | #define arch_is_machine_supported(e_machine) (e_machine == EM_PPC64) 10 | 11 | extern int handle_elf_ppc64(void *mem, size_t size); 12 | 13 | #endif /* COMPEL_HANDLE_ELF_H__ */ 14 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_SYSCALL_H__ 2 | #define __COMPEL_SYSCALL_H__ 3 | #define __NR(syscall, compat) __NR_##syscall 4 | #endif 5 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/ppc64/src/lib/include/uapi/asm/.gitignore -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/breakpoints.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_BREAKPOINTS_H__ 2 | #define __COMPEL_BREAKPOINTS_H__ 3 | #define ARCH_SI_TRAP TRAP_BRKPT 4 | 5 | static inline int ptrace_set_breakpoint(pid_t pid, void *addr) 6 | { 7 | return 0; 8 | } 9 | 10 | static inline int ptrace_flush_breakpoints(pid_t pid) 11 | { 12 | return 0; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_CPU_H__ 2 | #define UAPI_COMPEL_ASM_CPU_H__ 3 | 4 | #include 5 | 6 | typedef struct { 7 | uint64_t hwcap[2]; 8 | } compel_cpuinfo_t; 9 | 10 | #endif /* UAPI_COMPEL_ASM_CPU_H__ */ 11 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/fpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_FPU_H__ 2 | #define __CR_ASM_FPU_H__ 3 | 4 | #endif /* __CR_ASM_FPU_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/processor-flags.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ 2 | #define UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ 3 | 4 | #endif /* UAPI_COMPEL_ASM_PROCESSOR_FLAGS_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/ppc64/src/lib/include/uapi/asm/processor.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_PROCESSOR_H__ 2 | #define UAPI_COMPEL_ASM_PROCESSOR_H__ 3 | 4 | #endif /* UAPI_COMPEL_ASM_PROCESSOR_H__ */ 5 | -------------------------------------------------------------------------------- /compel/arch/s390/plugins/include/asm/prologue.h: -------------------------------------------------------------------------------- 1 | ../../../../../arch/x86/plugins/include/asm/prologue.h -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/include/handle-elf.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_HANDLE_ELF_H__ 2 | #define COMPEL_HANDLE_ELF_H__ 3 | 4 | #include "elf64-types.h" 5 | 6 | #define ELF_S390 7 | 8 | #define __handle_elf handle_elf_s390 9 | #define arch_is_machine_supported(e_machine) (e_machine == EM_S390) 10 | 11 | int handle_elf_s390(void *mem, size_t size); 12 | 13 | #endif /* COMPEL_HANDLE_ELF_H__ */ 14 | -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/include/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_SYSCALL_H__ 2 | #define __COMPEL_SYSCALL_H__ 3 | 4 | unsigned long sys_mmap(void *addr, unsigned long len, unsigned long prot, 5 | unsigned long flags, unsigned long fd, 6 | unsigned long offset); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/include/uapi/asm/breakpoints.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_BREAKPOINTS_H__ 2 | #define __COMPEL_BREAKPOINTS_H__ 3 | #define ARCH_SI_TRAP TRAP_BRKPT 4 | 5 | static inline int ptrace_set_breakpoint(pid_t pid, void *addr) 6 | { 7 | return 0; 8 | } 9 | 10 | static inline int ptrace_flush_breakpoints(pid_t pid) 11 | { 12 | return 0; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/include/uapi/asm/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_ASM_CPU_H__ 2 | #define UAPI_COMPEL_ASM_CPU_H__ 3 | 4 | #include 5 | 6 | typedef struct { 7 | uint64_t hwcap[2]; 8 | } compel_cpuinfo_t; 9 | 10 | #endif /* __CR_ASM_CPU_H__ */ 11 | -------------------------------------------------------------------------------- /compel/arch/s390/src/lib/include/uapi/asm/fpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_FPU_H__ 2 | #define __CR_ASM_FPU_H__ 3 | 4 | #include 5 | #include 6 | 7 | /* 8 | * This one is used in restorer 9 | */ 10 | typedef struct { 11 | bool has_fpu; 12 | } fpu_state_t; 13 | 14 | #endif /* __CR_ASM_FPU_H__ */ 15 | -------------------------------------------------------------------------------- /compel/arch/x86/plugins/include/features.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_ARCH_FEATURES_H 2 | #define __COMPEL_ARCH_FEATURES_H 3 | 4 | #define ARCH_HAS_MEMCPY 5 | 6 | #endif /* __COMPEL_ARCH_FEATURES_H */ 7 | -------------------------------------------------------------------------------- /compel/arch/x86/plugins/std/call32.S: -------------------------------------------------------------------------------- 1 | ../../../../../criu/arch/x86/call32.S -------------------------------------------------------------------------------- /compel/arch/x86/plugins/std/syscalls/syscall-common-x86-64.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | 3 | #define SYSCALL(name, opcode) \ 4 | ENTRY(name); \ 5 | movl $opcode, %eax; \ 6 | jmp __syscall_common; \ 7 | END(name) 8 | 9 | .text 10 | .align 4 11 | 12 | ENTRY(__syscall_common) 13 | movq %rcx, %r10 14 | syscall 15 | ret 16 | END(__syscall_common) 17 | 18 | ENTRY(__cr_restore_rt) 19 | movq $__NR_rt_sigreturn, %rax 20 | syscall 21 | END(__cr_restore_rt) 22 | -------------------------------------------------------------------------------- /compel/arch/x86/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/arch/x86/src/lib/include/syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_SYSCALL_H__ 2 | #define __COMPEL_SYSCALL_H__ 3 | #define __NR(syscall, compat) ((compat) ? __NR32_##syscall : __NR_##syscall) 4 | 5 | /* 6 | * For x86_32 __NR_mmap inside the kernel represents old_mmap system 7 | * call, but since we didn't use it yet lets go further and simply 8 | * define own alias for __NR_mmap2 which would allow us to unify code 9 | * between 32 and 64 bits version. 10 | */ 11 | #define __NR32_mmap __NR32_mmap2 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /compel/arch/x86/src/lib/include/uapi/asm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/arch/x86/src/lib/include/uapi/asm/.gitignore -------------------------------------------------------------------------------- /compel/arch/x86/src/lib/include/uapi/asm/breakpoints.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_BREAKPOINTS_H__ 2 | #define __COMPEL_BREAKPOINTS_H__ 3 | #define ARCH_SI_TRAP SI_KERNEL 4 | extern int ptrace_set_breakpoint(pid_t pid, void *addr); 5 | extern int ptrace_flush_breakpoints(pid_t pid); 6 | #endif 7 | -------------------------------------------------------------------------------- /compel/compel-host: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # A wrapper to use compel-host right from the source dir 4 | # (i.e. when it is not yet installed). 5 | 6 | COMPEL_UNINSTALLED_ROOTDIR=$(dirname "$0") 7 | export COMPEL_UNINSTALLED_ROOTDIR 8 | exec "${COMPEL_UNINSTALLED_ROOTDIR}/compel-host-bin" "$@" 9 | -------------------------------------------------------------------------------- /compel/include/compel-cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_CPU_H__ 2 | #define __COMPEL_CPU_H__ 3 | 4 | #include 5 | #include "asm/cpu.h" 6 | 7 | extern void compel_set_cpu_cap(compel_cpuinfo_t *info, unsigned int feature); 8 | extern void compel_clear_cpu_cap(compel_cpuinfo_t *info, unsigned int feature); 9 | extern int compel_test_cpu_cap(compel_cpuinfo_t *info, unsigned int feature); 10 | extern int compel_test_fpu_cap(compel_cpuinfo_t *c, unsigned int feature); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /compel/include/elf32-types.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_ELF32_TYPES_H__ 2 | #define COMPEL_ELF32_TYPES_H__ 3 | 4 | #define Elf_Ehdr Elf32_Ehdr 5 | #define Elf_Shdr Elf32_Shdr 6 | #define Elf_Sym Elf32_Sym 7 | #define Elf_Rel Elf32_Rel 8 | #define Elf_Rela Elf32_Rela 9 | 10 | #define ELF_ST_TYPE ELF32_ST_TYPE 11 | #define ELF_ST_BIND ELF32_ST_BIND 12 | 13 | #define ELF_R_SYM ELF32_R_SYM 14 | #define ELF_R_TYPE ELF32_R_TYPE 15 | 16 | #endif /* COMPEL_ELF32_TYPES_H__ */ 17 | -------------------------------------------------------------------------------- /compel/include/elf64-types.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_ELF64_TYPES_H__ 2 | #define COMPEL_ELF64_TYPES_H__ 3 | 4 | #define Elf_Ehdr Elf64_Ehdr 5 | #define Elf_Shdr Elf64_Shdr 6 | #define Elf_Sym Elf64_Sym 7 | #define Elf_Rel Elf64_Rel 8 | #define Elf_Rela Elf64_Rela 9 | 10 | #define ELF_ST_TYPE ELF64_ST_TYPE 11 | #define ELF_ST_BIND ELF64_ST_BIND 12 | 13 | #define ELF_R_SYM ELF64_R_SYM 14 | #define ELF_R_TYPE ELF64_R_TYPE 15 | 16 | #endif /* COMPEL_ELF64_TYPES_H__ */ 17 | -------------------------------------------------------------------------------- /compel/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_ERRNO_H__ 2 | #define __COMPEL_ERRNO_H__ 3 | 4 | #define ERESTARTSYS 512 5 | #define ERESTARTNOINTR 513 6 | #define ERESTARTNOHAND 514 7 | #define ERESTART_RESTARTBLOCK 516 8 | 9 | #endif /* __CR_ERRNO_H__ */ 10 | -------------------------------------------------------------------------------- /compel/include/ptrace.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_PTRACE_H__ 2 | #define COMPEL_PTRACE_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define PTRACE_SI_EVENT(_si_code) (((_si_code) & 0xFFFF) >> 8) 9 | 10 | extern int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs); 11 | extern int ptrace_set_regs(pid_t pid, user_regs_struct_t *regs); 12 | 13 | #endif /* COMPEL_PTRACE_H__ */ 14 | -------------------------------------------------------------------------------- /compel/include/shmem.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_PLUGIN_SHMEM_PRIV_H__ 2 | #define __COMPEL_PLUGIN_SHMEM_PRIV_H__ 3 | 4 | struct shmem_plugin_msg { 5 | unsigned long start; 6 | unsigned long len; 7 | }; 8 | 9 | #endif /* __COMPEL_PLUGIN_SHMEM_PRIV_H__ */ 10 | 11 | -------------------------------------------------------------------------------- /compel/include/uapi/asm: -------------------------------------------------------------------------------- 1 | ../asm/uapi/asm -------------------------------------------------------------------------------- /compel/include/uapi/common: -------------------------------------------------------------------------------- 1 | ../../../include/common -------------------------------------------------------------------------------- /compel/include/uapi/compel: -------------------------------------------------------------------------------- 1 | . -------------------------------------------------------------------------------- /compel/include/uapi/compel.h: -------------------------------------------------------------------------------- 1 | #ifndef UAPI_COMPEL_H__ 2 | #define UAPI_COMPEL_H__ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif /* UAPI_COMPEL_H__ */ 15 | -------------------------------------------------------------------------------- /compel/include/uapi/handle-elf.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_UAPI_HANDLE_ELF__ 2 | #define __COMPEL_UAPI_HANDLE_ELF__ 3 | 4 | #define COMPEL_TYPE_INT (1u << 0) 5 | #define COMPEL_TYPE_LONG (1u << 1) 6 | #define COMPEL_TYPE_GOTPCREL (1u << 2) 7 | 8 | typedef struct { 9 | unsigned int offset; 10 | unsigned int type; 11 | long addend; 12 | long value; 13 | } compel_reloc_t; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /compel/include/uapi/infect-rpc.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_INFECT_RPC_H__ 2 | #define __COMPEL_INFECT_RPC_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | struct parasite_ctl; 9 | extern int compel_rpc_sync(unsigned int cmd, struct parasite_ctl *ctl); 10 | extern int compel_rpc_call(unsigned int cmd, struct parasite_ctl *ctl); 11 | extern int compel_rpc_call_sync(unsigned int cmd, struct parasite_ctl *ctl); 12 | extern int compel_rpc_sock(struct parasite_ctl *ctl); 13 | 14 | #define PARASITE_USER_CMDS 64 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /compel/include/uapi/infect-util.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_INFECT_UTIL_H__ 2 | #define __COMPEL_INFECT_UTIL_H__ 3 | struct parasite_ctl; 4 | extern int compel_util_send_fd(struct parasite_ctl *ctl, int fd); 5 | extern int compel_util_recv_fd(struct parasite_ctl *ctl, int *pfd); 6 | #endif 7 | -------------------------------------------------------------------------------- /compel/include/uapi/log.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_UAPI_LOG_H__ 2 | #define __COMPEL_UAPI_LOG_H__ 3 | 4 | #include 5 | #include 6 | 7 | typedef void (*compel_log_fn)(unsigned int lvl, const char *fmt, va_list parms); 8 | extern void compel_log_init(compel_log_fn log_fn, unsigned int level); 9 | extern unsigned int compel_log_get_loglevel(void); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /compel/include/uapi/plugins: -------------------------------------------------------------------------------- 1 | ../../plugins/include/uapi -------------------------------------------------------------------------------- /compel/include/uapi/task-state.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_UAPI_TASK_STATE_H__ 2 | #define __COMPEL_UAPI_TASK_STATE_H__ 3 | 4 | /* 5 | * Task state, as returned by compel_wait_task() 6 | * and used in arguments to compel_resume_task(). 7 | */ 8 | enum __compel_task_state 9 | { 10 | COMPEL_TASK_ALIVE = 0x01, 11 | COMPEL_TASK_DEAD = 0x02, 12 | COMPEL_TASK_STOPPED = 0x03, 13 | COMPEL_TASK_ZOMBIE = 0x06, 14 | /* Don't ever change the above values, they are used by CRIU! */ 15 | 16 | COMPEL_TASK_MAX = 0x7f 17 | }; 18 | 19 | #endif /* __COMPEL_UAPI_TASK_STATE_H__ */ 20 | -------------------------------------------------------------------------------- /compel/plugins/fds/fds.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "uapi/plugins.h" 4 | #include "uapi/plugins/std.h" 5 | #include 6 | 7 | #define pr_err(fmt, ...) 8 | 9 | #include "common/compiler.h" 10 | #include "common/bug.h" 11 | 12 | #define __sys(foo) sys_##foo 13 | #define __sys_err(ret) ret 14 | 15 | #include "common/scm.h" 16 | 17 | int fds_send_fd(int fd) 18 | { 19 | return send_fd(parasite_get_rpc_sock(), NULL, 0, fd); 20 | } 21 | 22 | int fds_recv_fd(void) 23 | { 24 | return recv_fd(parasite_get_rpc_sock()); 25 | } 26 | -------------------------------------------------------------------------------- /compel/plugins/include/std-priv.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_PLUGIN_STD_PRIV_H__ 2 | #define __COMPEL_PLUGIN_STD_PRIV_H__ 3 | 4 | extern int std_ctl_sock(void); 5 | 6 | #endif /* __COMPEL_PLUGIN_STD_PRIV_H__ */ 7 | -------------------------------------------------------------------------------- /compel/plugins/include/uapi/plugin-fds.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_PLUGIN_STD_STD_H__ 2 | #define COMPEL_PLUGIN_STD_STD_H__ 3 | 4 | extern int fds_send_fd(int fd); 5 | extern int fds_recv_fd(void); 6 | 7 | #endif /* COMPEL_PLUGIN_STD_STD_H__ */ 8 | -------------------------------------------------------------------------------- /compel/plugins/include/uapi/shmem.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPEL_PLUGIN_SHMEM_H__ 2 | #define __COMPEL_PLUGIN_SHMEM_H__ 3 | 4 | /* 5 | * Creates local shmem mapping and announces it 6 | * to the peer. Peer can later "receive" one. The 7 | * local area should be munmap()-ed at the end. 8 | */ 9 | extern void *shmem_create(unsigned long size); 10 | /* 11 | * "Receives" shmem from peer and maps it. The 12 | * locally mapped area should be munmap()-ed at 13 | * the end 14 | */ 15 | extern void *shmem_receive(unsigned long *size); 16 | 17 | #endif /* __COMPEL_PLUGIN_SHMEM_H__ */ 18 | -------------------------------------------------------------------------------- /compel/plugins/include/uapi/std.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_PLUGIN_STD_STD_H__ 2 | #define COMPEL_PLUGIN_STD_STD_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #endif /* COMPEL_PLUGIN_STD_STD_H__ */ 12 | -------------------------------------------------------------------------------- /compel/plugins/include/uapi/std/asm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/compel/plugins/include/uapi/std/asm/.gitignore -------------------------------------------------------------------------------- /compel/plugins/include/uapi/std/fds.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPEL_PLUGIN_STD_FDS_H__ 2 | #define COMPEL_PLUGIN_STD_FDS_H__ 3 | 4 | #include 5 | #include 6 | 7 | #endif /* COMPEL_PLUGIN_STD_FDS_H__ */ 8 | -------------------------------------------------------------------------------- /compel/plugins/std/fds.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include "std-priv.h" 7 | 8 | #define pr_err(fmt, ...) 9 | 10 | #include "common/compiler.h" 11 | #include "common/bug.h" 12 | 13 | #define __sys(foo) sys_##foo 14 | #define __sys_err(ret) ret 15 | 16 | #include "common/scm-code.c" 17 | -------------------------------------------------------------------------------- /compel/src/lib/handle-elf-host.c: -------------------------------------------------------------------------------- 1 | handle-elf.c -------------------------------------------------------------------------------- /compel/src/lib/log-host.c: -------------------------------------------------------------------------------- 1 | log.c -------------------------------------------------------------------------------- /compel/src/main-host.c: -------------------------------------------------------------------------------- 1 | main.c -------------------------------------------------------------------------------- /compel/test/fdspy/.gitignore: -------------------------------------------------------------------------------- 1 | parasite.h 2 | parasite.po 3 | spy 4 | victim 5 | -------------------------------------------------------------------------------- /compel/test/fdspy/parasite.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | /* 7 | * Stubs for std compel plugin. 8 | */ 9 | int compel_main(void *arg_p, unsigned int arg_s) { return 0; } 10 | int parasite_trap_cmd(int cmd, void *args) { return 0; } 11 | void parasite_cleanup(void) { } 12 | 13 | #define PARASITE_CMD_GETFD PARASITE_USER_CMDS 14 | 15 | int parasite_daemon_cmd(int cmd, void *args) 16 | { 17 | if (cmd == PARASITE_CMD_GETFD) 18 | fds_send_fd(2); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /compel/test/fdspy/victim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i, aux; 6 | 7 | do { 8 | i = read(0, &aux, 1); 9 | } while (i > 0); 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /compel/test/infect/.gitignore: -------------------------------------------------------------------------------- 1 | parasite.h 2 | parasite.po 3 | spy 4 | victim 5 | -------------------------------------------------------------------------------- /compel/test/infect/victim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i; 6 | 7 | while (1) { 8 | if (read(0, &i, sizeof(i)) != sizeof(i)) 9 | break; 10 | 11 | if (write(1, &i, sizeof(i)) != sizeof(i)) 12 | break; 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /compel/test/rsys/.gitignore: -------------------------------------------------------------------------------- 1 | spy 2 | victim 3 | -------------------------------------------------------------------------------- /compel/test/rsys/Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | CFLAGS ?= -O2 -g -Wall -Werror 3 | 4 | COMPEL := ../../../compel/compel-host 5 | 6 | all: victim spy 7 | 8 | clean: 9 | rm -f victim 10 | rm -f spy 11 | 12 | victim: victim.c 13 | $(CC) $(CFLAGS) -o $@ $^ 14 | 15 | spy: spy.c 16 | $(CC) $(CFLAGS) $(shell $(COMPEL) includes) -o $@ $^ $(shell $(COMPEL) --static libs) 17 | -------------------------------------------------------------------------------- /compel/test/rsys/victim.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i; 6 | 7 | while (1) { 8 | if (read(0, &i, sizeof(i)) != sizeof(i)) 9 | break; 10 | 11 | i = getsid(0); 12 | write(1, &i, sizeof(i)); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /contrib/debian/dev-packages.lst: -------------------------------------------------------------------------------- 1 | # Required packages for development in Debian 2 | build-essential 3 | libprotobuf-dev 4 | libprotobuf-c0-dev 5 | protobuf-c-compiler 6 | protobuf-compiler 7 | python-protobuf 8 | libnet-dev 9 | 10 | # Extra packages, required for testing and building other tools 11 | pkg-config 12 | libnl-3-dev 13 | python-ipaddr 14 | libbsd0 15 | libbsd-dev 16 | iproute2 17 | libcap-dev 18 | libaio-dev 19 | python-yaml 20 | libnl-route-3-dev 21 | -------------------------------------------------------------------------------- /coredump/criu_coredump/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /coredump/criu_coredump/__init__.py: -------------------------------------------------------------------------------- 1 | from coredump import * 2 | import elf 3 | -------------------------------------------------------------------------------- /coredump/pycriu: -------------------------------------------------------------------------------- 1 | ../lib/py/ -------------------------------------------------------------------------------- /crit/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all-y += crit 3 | 4 | crit/crit: crit/crit-$(PYTHON) 5 | $(Q) cp $^ $@ 6 | crit: crit/crit 7 | .PHONY: crit 8 | 9 | clean-crit: 10 | $(Q) $(RM) crit/crit 11 | .PHONY: clean-crit 12 | clean: clean-crit 13 | mrproper: clean 14 | -------------------------------------------------------------------------------- /crit/crit-python2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from pycriu import cli 4 | 5 | if __name__ == '__main__': 6 | cli.main() 7 | -------------------------------------------------------------------------------- /crit/crit-python3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from pycriu import cli 4 | 5 | if __name__ == '__main__': 6 | cli.main() 7 | -------------------------------------------------------------------------------- /crit/pycriu: -------------------------------------------------------------------------------- 1 | ../lib/py/ -------------------------------------------------------------------------------- /criu/arch/aarch64/Makefile: -------------------------------------------------------------------------------- 1 | builtin-name := crtools.built-in.o 2 | 3 | ccflags-y += -iquote $(obj)/include -iquote criu/include 4 | ccflags-y += -iquote include 5 | ccflags-y += $(COMPEL_UAPI_INCLUDES) 6 | asflags-y += -D__ASSEMBLY__ 7 | ldflags-y += -r 8 | 9 | obj-y += cpu.o 10 | obj-y += crtools.o 11 | obj-y += sigframe.o 12 | obj-y += bitops.o 13 | -------------------------------------------------------------------------------- /criu/arch/aarch64/bitops.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | 3 | .text 4 | 5 | ENTRY(test_and_set_bit) 6 | and w3, w0, #63 7 | eor w0, w0, w3 8 | mov x2, #1 9 | add x1, x1, x0, lsr #3 10 | lsl x4, x2, x3 11 | 1: ldaxr x2, [x1] 12 | lsr x0, x2, x3 13 | orr x2, x2, x4 14 | stlxr w5, x2, [x1] 15 | cbnz w5, 1b 16 | and x0, x0, #1 17 | 3: ret 18 | END(test_and_set_bit) 19 | -------------------------------------------------------------------------------- /criu/arch/aarch64/include/asm/dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_DUMP_H__ 2 | #define __CR_ASM_DUMP_H__ 3 | 4 | extern int save_task_regs(void *, user_regs_struct_t *, user_fpregs_struct_t *); 5 | extern int arch_alloc_thread_info(CoreEntry *core); 6 | extern void arch_free_thread_info(CoreEntry *core); 7 | 8 | 9 | static inline void core_put_tls(CoreEntry *core, tls_t tls) 10 | { 11 | core->ti_aarch64->tls = tls; 12 | } 13 | 14 | #define get_task_futex_robust_list_compat(pid, info) -1 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /criu/arch/aarch64/include/asm/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_INT_H__ 2 | #define __CR_ASM_INT_H__ 3 | 4 | #include "asm-generic/int.h" 5 | 6 | #endif /* __CR_ASM_INT_H__ */ 7 | -------------------------------------------------------------------------------- /criu/arch/aarch64/include/asm/kerndat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_KERNDAT_H__ 2 | #define __CR_ASM_KERNDAT_H__ 3 | 4 | #define kdat_compatible_cr() 0 5 | #define kdat_can_map_vdso() 0 6 | 7 | #endif /* __CR_ASM_KERNDAT_H__ */ 8 | -------------------------------------------------------------------------------- /criu/arch/aarch64/include/asm/parasite-syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PARASITE_SYSCALL_H__ 2 | #define __CR_ASM_PARASITE_SYSCALL_H__ 3 | 4 | struct parasite_ctl; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /criu/arch/aarch64/include/asm/parasite.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_PARASITE_H__ 2 | #define __ASM_PARASITE_H__ 3 | 4 | static inline void arch_get_tls(tls_t *ptls) 5 | { 6 | tls_t tls; 7 | asm("mrs %0, tpidr_el0" : "=r" (tls)); 8 | *ptls = tls; 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /criu/arch/aarch64/restorer.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "restorer.h" 4 | #include "asm/restorer.h" 5 | 6 | #include 7 | #include "log.h" 8 | #include 9 | #include "cpu.h" 10 | 11 | int restore_nonsigframe_gpregs(UserRegsEntry *r) 12 | { 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /criu/arch/aarch64/sigframe.c: -------------------------------------------------------------------------------- 1 | #include "asm/types.h" 2 | #include 3 | #include "asm/sigframe.h" 4 | 5 | int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe, 6 | struct rt_sigframe *rsigframe) 7 | { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /criu/arch/arm/Makefile: -------------------------------------------------------------------------------- 1 | builtin-name := crtools.built-in.o 2 | 3 | ccflags-y += -iquote $(obj)/include 4 | ccflags-y += -iquote criu/include -iquote include 5 | ccflags-y += $(COMPEL_UAPI_INCLUDES) 6 | 7 | asflags-y += -D__ASSEMBLY__ 8 | ldflags-y += -r -z noexecstack 9 | 10 | obj-y += cpu.o 11 | obj-y += crtools.o 12 | obj-y += sigframe.o 13 | obj-y += bitops.o 14 | -------------------------------------------------------------------------------- /criu/arch/arm/include/asm/dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_DUMP_H__ 2 | #define __CR_ASM_DUMP_H__ 3 | 4 | extern int save_task_regs(void *, user_regs_struct_t *, user_fpregs_struct_t *); 5 | extern int arch_alloc_thread_info(CoreEntry *core); 6 | extern void arch_free_thread_info(CoreEntry *core); 7 | 8 | 9 | static inline void core_put_tls(CoreEntry *core, tls_t tls) 10 | { 11 | core->ti_arm->tls = tls; 12 | } 13 | 14 | #define get_task_futex_robust_list_compat(pid, info) -1 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /criu/arch/arm/include/asm/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_INT_H__ 2 | #define __CR_ASM_INT_H__ 3 | 4 | #include "asm-generic/int.h" 5 | 6 | #endif /* __CR_ASM_INT_H__ */ 7 | -------------------------------------------------------------------------------- /criu/arch/arm/include/asm/kerndat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_KERNDAT_H__ 2 | #define __CR_ASM_KERNDAT_H__ 3 | 4 | #define kdat_compatible_cr() 0 5 | #define kdat_can_map_vdso() 0 6 | 7 | #endif /* __CR_ASM_KERNDAT_H__ */ 8 | -------------------------------------------------------------------------------- /criu/arch/arm/include/asm/parasite-syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PARASITE_SYSCALL_H__ 2 | #define __CR_ASM_PARASITE_SYSCALL_H__ 3 | 4 | struct parasite_ctl; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /criu/arch/arm/include/asm/parasite.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_PARASITE_H__ 2 | #define __ASM_PARASITE_H__ 3 | 4 | static inline void arch_get_tls(tls_t *ptls) 5 | { 6 | *ptls = ((tls_t (*)(void))0xffff0fe0)(); 7 | } 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /criu/arch/arm/sigframe.c: -------------------------------------------------------------------------------- 1 | #include "asm/types.h" 2 | #include 3 | #include "asm/sigframe.h" 4 | 5 | int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe, 6 | struct rt_sigframe *rsigframe) 7 | { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /criu/arch/ppc64/Makefile: -------------------------------------------------------------------------------- 1 | builtin-name := crtools.built-in.o 2 | 3 | ccflags-y += -iquote $(obj)/include 4 | ccflags-y += -iquote criu/include -iquote include 5 | ccflags-y += $(COMPEL_UAPI_INCLUDES) 6 | ldflags-y += -r 7 | 8 | obj-y += cpu.o 9 | obj-y += crtools.o 10 | obj-y += sigframe.o 11 | -------------------------------------------------------------------------------- /criu/arch/ppc64/include/asm/dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_DUMP_H__ 2 | #define __CR_ASM_DUMP_H__ 3 | 4 | extern int save_task_regs(void *, user_regs_struct_t *, user_fpregs_struct_t *); 5 | extern int arch_alloc_thread_info(CoreEntry *core); 6 | extern void arch_free_thread_info(CoreEntry *core); 7 | 8 | 9 | #define core_put_tls(core, tls) 10 | 11 | #define get_task_futex_robust_list_compat(pid, info) -1 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /criu/arch/ppc64/include/asm/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_INT_H__ 2 | #define __CR_ASM_INT_H__ 3 | 4 | #include "asm-generic/int.h" 5 | 6 | #endif /* __CR_ASM_INT_H__ */ 7 | -------------------------------------------------------------------------------- /criu/arch/ppc64/include/asm/kerndat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_KERNDAT_H__ 2 | #define __CR_ASM_KERNDAT_H__ 3 | 4 | #define kdat_compatible_cr() 0 5 | #define kdat_can_map_vdso() 0 6 | 7 | #endif /* __CR_ASM_KERNDAT_H__ */ 8 | -------------------------------------------------------------------------------- /criu/arch/ppc64/include/asm/parasite-syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PARASITE_SYSCALL_H__ 2 | #define __CR_ASM_PARASITE_SYSCALL_H__ 3 | 4 | struct parasite_ctl; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /criu/arch/ppc64/include/asm/parasite.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_PARASITE_H__ 2 | #define __ASM_PARASITE_H__ 3 | 4 | /* TLS is accessed through r13, which is already processed */ 5 | static inline void arch_get_tls(tls_t *ptls) { (void)ptls; } 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /criu/arch/ppc64/vdso-trampoline.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | 3 | .section .text 4 | 5 | GLOBAL(vdso_trampoline) 6 | mflr r12 /* r12 vdso_ptr's address */ 7 | mtlr r0 /* restore lr */ 8 | ld r12,0(r12) /* read value store in vdso_ptr */ 9 | mtctr r12 /* branch to it */ 10 | bctr 11 | GLOBAL(vdso_trampoline_end) 12 | -------------------------------------------------------------------------------- /criu/arch/s390/Makefile: -------------------------------------------------------------------------------- 1 | builtin-name := crtools.built-in.o 2 | 3 | ccflags-y += -iquote $(obj)/include 4 | ccflags-y += -iquote criu/include -iquote include 5 | ccflags-y += $(COMPEL_UAPI_INCLUDES) 6 | ldflags-y += -r 7 | 8 | obj-y += cpu.o 9 | obj-y += crtools.o 10 | obj-y += sigframe.o 11 | -------------------------------------------------------------------------------- /criu/arch/s390/include/asm/dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_DUMP_H__ 2 | #define __CR_ASM_DUMP_H__ 3 | 4 | int save_task_regs(void *arg, user_regs_struct_t *u, user_fpregs_struct_t *f); 5 | int arch_alloc_thread_info(CoreEntry *core); 6 | void arch_free_thread_info(CoreEntry *core); 7 | 8 | static inline void core_put_tls(CoreEntry *core, tls_t tls) { } 9 | 10 | #define get_task_futex_robust_list_compat(pid, info) -1 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /criu/arch/s390/include/asm/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_INT_H__ 2 | #define __CR_ASM_INT_H__ 3 | 4 | #include "asm-generic/int.h" 5 | 6 | #endif /* __CR_ASM_INT_H__ */ 7 | -------------------------------------------------------------------------------- /criu/arch/s390/include/asm/kerndat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_KERNDAT_H__ 2 | #define __CR_ASM_KERNDAT_H__ 3 | 4 | #define kdat_compatible_cr() 0 5 | #define kdat_can_map_vdso() 0 6 | 7 | #endif /* __CR_ASM_KERNDAT_H__ */ 8 | -------------------------------------------------------------------------------- /criu/arch/s390/include/asm/parasite-syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PARASITE_SYSCALL_H__ 2 | #define __CR_ASM_PARASITE_SYSCALL_H__ 3 | 4 | struct parasite_ctl; 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /criu/arch/s390/include/asm/parasite.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_PARASITE_H__ 2 | #define __ASM_PARASITE_H__ 3 | 4 | /* TLS is accessed through %a01, which is already processed */ 5 | static inline void arch_get_tls(tls_t *ptls) { (void)ptls; } 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /criu/arch/s390/sigframe.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "asm/sigframe.h" 5 | #include "asm/types.h" 6 | 7 | #include "log.h" 8 | 9 | /* 10 | * Nothing to do since we don't have any pointers to adjust 11 | * in the signal frame. 12 | * 13 | * - sigframe : Pointer to local signal frame 14 | * - rsigframe: Pointer to remote signal frame of inferior 15 | */ 16 | int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe, 17 | struct rt_sigframe *rsigframe) 18 | { 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /criu/arch/x86/Makefile: -------------------------------------------------------------------------------- 1 | builtin-name := crtools.built-in.o 2 | 3 | ccflags-y += -iquote $(obj)/include 4 | ccflags-y += -iquote criu/include -iquote include 5 | ccflags-y += $(COMPEL_UAPI_INCLUDES) 6 | 7 | asflags-y += -Wstrict-prototypes 8 | asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer 9 | asflags-y += -iquote $(obj)/include 10 | ldflags-y += -r -z noexecstack 11 | 12 | obj-y += cpu.o 13 | obj-y += crtools.o 14 | obj-y += kerndat.o 15 | obj-y += sigframe.o 16 | ifeq ($(CONFIG_COMPAT),y) 17 | obj-y += sigaction_compat.o 18 | endif 19 | -------------------------------------------------------------------------------- /criu/arch/x86/include/asm/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_INT_H__ 2 | #define __CR_ASM_INT_H__ 3 | 4 | #include "asm-generic/int.h" 5 | 6 | #endif /* __CR_ASM_INT_H__ */ 7 | -------------------------------------------------------------------------------- /criu/arch/x86/include/asm/kerndat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_KERNDAT_H__ 2 | #define __CR_ASM_KERNDAT_H__ 3 | 4 | extern int kdat_compatible_cr(void); 5 | extern int kdat_can_map_vdso(void); 6 | extern int kdat_x86_has_ptrace_fpu_xsave_bug(void); 7 | 8 | #endif /* __CR_ASM_KERNDAT_H__ */ 9 | -------------------------------------------------------------------------------- /criu/arch/x86/include/asm/parasite-syscall.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PARASITE_SYSCALL_H__ 2 | #define __CR_ASM_PARASITE_SYSCALL_H__ 3 | 4 | #include "asm/types.h" 5 | 6 | struct parasite_ctl; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /criu/arch/x86/restorer_unmap.S: -------------------------------------------------------------------------------- 1 | #include "common/asm/linkage.h" 2 | #include "compel/plugins/std/syscall-codes.h" 3 | 4 | .text 5 | ENTRY(__export_unmap_compat) 6 | .code32 7 | mov bootstrap_start, %ebx 8 | mov bootstrap_len, %ecx 9 | sub vdso_rt_size, %ecx 10 | movl $__NR32_munmap, %eax 11 | int $0x80 12 | int $0x03 /* Guard */ 13 | .code64 14 | -------------------------------------------------------------------------------- /criu/arch/x86/sigaction_compat_pie.c: -------------------------------------------------------------------------------- 1 | sigaction_compat.c -------------------------------------------------------------------------------- /criu/cr-errno.c: -------------------------------------------------------------------------------- 1 | static int cr_errno; 2 | 3 | int get_cr_errno(void) 4 | { 5 | return cr_errno; 6 | } 7 | 8 | void set_cr_errno(int new_err) 9 | { 10 | if (!cr_errno) 11 | cr_errno = new_err; 12 | } 13 | -------------------------------------------------------------------------------- /criu/fault-injection.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "fault-injection.h" 3 | 4 | enum faults fi_strategy; 5 | 6 | int fault_injection_init() 7 | { 8 | char *val; 9 | int start; 10 | 11 | val = getenv("CRIU_FAULT"); 12 | if (val == NULL) 13 | return 0; 14 | 15 | start = atoi(val); 16 | 17 | if (start <= 0 || start >= FI_MAX) 18 | return -1; 19 | 20 | fi_strategy = start; 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /criu/include/asm-generic/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INT_H__ 2 | #define __CR_INT_H__ 3 | 4 | #include 5 | 6 | typedef uint64_t u64; 7 | typedef int64_t s64; 8 | typedef uint32_t u32; 9 | typedef int32_t s32; 10 | typedef uint16_t u16; 11 | typedef int16_t s16; 12 | typedef uint8_t u8; 13 | typedef int8_t s8; 14 | 15 | #endif /* __CR_INT_H__ */ 16 | -------------------------------------------------------------------------------- /criu/include/asm-generic/vdso.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_GENERIC_VDSO_H__ 2 | #define __CR_ASM_GENERIC_VDSO_H__ 3 | 4 | #define VDSO_PROT (PROT_READ | PROT_EXEC) 5 | #define VVAR_PROT (PROT_READ) 6 | 7 | /* Just in case of LPAE system PFN is u64. */ 8 | #define VDSO_BAD_PFN (-1ull) 9 | #define VVAR_BAD_PFN (-1ull) 10 | #define VDSO_BAD_ADDR (-1ul) 11 | #define VVAR_BAD_ADDR (-1ul) 12 | #define VDSO_BAD_SIZE (-1ul) 13 | #define VVAR_BAD_SIZE (-1ul) 14 | 15 | #endif /* __CR_ASM_GENERIC_VDSO_H__ */ 16 | -------------------------------------------------------------------------------- /criu/include/atomic.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_ATOMIC_H__ 2 | #define __CR_INC_ATOMIC_H__ 3 | #include "common/asm/atomic.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /criu/include/bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITMAP_H__ 2 | #define __CR_BITMAP_H__ 3 | 4 | extern void bitmap_set(unsigned long *map, int start, int nr); 5 | extern void bitmap_clear(unsigned long *map, int start, int nr); 6 | 7 | #endif /* __CR_BITMAP_H__ */ 8 | -------------------------------------------------------------------------------- /criu/include/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_BITOPS_H__ 2 | #define __CR_INC_BITOPS_H__ 3 | #include "common/bitops.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /criu/include/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_BITSPERLONG_H__ 2 | #define __CR_INC_BITSPERLONG_H__ 3 | #include "common/bitsperlong.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /criu/include/cgroup-props.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_CGROUP_PROPS_H__ 2 | #define __CR_CGROUP_PROPS_H__ 3 | 4 | #include 5 | 6 | typedef struct { 7 | const char *name; 8 | size_t nr_props; 9 | const char **props; 10 | } cgp_t; 11 | 12 | extern cgp_t cgp_global; 13 | extern const cgp_t *cgp_get_props(const char *name); 14 | extern bool cgp_should_skip_controller(const char *name); 15 | extern bool cgp_add_dump_controller(const char *name); 16 | 17 | extern int cgp_init(char *stream, size_t len, char *path); 18 | extern void cgp_fini(void); 19 | 20 | #endif /* __CR_CGROUP_PROPS_H__ */ 21 | -------------------------------------------------------------------------------- /criu/include/clone-noasan.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_CLONE_NOASAN_H__ 2 | #define __CR_CLONE_NOASAN_H__ 3 | 4 | int clone_noasan(int (*fn)(void *), int flags, void *arg); 5 | 6 | #endif /* __CR_CLONE_NOASAN_H__ */ 7 | -------------------------------------------------------------------------------- /criu/include/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_CPU_H__ 2 | #define __CR_CPU_H__ 3 | 4 | #include 5 | 6 | extern int cpu_init(void); 7 | extern int cpu_dump_cpuinfo(void); 8 | extern int cpu_validate_cpuinfo(void); 9 | extern int cpuinfo_dump(void); 10 | extern int cpuinfo_check(void); 11 | 12 | #endif /* __CR_CPU_H__ */ 13 | -------------------------------------------------------------------------------- /criu/include/cr-errno.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ERRNO_H__ 2 | #define __CR_ERRNO_H__ 3 | 4 | void set_cr_errno(int err); 5 | int get_cr_errno(void); 6 | 7 | /* 8 | * List of symbolic error names: 9 | * ESRCH - no process can be found corresponding to that specified by pid 10 | * EEXIST - process with such pid already exists 11 | * EBADRQC - bad options 12 | */ 13 | 14 | #define set_task_cr_err(new_err) atomic_cmpxchg(&task_entries->cr_err, 0, new_err) 15 | #define get_task_cr_err() atomic_read(&task_entries->cr_err) 16 | 17 | #endif /* __CR_ERRNO_H__ */ 18 | -------------------------------------------------------------------------------- /criu/include/cr-service-const.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SERVICE_CONST_H__ 2 | #define __CR_SERVICE_CONST_H__ 3 | 4 | #define CR_DEFAULT_SERVICE_ADDRESS "./criu_service.socket" 5 | 6 | #endif /* __CR_SERVICE_CONST_H__ */ 7 | -------------------------------------------------------------------------------- /criu/include/cr-service.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SERVICE_H__ 2 | #define __CR_SERVICE_H__ 3 | 4 | #include "images/rpc.pb-c.h" 5 | 6 | extern int cr_service(bool deamon_mode); 7 | int cr_service_work(int sk); 8 | 9 | extern int send_criu_dump_resp(int socket_fd, bool success, bool restored); 10 | 11 | extern struct _cr_service_client *cr_service_client; 12 | extern unsigned int service_sk_ino; 13 | 14 | #endif /* __CR_SERVICE_H__ */ 15 | -------------------------------------------------------------------------------- /criu/include/dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_DUMP_H__ 2 | #define __CR_INC_DUMP_H__ 3 | #include "asm/dump.h" 4 | 5 | extern int arch_set_thread_regs(struct pstree_item *item, bool with_threads); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /criu/include/eventfd.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_EVENTFD_H__ 2 | #define __CR_EVENTFD_H__ 3 | 4 | #include "files.h" 5 | 6 | extern int is_eventfd_link(char *link); 7 | extern const struct fdtype_ops eventfd_dump_ops; 8 | extern struct collect_image_info eventfd_cinfo; 9 | 10 | #endif /* __CR_EVENTFD_H__ */ 11 | -------------------------------------------------------------------------------- /criu/include/eventpoll.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_EVENTPOLL_H__ 2 | #define __CR_EVENTPOLL_H__ 3 | 4 | #include "files.h" 5 | 6 | extern int is_eventpoll_link(char *link); 7 | extern int flush_eventpoll_dinfo_queue(void); 8 | 9 | extern const struct fdtype_ops eventpoll_dump_ops; 10 | extern struct collect_image_info epoll_tfd_cinfo; 11 | extern struct collect_image_info epoll_cinfo; 12 | 13 | #endif /* __CR_EVENTPOLL_H__ */ 14 | -------------------------------------------------------------------------------- /criu/include/fdinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_FDINFO_H__ 2 | #define __CR_FDINFO_H__ 3 | 4 | #include "common/list.h" 5 | 6 | #include "images/eventfd.pb-c.h" 7 | #include "images/eventpoll.pb-c.h" 8 | #include "images/signalfd.pb-c.h" 9 | #include "images/fsnotify.pb-c.h" 10 | #include "images/timerfd.pb-c.h" 11 | 12 | struct fdinfo_common { 13 | off64_t pos; 14 | int flags; 15 | int mnt_id; 16 | int owner; 17 | }; 18 | 19 | extern int parse_fdinfo(int fd, int type, void *arg); 20 | extern int parse_fdinfo_pid(int pid, int fd, int type, void *arg); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /criu/include/fdstore.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRIU_FDSTORE_H__ 2 | #define __CRIU_FDSTORE_H__ 3 | 4 | /* 5 | * fdstore is a storage for file descriptors which is shared 6 | * between processes. 7 | */ 8 | 9 | int fdstore_init(void); 10 | 11 | /* Add a file descriptor to the storage and return its id */ 12 | int fdstore_add(int fd); 13 | 14 | /* Get a file descriptor from a storage by id */ 15 | int fdstore_get(int id); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /criu/include/fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_FIFO_H__ 2 | #define __CR_FIFO_H__ 3 | 4 | struct fd_parms; 5 | struct cr_imgset; 6 | 7 | extern const struct fdtype_ops fifo_dump_ops; 8 | extern struct collect_image_info fifo_cinfo; 9 | extern struct collect_image_info fifo_data_cinfo; 10 | 11 | #endif /* __CR_FIFO_H__ */ 12 | -------------------------------------------------------------------------------- /criu/include/file-ids.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_FILE_IDS_H__ 2 | #define __CR_FILE_IDS_H__ 3 | 4 | #include "common/compiler.h" 5 | #include "rbtree.h" 6 | 7 | #include "images/fdinfo.pb-c.h" 8 | 9 | #define FD_PID_INVALID (-2U) 10 | #define FD_DESC_INVALID (-3U) 11 | 12 | struct fdinfo_entry; 13 | struct stat; 14 | 15 | struct fd_parms; 16 | extern int fd_id_generate(pid_t pid, FdinfoEntry *fe, struct fd_parms *p); 17 | extern int fd_id_generate_special(struct fd_parms *p, u32 *id); 18 | 19 | extern struct kid_tree fd_tree; 20 | 21 | #endif /* __CR_FILE_IDS_H__ */ 22 | -------------------------------------------------------------------------------- /criu/include/infect-pie.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INFECT_PIE_H__ 2 | #define __CR_INFECT_PIE_H__ 3 | extern int parasite_daemon_cmd(int cmd, void *args); 4 | extern int parasite_trap_cmd(int cmd, void *args); 5 | extern void parasite_cleanup(void); 6 | extern int parasite_get_rpc_sock(void); 7 | #endif 8 | -------------------------------------------------------------------------------- /criu/include/int.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_INT_H__ 2 | #define __CR_INC_INT_H__ 3 | #include "asm/int.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /criu/include/ipc_ns.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_IPC_NS_H__ 2 | #define __CR_IPC_NS_H__ 3 | 4 | extern int dump_ipc_ns(int ns_id); 5 | extern int prepare_ipc_ns(int pid); 6 | 7 | extern struct ns_desc ipc_ns_desc; 8 | 9 | #endif /* __CR_IPC_NS_H__ */ 10 | -------------------------------------------------------------------------------- /criu/include/irmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_IRMAP__H__ 2 | #define __CR_IRMAP__H__ 3 | char *irmap_lookup(unsigned int s_dev, unsigned long i_ino); 4 | struct _FhEntry; 5 | int irmap_queue_cache(unsigned int dev, unsigned long ino, 6 | struct _FhEntry *fh); 7 | int irmap_predump_prep(void); 8 | int irmap_predump_run(void); 9 | int check_open_handle(unsigned int s_dev, unsigned long i_ino, 10 | struct _FhEntry *f_handle); 11 | int irmap_load_cache(void); 12 | int irmap_scan_path_add(char *path); 13 | #endif 14 | -------------------------------------------------------------------------------- /criu/include/kcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_KCMP_H__ 2 | #define __CR_KCMP_H__ 3 | 4 | #include 5 | 6 | enum kcmp_type { 7 | KCMP_FILE, 8 | KCMP_VM, 9 | KCMP_FILES, 10 | KCMP_FS, 11 | KCMP_SIGHAND, 12 | KCMP_IO, 13 | KCMP_SYSVSEM, 14 | KCMP_EPOLL_TFD, 15 | 16 | KCMP_TYPES, 17 | }; 18 | 19 | /* Slot for KCMP_EPOLL_TFD */ 20 | typedef struct { 21 | uint32_t efd; /* epoll file descriptor */ 22 | uint32_t tfd; /* target file number */ 23 | uint32_t toff; /* target offset within same numbered sequence */ 24 | } kcmp_epoll_slot_t; 25 | 26 | #endif /* __CR_KCMP_H__ */ 27 | -------------------------------------------------------------------------------- /criu/include/mman.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_MMAN_H__ 2 | #define __CR_MMAN_H__ 3 | 4 | #ifndef MAP_HUGETLB 5 | # define MAP_HUGETLB 0x40000 6 | #endif 7 | #ifndef MADV_HUGEPAGE 8 | # define MADV_HUGEPAGE 14 9 | #endif 10 | #ifndef MADV_NOHUGEPAGE 11 | # define MADV_NOHUGEPAGE 15 12 | #endif 13 | #ifndef MADV_DONTDUMP 14 | # define MADV_DONTDUMP 16 15 | #endif 16 | 17 | #endif /* __CR_MMAN_H__ */ 18 | -------------------------------------------------------------------------------- /criu/include/netfilter.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_NETFILTER_H__ 2 | #define __CR_NETFILTER_H__ 3 | 4 | struct inet_sk_desc; 5 | extern int nf_lock_connection(struct inet_sk_desc *); 6 | extern int nf_unlock_connection(struct inet_sk_desc *); 7 | 8 | struct inet_sk_info; 9 | extern int nf_unlock_connection_info(struct inet_sk_info *); 10 | 11 | extern void preload_netfilter_modules(void); 12 | 13 | #endif /* __CR_NETFILTER_H__ */ 14 | -------------------------------------------------------------------------------- /criu/include/page.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_PAGE_H__ 2 | #define __CR_INC_PAGE_H__ 3 | #include "common/page.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /criu/include/ptrace-compat.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_PTRACE_H__ 2 | #define __CR_PTRACE_H__ 3 | 4 | #include 5 | #include 6 | #include "common/config.h" 7 | 8 | #ifndef CONFIG_HAS_PTRACE_PEEKSIGINFO 9 | struct ptrace_peeksiginfo_args { 10 | __u64 off; /* from which siginfo to start */ 11 | __u32 flags; 12 | __u32 nr; /* how may siginfos to take */ 13 | }; 14 | #endif 15 | 16 | #endif /* __CR_PTRACE_H__ */ 17 | -------------------------------------------------------------------------------- /criu/include/restore.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_RESTORE_H__ 2 | #define __CR_INC_RESTORE_H__ 3 | 4 | #include "pid.h" 5 | #include "types.h" 6 | #include "asm/restore.h" 7 | 8 | extern int arch_set_thread_regs_nosigrt(struct pid *pid); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /criu/include/seize.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SEIZE_H__ 2 | #define __CR_SEIZE_H__ 3 | 4 | extern int collect_pstree(void); 5 | extern void pstree_switch_state(struct pstree_item *root_item, int st); 6 | extern const char *get_real_freezer_state(void); 7 | extern bool alarm_timeouted(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /criu/include/setproctitle.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SETPROCTITLE_H__ 2 | #define __CR_SETPROCTITLE_H__ 3 | 4 | #ifdef CONFIG_HAS_LIBBSD 5 | #include 6 | #else 7 | 8 | /* 9 | * setproctitle_init is in the libbsd since v0.6.0. This macro allows to 10 | * compile criu with libbsd<0.6.0. 11 | */ 12 | #ifndef CONFIG_HAS_SETPROCTITLE_INIT 13 | #define setproctitle_init(argc, argv, envp) 14 | #endif 15 | 16 | #define setproctitle(fmt, ...) 17 | #endif 18 | 19 | #endif /* __CR_SETPROCTITLE_H__ */ 20 | -------------------------------------------------------------------------------- /criu/include/sigframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generic sigframe bits. 3 | */ 4 | 5 | #ifndef __CR_SIGFRAME_H__ 6 | #define __CR_SIGFRAME_H__ 7 | 8 | #include 9 | #include "images/core.pb-c.h" 10 | 11 | extern int construct_sigframe(struct rt_sigframe *sigframe, 12 | struct rt_sigframe *rsigframe, 13 | k_rtsigset_t *blkset, 14 | CoreEntry *core); 15 | 16 | #endif /* __CR_SIGFRAME_H__ */ 17 | -------------------------------------------------------------------------------- /criu/include/signalfd.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SIGNALFD_H__ 2 | #define __CR_SIGNALFD_H__ 3 | 4 | struct cr_imgset; 5 | struct fd_parms; 6 | extern int is_signalfd_link(char *link); 7 | extern const struct fdtype_ops signalfd_dump_ops; 8 | extern struct collect_image_info signalfd_cinfo; 9 | 10 | #endif /* __CR_SIGNALFD_H__ */ 11 | -------------------------------------------------------------------------------- /criu/include/sk-queue.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_SK_QUEUE_H__ 2 | #define __CR_SK_QUEUE_H__ 3 | 4 | extern struct collect_image_info sk_queues_cinfo; 5 | extern int dump_sk_queue(int sock_fd, int sock_id); 6 | extern int restore_sk_queue(int fd, unsigned int peer_id); 7 | 8 | #endif /* __CR_SK_QUEUE_H__ */ 9 | -------------------------------------------------------------------------------- /criu/include/string.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_STRING_H__ 2 | #define __CR_STRING_H__ 3 | 4 | #include 5 | 6 | #ifdef CONFIG_HAS_LIBBSD 7 | # include 8 | #endif 9 | 10 | #include "common/config.h" 11 | 12 | #ifndef CONFIG_HAS_STRLCPY 13 | extern size_t strlcpy(char *dest, const char *src, size_t size); 14 | #endif 15 | 16 | #ifndef CONFIG_HAS_STRLCAT 17 | extern size_t strlcat(char *dest, const char *src, size_t count); 18 | #endif 19 | 20 | #endif /* __CR_STRING_H__ */ 21 | -------------------------------------------------------------------------------- /criu/include/types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_INC_TYPES_H__ 2 | #define __CR_INC_TYPES_H__ 3 | #include 4 | #include "asm/types.h" 5 | #endif 6 | -------------------------------------------------------------------------------- /criu/include/uffd.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_UFFD_H_ 2 | #define __CR_UFFD_H_ 3 | 4 | struct task_restore_args; 5 | 6 | extern int uffd_open(int flags, unsigned long *features); 7 | extern bool uffd_noncooperative(void); 8 | extern int setup_uffd(int pid, struct task_restore_args *task_args); 9 | extern int lazy_pages_setup_zombie(int pid); 10 | extern int prepare_lazy_pages_socket(void); 11 | extern int lazy_pages_finish_restore(void); 12 | 13 | #endif /* __CR_UFFD_H_ */ 14 | -------------------------------------------------------------------------------- /criu/include/util-pie.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_UTIL_NET_H__ 2 | #define __CR_UTIL_NET_H__ 3 | 4 | #include 5 | #include 6 | 7 | #define UNIX_PATH_MAX (sizeof(struct sockaddr_un) - \ 8 | (size_t)((struct sockaddr_un *) 0)->sun_path) 9 | 10 | #ifndef SO_PEEK_OFF 11 | #define SO_PEEK_OFF 42 12 | #endif 13 | 14 | #include "common/scm.h" 15 | 16 | extern int open_detach_mount(char *dir); 17 | 18 | #endif /* __CR_UTIL_NET_H__ */ 19 | -------------------------------------------------------------------------------- /criu/include/uts_ns.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_UTS_NS_H__ 2 | #define __CR_UTS_NS_H__ 3 | 4 | extern int dump_uts_ns(int ns_id); 5 | extern int prepare_utsns(int pid); 6 | 7 | extern struct ns_desc uts_ns_desc; 8 | 9 | #endif /* __CR_UTS_NS_H__ */ 10 | -------------------------------------------------------------------------------- /criu/include/xmalloc.h: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include "common/xmalloc.h" 3 | -------------------------------------------------------------------------------- /criu/pie-util-vdso-elf32.c: -------------------------------------------------------------------------------- 1 | pie/util-vdso-elf32.c -------------------------------------------------------------------------------- /criu/pie-util-vdso.c: -------------------------------------------------------------------------------- 1 | pie/util-vdso.c -------------------------------------------------------------------------------- /criu/pie-util.c: -------------------------------------------------------------------------------- 1 | pie/util.c -------------------------------------------------------------------------------- /criu/pie/pie-relocs.h: -------------------------------------------------------------------------------- 1 | #ifndef __PIE_RELOCS_H__ 2 | #define __PIE_RELOCS_H__ 3 | 4 | #include 5 | 6 | #include "common/config.h" 7 | #include "common/compiler.h" 8 | 9 | #define pie_size(__pie_name) (round_up(sizeof(__pie_name##_blob) + \ 10 | __pie_name ## _nr_gotpcrel * sizeof(long), page_size())) 11 | 12 | #endif /* __PIE_RELOCS_H__ */ 13 | -------------------------------------------------------------------------------- /criu/pie/util-vdso-elf32.c: -------------------------------------------------------------------------------- 1 | util-vdso.c -------------------------------------------------------------------------------- /images/autofs.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message autofs_entry { 4 | required int32 fd = 1; 5 | required int32 pgrp = 2; 6 | required int32 timeout = 3; 7 | required int32 minproto = 4; 8 | required int32 maxproto = 5; 9 | required int32 mode = 6; 10 | 11 | optional int32 uid = 7; 12 | optional int32 gid = 8; 13 | 14 | optional int32 read_fd = 9; 15 | } 16 | -------------------------------------------------------------------------------- /images/binfmt-misc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message binfmt_misc_entry { 4 | required string name = 1; 5 | required bool enabled = 2; 6 | required string interpreter = 3; 7 | optional string flags = 4; 8 | optional string extension = 5; 9 | optional string magic = 6; 10 | optional string mask = 7; 11 | optional int32 offset = 8; 12 | } 13 | -------------------------------------------------------------------------------- /images/creds.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message creds_entry { 4 | required uint32 uid = 1; 5 | required uint32 gid = 2; 6 | required uint32 euid = 3; 7 | required uint32 egid = 4; 8 | required uint32 suid = 5; 9 | required uint32 sgid = 6; 10 | required uint32 fsuid = 7; 11 | required uint32 fsgid = 8; 12 | 13 | repeated uint32 cap_inh = 9; 14 | repeated uint32 cap_prm = 10; 15 | repeated uint32 cap_eff = 11; 16 | repeated uint32 cap_bnd = 12; 17 | 18 | required uint32 secbits = 13; 19 | 20 | repeated uint32 groups = 14; 21 | 22 | optional string lsm_profile = 15; 23 | } 24 | -------------------------------------------------------------------------------- /images/eventfd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "fown.proto"; 4 | 5 | message eventfd_file_entry { 6 | required uint32 id = 1; 7 | required uint32 flags = 2; 8 | required fown_entry fown = 3; 9 | required uint64 counter = 4; 10 | } 11 | -------------------------------------------------------------------------------- /images/eventpoll.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "fown.proto"; 4 | 5 | message eventpoll_tfd_entry { 6 | required uint32 id = 1; 7 | required uint32 tfd = 2; 8 | required uint32 events = 3; 9 | required uint64 data = 4; 10 | 11 | /* to find dup'ed target files */ 12 | optional uint32 dev = 5; 13 | optional uint64 inode = 6; 14 | optional uint64 pos = 7; 15 | } 16 | 17 | message eventpoll_file_entry { 18 | required uint32 id = 1; 19 | required uint32 flags = 2; 20 | required fown_entry fown = 3; 21 | repeated eventpoll_tfd_entry tfd = 4; 22 | } 23 | -------------------------------------------------------------------------------- /images/ext-file.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "fown.proto"; 4 | 5 | message ext_file_entry { 6 | required uint32 id = 1; 7 | required fown_entry fown = 5; 8 | } 9 | -------------------------------------------------------------------------------- /images/fh.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | 5 | enum fh_entry_sizes { 6 | min_entries = 16; 7 | } 8 | 9 | message fh_entry { 10 | required uint32 bytes = 1; 11 | required uint32 type = 2; 12 | 13 | /* The minimum is fh_n_handle repetitions */ 14 | repeated uint64 handle = 3; 15 | optional string path = 4; 16 | optional uint32 mnt_id = 5; 17 | } 18 | 19 | message irmap_cache_entry { 20 | required uint32 dev = 1 [(criu).dev = true, (criu).odev = true]; 21 | required uint64 inode = 2; 22 | required string path = 3; 23 | } 24 | -------------------------------------------------------------------------------- /images/fifo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message fifo_entry { 4 | required uint32 id = 1; 5 | required uint32 pipe_id = 2; 6 | optional uint32 regf_id = 3; 7 | } 8 | -------------------------------------------------------------------------------- /images/file-lock.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message file_lock_entry { 4 | required uint32 flag = 1; 5 | required uint32 type = 2; 6 | required int32 pid = 3; 7 | required int32 fd = 4; 8 | required int64 start = 5; 9 | required int64 len = 6; 10 | } 11 | -------------------------------------------------------------------------------- /images/fown.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message fown_entry { 4 | required uint32 uid = 1; 5 | required uint32 euid = 2; 6 | required uint32 signum = 3; 7 | required uint32 pid_type = 4; 8 | required uint32 pid = 5; 9 | } 10 | -------------------------------------------------------------------------------- /images/fs.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message fs_entry { 4 | required uint32 cwd_id = 1; 5 | required uint32 root_id = 2; 6 | optional uint32 umask = 3; 7 | } 8 | -------------------------------------------------------------------------------- /images/google/protobuf/descriptor.proto: -------------------------------------------------------------------------------- 1 | /usr/include/google/protobuf/descriptor.proto -------------------------------------------------------------------------------- /images/inventory.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "core.proto"; 4 | 5 | enum lsmtype { 6 | NO_LSM = 0; 7 | SELINUX = 1; 8 | APPARMOR = 2; 9 | } 10 | 11 | message inventory_entry { 12 | required uint32 img_version = 1; 13 | optional bool fdinfo_per_id = 2; 14 | optional task_kobj_ids_entry root_ids = 3; 15 | optional bool ns_per_id = 4; 16 | optional uint32 root_cg_set = 5; 17 | optional lsmtype lsmtype = 6; 18 | optional uint64 dump_uptime = 8; 19 | } 20 | -------------------------------------------------------------------------------- /images/ipc-desc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message ipc_desc_entry { 4 | required uint32 key = 1; 5 | required uint32 uid = 2; 6 | required uint32 gid = 3; 7 | required uint32 cuid = 4; 8 | required uint32 cgid = 5; 9 | required uint32 mode = 6; 10 | required uint32 id = 7; 11 | } 12 | -------------------------------------------------------------------------------- /images/ipc-msg.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "ipc-desc.proto"; 4 | 5 | message ipc_msg { 6 | required uint64 mtype = 1; 7 | required uint32 msize = 2; 8 | } 9 | 10 | message ipc_msg_entry { 11 | required ipc_desc_entry desc = 1; 12 | required uint32 qbytes = 2; 13 | required uint32 qnum = 3; 14 | } 15 | -------------------------------------------------------------------------------- /images/ipc-sem.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "ipc-desc.proto"; 4 | 5 | message ipc_sem_entry { 6 | required ipc_desc_entry desc = 1; 7 | required uint32 nsems = 2; 8 | } 9 | -------------------------------------------------------------------------------- /images/ipc-shm.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "ipc-desc.proto"; 4 | 5 | message ipc_shm_entry { 6 | required ipc_desc_entry desc = 1; 7 | required uint64 size = 2; 8 | optional bool in_pagemaps = 3; 9 | } 10 | -------------------------------------------------------------------------------- /images/macvlan.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message macvlan_link_entry { 4 | required uint32 mode = 1; 5 | optional uint32 flags = 2; 6 | } 7 | -------------------------------------------------------------------------------- /images/ns.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message ns_file_entry { 4 | required uint32 id = 1; 5 | required uint32 ns_id = 2; 6 | required uint32 ns_cflag = 3; 7 | required uint32 flags = 4; 8 | } 9 | -------------------------------------------------------------------------------- /images/pagemap.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | 5 | message pagemap_head { 6 | required uint32 pages_id = 1; 7 | } 8 | 9 | message pagemap_entry { 10 | required uint64 vaddr = 1 [(criu).hex = true]; 11 | required uint32 nr_pages = 2; 12 | optional bool in_parent = 3; 13 | optional uint32 flags = 4 [(criu).flags = "pmap.flags" ]; 14 | } 15 | -------------------------------------------------------------------------------- /images/pipe-data.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message pipe_data_entry { 4 | required uint32 pipe_id = 1; 5 | required uint32 bytes = 2; 6 | optional uint32 size = 3; 7 | } 8 | -------------------------------------------------------------------------------- /images/pipe.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | import "fown.proto"; 5 | 6 | message pipe_entry { 7 | required uint32 id = 1; 8 | required uint32 pipe_id = 2; 9 | required uint32 flags = 3 [(criu).hex = true]; 10 | required fown_entry fown = 4; 11 | } 12 | -------------------------------------------------------------------------------- /images/pstree.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message pstree_entry { 4 | required uint32 pid = 1; 5 | required uint32 ppid = 2; 6 | required uint32 pgid = 3; 7 | required uint32 sid = 4; 8 | repeated uint32 threads = 5; 9 | } 10 | -------------------------------------------------------------------------------- /images/regfile.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | import "fown.proto"; 5 | 6 | message reg_file_entry { 7 | required uint32 id = 1; 8 | required uint32 flags = 2 [(criu).flags = "rfile.flags"]; 9 | required uint64 pos = 3; 10 | required fown_entry fown = 5; 11 | required string name = 6; 12 | optional sint32 mnt_id = 7 [default = -1]; 13 | optional uint64 size = 8; 14 | optional bool ext = 9; 15 | optional uint32 mode = 10; 16 | } 17 | -------------------------------------------------------------------------------- /images/remap-file-path.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | enum remap_type { 4 | LINKED = 0; 5 | GHOST = 1; 6 | PROCFS = 2; 7 | // Reserved for spfs manager 8 | // SPFS = 3; 9 | // SPFS_LINKED = 4; 10 | }; 11 | 12 | message remap_file_path_entry { 13 | required uint32 orig_id = 1; 14 | required uint32 remap_id = 2; 15 | optional remap_type remap_type = 3; 16 | } 17 | -------------------------------------------------------------------------------- /images/rlimit.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message rlimit_entry { 4 | required uint64 cur = 1; 5 | required uint64 max = 2; 6 | } 7 | -------------------------------------------------------------------------------- /images/sa.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | 5 | message sa_entry { 6 | required uint64 sigaction = 1 [(criu).hex = true]; 7 | required uint64 flags = 2 [(criu).hex = true]; 8 | required uint64 restorer = 3 [(criu).hex = true]; 9 | required uint64 mask = 4 [(criu).hex = true]; 10 | optional bool compat_sigaction = 5; 11 | } 12 | -------------------------------------------------------------------------------- /images/seccomp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message seccomp_filter { 4 | required bytes filter = 1; 5 | optional uint32 prev = 2; 6 | optional uint32 flags = 3; 7 | } 8 | 9 | message seccomp_entry { 10 | repeated seccomp_filter seccomp_filters = 1; 11 | } 12 | -------------------------------------------------------------------------------- /images/siginfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message siginfo_entry { 4 | required bytes siginfo = 1; 5 | } 6 | 7 | message signal_queue_entry { 8 | repeated siginfo_entry signals = 1; 9 | } 10 | -------------------------------------------------------------------------------- /images/signalfd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | import "fown.proto"; 5 | 6 | message signalfd_entry { 7 | required uint32 id = 1; 8 | required uint32 flags = 2 [(criu).hex = true]; 9 | required fown_entry fown = 3; 10 | required uint64 sigmask = 4 [(criu).hex = true]; 11 | }; 12 | -------------------------------------------------------------------------------- /images/sk-packet.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message scm_entry { 4 | required uint32 type = 1; 5 | repeated uint32 rights = 2; 6 | } 7 | 8 | message sk_packet_entry { 9 | required uint32 id_for = 1; 10 | required uint32 length = 2; 11 | // Reserved for message address 12 | // optional bytes addr = 3; 13 | repeated scm_entry scm = 4; 14 | // Reserved for ucred restore 15 | // optional sk_ucred_entry ucred = 128; 16 | } 17 | -------------------------------------------------------------------------------- /images/sysctl.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | enum SysctlType { 4 | CTL_STR = 5; 5 | CTL_32 = 6; 6 | } 7 | 8 | message sysctl_entry { 9 | required SysctlType type = 1; 10 | 11 | optional int32 iarg = 2; 12 | optional string sarg = 3; 13 | } 14 | -------------------------------------------------------------------------------- /images/time.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message timeval { 4 | required uint64 tv_sec = 1; 5 | required uint64 tv_usec = 2; 6 | } 7 | -------------------------------------------------------------------------------- /images/timerfd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | import "fown.proto"; 5 | 6 | message timerfd_entry { 7 | required uint32 id = 1; 8 | required uint32 flags = 2 [(criu).hex = true]; 9 | required fown_entry fown = 3; 10 | 11 | required uint32 clockid = 4; 12 | required uint64 ticks = 5; 13 | required uint32 settime_flags = 6 [(criu).hex = true]; 14 | 15 | required uint64 vsec = 7; 16 | required uint64 vnsec = 8; 17 | required uint64 isec = 9; 18 | required uint64 insec = 10; 19 | } 20 | -------------------------------------------------------------------------------- /images/tun.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | import "opts.proto"; 4 | 5 | message tunfile_entry { 6 | required uint32 id = 1; 7 | optional string netdev = 2; 8 | optional bool detached = 3; 9 | optional uint32 ns_id = 4; 10 | }; 11 | 12 | message tun_link_entry { 13 | required uint32 flags = 1 [(criu).hex = true]; 14 | required int32 owner = 2; 15 | required int32 group = 3; 16 | required uint32 vnethdr = 4; 17 | required uint32 sndbuf = 5; 18 | }; 19 | -------------------------------------------------------------------------------- /images/userns.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message uid_gid_extent { 4 | required uint32 first = 1; 5 | required uint32 lower_first = 2; 6 | required uint32 count = 3; 7 | } 8 | 9 | message userns_entry { 10 | repeated uid_gid_extent uid_map = 1; 11 | repeated uid_gid_extent gid_map = 2; 12 | } 13 | -------------------------------------------------------------------------------- /images/utsns.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message utsns_entry { 4 | required string nodename = 1; 5 | required string domainname = 2; 6 | } 7 | -------------------------------------------------------------------------------- /include/common/arch/aarch64/asm/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_BITOPS_H__ 2 | #define __CR_ASM_BITOPS_H__ 3 | 4 | #include "common/compiler.h" 5 | #include "common/asm-generic/bitops.h" 6 | 7 | extern int test_and_set_bit(int nr, volatile unsigned long *p); 8 | 9 | #endif /* __CR_ASM_BITOPS_H__ */ 10 | -------------------------------------------------------------------------------- /include/common/arch/aarch64/asm/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITSPERLONG_H__ 2 | #define __CR_BITSPERLONG_H__ 3 | 4 | #define BITS_PER_LONG 64 5 | 6 | #endif /* __CR_BITSPERLONG_H__ */ 7 | -------------------------------------------------------------------------------- /include/common/arch/aarch64/asm/linkage.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_LINKAGE_H__ 2 | #define __CR_LINKAGE_H__ 3 | 4 | #ifdef __ASSEMBLY__ 5 | 6 | #define __ALIGN .align 4, 0x00 7 | #define __ALIGN_STR ".align 4, 0x00" 8 | 9 | #define GLOBAL(name) \ 10 | .globl name; \ 11 | name: 12 | 13 | #define ENTRY(name) \ 14 | .globl name; \ 15 | .type name, #function; \ 16 | __ALIGN; \ 17 | name: 18 | 19 | #define END(sym) \ 20 | .size sym, . - sym 21 | 22 | #endif /* __ASSEMBLY__ */ 23 | 24 | #endif /* __CR_LINKAGE_H__ */ 25 | -------------------------------------------------------------------------------- /include/common/arch/arm/asm/bitops.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_BITOPS_H__ 2 | #define __CR_ASM_BITOPS_H__ 3 | 4 | #include "common/compiler.h" 5 | #include "common/asm-generic/bitops.h" 6 | 7 | extern int test_and_set_bit(int nr, volatile unsigned long *p); 8 | 9 | #endif /* __CR_ASM_BITOPS_H__ */ 10 | -------------------------------------------------------------------------------- /include/common/arch/arm/asm/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITSPERLONG_H__ 2 | #define __CR_BITSPERLONG_H__ 3 | 4 | #define BITS_PER_LONG 32 5 | 6 | #endif /* __CR_BITSPERLONG_H__ */ 7 | -------------------------------------------------------------------------------- /include/common/arch/arm/asm/linkage.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_LINKAGE_H__ 2 | #define __CR_LINKAGE_H__ 3 | 4 | #ifdef __ASSEMBLY__ 5 | 6 | #define __ALIGN .align 4, 0x00 7 | #define __ALIGN_STR ".align 4, 0x00" 8 | 9 | #define GLOBAL(name) \ 10 | .globl name; \ 11 | name: 12 | 13 | #define ENTRY(name) \ 14 | .globl name; \ 15 | .type name, #function; \ 16 | __ALIGN; \ 17 | name: 18 | 19 | #define END(sym) \ 20 | .size sym, . - sym 21 | 22 | #endif /* __ASSEMBLY__ */ 23 | 24 | #endif /* __CR_LINKAGE_H__ */ 25 | -------------------------------------------------------------------------------- /include/common/arch/arm/asm/page.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PAGE_H__ 2 | #define __CR_ASM_PAGE_H__ 3 | 4 | #ifndef PAGE_SHIFT 5 | # define PAGE_SHIFT 12 6 | #endif 7 | 8 | #ifndef PAGE_SIZE 9 | # define PAGE_SIZE (1UL << PAGE_SHIFT) 10 | #endif 11 | 12 | #ifndef PAGE_MASK 13 | # define PAGE_MASK (~(PAGE_SIZE - 1)) 14 | #endif 15 | 16 | #define PAGE_PFN(addr) ((addr) / PAGE_SIZE) 17 | #define page_size() PAGE_SIZE 18 | 19 | #endif /* __CR_ASM_PAGE_H__ */ 20 | -------------------------------------------------------------------------------- /include/common/arch/ppc64/asm/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITSPERLONG_H__ 2 | #define __CR_BITSPERLONG_H__ 3 | 4 | #define BITS_PER_LONG 64 5 | 6 | #endif /* __CR_BITSPERLONG_H__ */ 7 | -------------------------------------------------------------------------------- /include/common/arch/s390/asm/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITSPERLONG_H__ 2 | #define __CR_BITSPERLONG_H__ 3 | 4 | #define BITS_PER_LONG 64 5 | 6 | #endif /* __CR_BITSPERLONG_H__ */ 7 | -------------------------------------------------------------------------------- /include/common/arch/s390/asm/linkage.h: -------------------------------------------------------------------------------- 1 | #ifndef __ASM_LINKAGE_H 2 | #define __ASM_LINKAGE_H 3 | 4 | #ifdef __ASSEMBLY__ 5 | 6 | #define __ALIGN .align 4, 0x07 7 | 8 | #define GLOBAL(name) \ 9 | .globl name; \ 10 | name: 11 | 12 | #define ENTRY(name) \ 13 | .globl name; \ 14 | .type name, @function; \ 15 | __ALIGN; \ 16 | name: 17 | 18 | #define END(name) \ 19 | .size name, . - name 20 | 21 | #endif /* __ASSEMBLY__ */ 22 | #endif 23 | -------------------------------------------------------------------------------- /include/common/arch/s390/asm/page.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PAGE_H__ 2 | #define __CR_ASM_PAGE_H__ 3 | 4 | #ifndef PAGE_SHIFT 5 | #define PAGE_SHIFT 12 6 | #endif 7 | 8 | #ifndef PAGE_SIZE 9 | #define PAGE_SIZE (1UL << PAGE_SHIFT) 10 | #endif 11 | 12 | #ifndef PAGE_MASK 13 | #define PAGE_MASK (~(PAGE_SIZE - 1)) 14 | #endif 15 | 16 | #define PAGE_PFN(addr) ((addr) / PAGE_SIZE) 17 | #define page_size() PAGE_SIZE 18 | 19 | #endif /* __CR_ASM_PAGE_H__ */ 20 | -------------------------------------------------------------------------------- /include/common/arch/x86/asm/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_BITSPERLONG_H__ 2 | #define __CR_BITSPERLONG_H__ 3 | 4 | #ifdef CONFIG_X86_64 5 | # define BITS_PER_LONG 64 6 | #else 7 | # define BITS_PER_LONG 32 8 | #endif 9 | 10 | #endif /* __CR_BITSPERLONG_H__ */ 11 | -------------------------------------------------------------------------------- /include/common/arch/x86/asm/linkage.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_LINKAGE_H__ 2 | #define __CR_LINKAGE_H__ 3 | 4 | #ifdef __ASSEMBLY__ 5 | 6 | #define __ALIGN .align 4, 0x90 7 | #define __ALIGN_STR ".align 4, 0x90" 8 | 9 | #define GLOBAL(name) \ 10 | .globl name; \ 11 | name: 12 | 13 | #define ENTRY(name) \ 14 | .globl name; \ 15 | .type name, @function; \ 16 | __ALIGN; \ 17 | name: 18 | 19 | #define END(sym) \ 20 | .size sym, . - sym 21 | 22 | #endif /* __ASSEMBLY__ */ 23 | 24 | #define __USER32_CS 0x23 25 | #define __USER_CS 0x33 26 | 27 | #endif /* __CR_LINKAGE_H__ */ 28 | -------------------------------------------------------------------------------- /include/common/arch/x86/asm/page.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_ASM_PAGE_H__ 2 | #define __CR_ASM_PAGE_H__ 3 | 4 | #ifndef PAGE_SHIFT 5 | # define PAGE_SHIFT 12 6 | #endif 7 | 8 | #ifndef PAGE_SIZE 9 | # define PAGE_SIZE (1UL << PAGE_SHIFT) 10 | #endif 11 | 12 | #ifndef PAGE_MASK 13 | # define PAGE_MASK (~(PAGE_SIZE - 1)) 14 | #endif 15 | 16 | #define PAGE_PFN(addr) ((addr) / PAGE_SIZE) 17 | #define page_size() PAGE_SIZE 18 | 19 | #endif /* __CR_ASM_PAGE_H__ */ 20 | -------------------------------------------------------------------------------- /include/common/bitsperlong.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_COMMON_BITSPERLONG_H__ 2 | #define __CR_COMMON_BITSPERLONG_H__ 3 | #include "common/asm/bitsperlong.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /include/common/page.h: -------------------------------------------------------------------------------- 1 | #ifndef __CR_COMMON_PAGE_H__ 2 | #define __CR_COMMON_PAGE_H__ 3 | #include "common/asm/page.h" 4 | #endif 5 | -------------------------------------------------------------------------------- /lib/c/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += criu.o 2 | obj-y += ./images/rpc.pb-c.o 3 | 4 | ccflags-y += -iquote criu/$(ARCH_DIR)/include 5 | ccflags-y += -iquote criu/include 6 | ccflags-y += -iquote images 7 | ccflags-y += -fPIC -fno-stack-protector 8 | ldflags-y += -r -z noexecstack 9 | -------------------------------------------------------------------------------- /lib/c/criu.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@libdir@ 2 | includedir=@includedir@ 3 | 4 | Name: CRIU 5 | Description: RPC library for userspace checkpoint and restore 6 | Version: @version@ 7 | Libs: -L${libdir} -lcriu 8 | Cflags: -I${includedir} 9 | -------------------------------------------------------------------------------- /lib/py/.gitignore: -------------------------------------------------------------------------------- 1 | *_pb2.py 2 | *.pyc 3 | -------------------------------------------------------------------------------- /lib/py/Makefile: -------------------------------------------------------------------------------- 1 | all-y += libpy-images rpc_pb2.py 2 | 3 | $(obj)/images/Makefile: ; 4 | $(obj)/images/%: .FORCE 5 | $(Q) $(MAKE) $(build)=$(obj)/images $@ 6 | 7 | libpy-images: 8 | $(Q) $(MAKE) $(build)=$(obj)/images all 9 | .PHONY: libpy-images 10 | 11 | rpc_pb2.py: 12 | $(Q) protoc -I=images/ --python_out=$(obj) images/$(@:_pb2.py=.proto) 13 | 14 | cleanup-y += $(addprefix $(obj)/,rpc_pb2.py *.pyc) 15 | 16 | clean-lib-py: 17 | $(Q) $(MAKE) $(build)=$(obj)/images clean 18 | .PHONY: clean-lib-py 19 | clean: clean-lib-py 20 | -------------------------------------------------------------------------------- /lib/py/__init__.py: -------------------------------------------------------------------------------- 1 | from . import rpc_pb2 as rpc 2 | from . import images 3 | from .criu import * 4 | -------------------------------------------------------------------------------- /lib/py/images/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *_pb2.py 3 | magic.py 4 | pb.py 5 | -------------------------------------------------------------------------------- /lib/py/images/__init__.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | sys.path.append(os.path.dirname(os.path.realpath(__file__))) 3 | from .magic import * 4 | from .images import * 5 | from .pb import * 6 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.aarch64.hdr: -------------------------------------------------------------------------------- 1 | FROM arm64v8/ubuntu:xenial 2 | 3 | COPY scripts/build/qemu-user-static/usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static 4 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.aarch64.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.armv7hf.hdr: -------------------------------------------------------------------------------- 1 | FROM arm32v7/ubuntu:xenial 2 | 3 | COPY scripts/build/qemu-user-static/usr/bin/qemu-arm-static /usr/bin/qemu-arm-static 4 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.armv7hf.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-asan.hdr: -------------------------------------------------------------------------------- 1 | FROM fedora:27 2 | ENV ASAN=1 3 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-asan.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.fedora.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-rawhide-aarch64.hdr: -------------------------------------------------------------------------------- 1 | FROM arm64v8/fedora:rawhide 2 | 3 | COPY scripts/build/qemu-user-static/usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static 4 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-rawhide-aarch64.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.fedora.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-rawhide.hdr: -------------------------------------------------------------------------------- 1 | FROM fedora:rawhide 2 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.fedora-rawhide.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.fedora.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.ppc64le.hdr: -------------------------------------------------------------------------------- 1 | FROM ppc64le/ubuntu:xenial 2 | 3 | ENV QEMU_CPU POWER8 4 | COPY scripts/build/qemu-user-static/usr/bin/qemu-ppc64le-static /usr/bin/qemu-ppc64le-static 5 | RUN sed -i '/security/ d' /etc/apt/sources.list 6 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.ppc64le.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.s390x.hdr: -------------------------------------------------------------------------------- 1 | FROM s390x/debian:jessie-backports 2 | 3 | ENV QEMU_CPU z900 4 | COPY scripts/build/qemu-user-static/usr/bin/qemu-s390x-static /usr/bin/qemu-s390x-static 5 | # The security repository does not seem to exist anymore 6 | RUN sed -i '/security/ d' /etc/apt/sources.list 7 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.s390x.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.tmpl -------------------------------------------------------------------------------- /scripts/build/Dockerfile.x86_64.hdr: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | 3 | RUN apt-get update -qq && apt-get install -qq \ 4 | gcc-multilib 5 | -------------------------------------------------------------------------------- /scripts/build/Dockerfile.x86_64.tmpl: -------------------------------------------------------------------------------- 1 | Dockerfile.tmpl -------------------------------------------------------------------------------- /scripts/crit-setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup(name = "crit", 4 | version = "0.0.1", 5 | description = "CRiu Image Tool", 6 | author = "CRIU team", 7 | author_email = "criu@openvz.org", 8 | url = "https://github.com/xemul/criu", 9 | package_dir = {'pycriu': 'lib/py'}, 10 | packages = ["pycriu", "pycriu.images"], 11 | scripts = ["crit/crit"] 12 | ) 13 | -------------------------------------------------------------------------------- /scripts/fake-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # A stupid script to abort restore at the very end. Useful to test 4 | # restore w/o letting the restored processes continue running. E.g. 5 | # can be used to measure the restore time. 6 | # 7 | # Usage: 8 | # criu restore --action-script $(pwd)/scripts/fake-restore.sh 9 | # 10 | if [ "$CRTOOLS_SCRIPT_ACTION" == "post-restore" ]; then 11 | touch restore-succeeded 12 | exit 1 13 | else 14 | exit 0 15 | fi 16 | -------------------------------------------------------------------------------- /scripts/flake8.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | # W191 indentation contains tabs 3 | # E128 continuation line under-indented for visual indent 4 | # E501 line too long 5 | # E251 unexpected spaces around keyword / parameter equals 6 | # E101 indentation contains mixed spaces and tabs 7 | # E126 continuation line over-indented for hanging indent 8 | # W504 line break after binary operator 9 | ignore = W191,E128,E501,E251,E101,E126,W504 10 | -------------------------------------------------------------------------------- /scripts/nmk/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | .git-ignore 4 | -------------------------------------------------------------------------------- /scripts/nmk/README.md: -------------------------------------------------------------------------------- 1 | NMK 2 | === 3 | 4 | NMK stands for NetMaKe -- is a very simple framework for make build system. 5 | Most ideas are taken from the Linux kernel kbuild system. 6 | -------------------------------------------------------------------------------- /scripts/protobuf-gen.sh: -------------------------------------------------------------------------------- 1 | TR="y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" 2 | 3 | for x in $(sed -n '/PB_AUTOGEN_START/,/PB_AUTOGEN_STOP/ { 4 | /PB_AUTOGEN_ST/d; 5 | s/,.*$//; 6 | s/\tPB_//; 7 | p; 8 | }' criu/include/protobuf-desc.h); do 9 | x_la=$(echo $x | sed $TR) 10 | x_uf=$(echo $x | sed -nr 's/^./&#\\\ 11 | /; 12 | s/_(.)/\\\ 13 | \1#\\\ 14 | /g; 15 | p;' | \ 16 | sed -r "/^[A-Z]#\\\\\$/!{ $TR; }" | \ 17 | sed -r ':loop; N; s/#?\\\n//; t loop') 18 | echo "CR_PB_DESC($x, $x_uf, $x_la);" 19 | done 20 | -------------------------------------------------------------------------------- /scripts/travis/asan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -x 4 | 5 | cat /proc/self/mountinfo 6 | 7 | chmod 0777 test 8 | chmod 0777 test/zdtm/transition/ 9 | chmod 0777 test/zdtm/static 10 | 11 | ./test/zdtm.py run -a --keep-going -k always --parallel 4 -x zdtm/static/rtc "$@" 12 | ret=$? 13 | 14 | for i in `find / -name 'asan.log*'`; do 15 | echo $i; 16 | echo ======================================== 17 | cat $i; 18 | echo ======================================== 19 | ret=1; 20 | done; 21 | exit $ret 22 | -------------------------------------------------------------------------------- /scripts/travis/docker.env: -------------------------------------------------------------------------------- 1 | SKIP_TRAVIS_PREP=1 2 | ZDTM_OPTS=-x zdtm/static/binfmt_misc -x zdtm/static/sched_policy00 3 | CC=gcc 4 | SKIP_EXT_DEV_TEST=1 5 | -------------------------------------------------------------------------------- /scripts/travis/travis-after_success: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x -e 3 | 4 | # We only need to run the below for gcov-enabled builds 5 | test -z "$GCOV" && exit 0 6 | 7 | sudo apt-get install -qq -y lcov 8 | gem install coveralls-lcov 9 | sudo lcov --directory ../.. --capture --output-file coverage.info --ignore-errors graph 10 | coveralls-lcov coverage.info 11 | -------------------------------------------------------------------------------- /soccr/Makefile: -------------------------------------------------------------------------------- 1 | lib-name := libsoccr.a 2 | lib-y += soccr.o 3 | -------------------------------------------------------------------------------- /soccr/test/local.sh: -------------------------------------------------------------------------------- 1 | unshare -Urn sh -c 'ip link set up dev lo && make test' 2 | -------------------------------------------------------------------------------- /soccr/test/tcp-conn-v6.c: -------------------------------------------------------------------------------- 1 | tcp-conn.c -------------------------------------------------------------------------------- /soccr/test/tcp-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from __future__ import print_function 4 | import sys, socket 5 | import hashlib 6 | 7 | sk = socket.fromfd(3, socket.AF_INET, socket.SOCK_STREAM) 8 | 9 | s = sys.stdin.read() 10 | ret = sk.send(s) 11 | print("%s: send() -> %d" % (sys.argv[1], ret), file=sys.stderr) 12 | sk.shutdown(socket.SHUT_WR) 13 | m = hashlib.md5() 14 | while True: 15 | s = sk.recv((1 << 20) * 10) 16 | if not s: 17 | break 18 | print("%s: recv() -> %d" % (sys.argv[1], len(s)), file=sys.stderr) 19 | m.update(s) 20 | print(repr(m.hexdigest())) 21 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | /lib 2 | /lib64 3 | /bin 4 | /sbin 5 | /dev 6 | /dump 7 | /tmp 8 | /usr 9 | /.constructed 10 | /*.log 11 | /zdtm_ct 12 | /zdtm-tst-list 13 | /stats-restore 14 | /zdtm_mount_cgroups.lock 15 | /compel/handle_binary 16 | /umount2 17 | -------------------------------------------------------------------------------- /test/abrt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | pid=$1 4 | vpid=$2 5 | sig=$3 6 | comm=$4 7 | 8 | exec &>> /tmp/zdtm-core.log 9 | 10 | expr match "$comm" zombie00 && { 11 | cat > /dev/null 12 | exit 0 13 | } 14 | 15 | report="/tmp/zdtm-core-$pid-$comm" 16 | exec &> ${report}.txt 17 | 18 | ps axf 19 | ps -p $pid 20 | 21 | cat /proc/$pid/status 22 | ls -l /proc/$pid/fd 23 | cat /proc/$pid/maps 24 | exec 33< /proc/$pid/exe 25 | cat > $report.core 26 | 27 | echo 'bt 28 | i r 29 | disassemble $rip-0x10,$rip + 0x10 30 | ' | gdb -c $report.core /proc/self/fd/33 31 | -------------------------------------------------------------------------------- /test/compel/handle_binary_32.c: -------------------------------------------------------------------------------- 1 | handle_binary.c -------------------------------------------------------------------------------- /test/empty-netns-prep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | if [ "$CRTOOLS_SCRIPT_ACTION" == "setup-namespaces" ]; then 6 | echo "Will up lo at $CRTOOLS_INIT_PID netns" 7 | mkdir -p /var/run/netns 8 | mount -t tmpfs xxx /var/run/netns 9 | touch /var/run/netns/emptyns 10 | mount --bind /proc/$CRTOOLS_INIT_PID/ns/net /var/run/netns/emptyns 11 | ip netns exec emptyns ip link set up dev lo || exit 1 12 | ip netns exec emptyns ip a 13 | umount -l /var/run/netns 14 | fi 15 | 16 | exit 0 17 | -------------------------------------------------------------------------------- /test/groups.desc: -------------------------------------------------------------------------------- 1 | { 'dir': 'groups/', 'exclude': [ ] } 2 | -------------------------------------------------------------------------------- /test/inhfd.desc: -------------------------------------------------------------------------------- 1 | { 'dir': 'inhfd/', 'exclude': [ ] } 2 | -------------------------------------------------------------------------------- /test/inhfd/fifo.py.desc: -------------------------------------------------------------------------------- 1 | { 'flavor': 'h' } 2 | -------------------------------------------------------------------------------- /test/inhfd/pipe.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | def create_fds(): 5 | pipes = [] 6 | for i in range(10): 7 | (fd1, fd2) = os.pipe() 8 | pipes.append((os.fdopen(fd2, "wb"), os.fdopen(fd1, "rb"))) 9 | return pipes 10 | 11 | 12 | def filename(pipef): 13 | return 'pipe:[%d]' % os.fstat(pipef.fileno()).st_ino 14 | 15 | 16 | def dump_opts(sockf): 17 | return [] 18 | -------------------------------------------------------------------------------- /test/inhfd/pipe.py.desc: -------------------------------------------------------------------------------- 1 | { 'flavor': 'h' } 2 | -------------------------------------------------------------------------------- /test/inhfd/socket.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import os 3 | 4 | 5 | def create_fds(): 6 | (sk1, sk2) = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM) 7 | (sk3, sk4) = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM) 8 | return [(sk1.makefile("wb"), sk2.makefile("rb")), 9 | (sk3.makefile("wb"), sk4.makefile("rb"))] 10 | 11 | 12 | def __sock_ino(sockf): 13 | return os.fstat(sockf.fileno()).st_ino 14 | 15 | 16 | def filename(sockf): 17 | return 'socket:[%d]' % __sock_ino(sockf) 18 | 19 | 20 | def dump_opts(sockf): 21 | return ['--external', 'unix[%d]' % __sock_ino(sockf)] 22 | -------------------------------------------------------------------------------- /test/inhfd/socket.py.desc: -------------------------------------------------------------------------------- 1 | { 'flavor': 'h' } 2 | -------------------------------------------------------------------------------- /test/inhfd/tty.py.desc: -------------------------------------------------------------------------------- 1 | { 'flavor': 'h' } 2 | -------------------------------------------------------------------------------- /test/jenkins/_run_ct: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | mount --make-rslave / 5 | umount -l /proc 6 | mount -t proc proc /proc/ 7 | mount -t binfmt_misc none /proc/sys/fs/binfmt_misc/ 8 | exec "$@" 9 | -------------------------------------------------------------------------------- /test/jenkins/actions.sh: -------------------------------------------------------------------------------- 1 | # Check how crit de/encodes images 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | # prep 5 | rm -f actions_called.txt 6 | ./test/zdtm.py run -t zdtm/static/env00 --script "$(pwd)/test/show_action.sh" || fail 7 | ./test/check_actions.py || fail 8 | exit 0 9 | -------------------------------------------------------------------------------- /test/jenkins/crit.sh: -------------------------------------------------------------------------------- 1 | # Check how crit de/encodes images 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | ./test/zdtm.py run --all -f best -x maps04 -x cgroup02 --norst --keep-img always || fail 6 | PYTHONPATH="$(pwd)/lib/" ./test/crit-recode.py || fail 7 | exit 0 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-btrfs.sh: -------------------------------------------------------------------------------- 1 | # This is a job which is executed on btrfs 2 | 3 | source `dirname $0`/criu-lib.sh && 4 | prep && 5 | make -C test -j 4 ZDTM_ARGS="-C -x '\(maps04\|mountpoints\|inotify_irmap\)'" zdtm && 6 | true || fail 7 | -------------------------------------------------------------------------------- /test/jenkins/criu-by-id.sh: -------------------------------------------------------------------------------- 1 | echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/cpu.rt_runtime_us 2 | echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/jenkins.service/cpu.rt_runtime_us 3 | git checkout -f ${TEST_COMMIT} 4 | git clean -dfx && 5 | make -j 4 && make -j 4 -C test/zdtm && 6 | mkdir -p test/dump && 7 | mount -t tmpfs zdtm test/dump && 8 | make -C test -j 4 zdtm_ns && 9 | true || { 10 | tar -czf /home/criu-by-id-${TEST_COMMIT}-$(date +%m%d%H%M).tar.gz . 11 | exit 1 12 | } 13 | -------------------------------------------------------------------------------- /test/jenkins/criu-dump.sh: -------------------------------------------------------------------------------- 1 | # Check that dump is not destructive 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --norst -x 'maps04' -x 'cgroup02' || fail 7 | -------------------------------------------------------------------------------- /test/jenkins/criu-groups.sh: -------------------------------------------------------------------------------- 1 | # Make one regular C/R cycle over randomly-generated groups 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py group --max 32 -x maps04 -x cgroup || fail 7 | ./test/zdtm.py --set groups run --all --keep-going --report report -f best || fail 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-inhfd.sh: -------------------------------------------------------------------------------- 1 | # Check known fault injections 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | ./test//zdtm.py --set inhfd run --all --keep-going --report report -f h || fail 6 | -------------------------------------------------------------------------------- /test/jenkins/criu-iter.sh: -------------------------------------------------------------------------------- 1 | # Make 3 iteration of dump/restore for each test 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --iter 3 -x 'maps04' || fail 7 | -------------------------------------------------------------------------------- /test/jenkins/criu-join-ns.sh: -------------------------------------------------------------------------------- 1 | # Make one regular C/R cycle 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mkdir -p /var/run/netns 6 | mount -t tmpfs zdtm_run /var/run/netns 7 | ./test/zdtm.py run --all --keep-going --report report --join-ns || fail 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-lazy-common.sh: -------------------------------------------------------------------------------- 1 | KERN_MAJ=`uname -r | cut -d. -f1` 2 | KERN_MIN=`uname -r | cut -d. -f2` 3 | if [ $KERN_MAJ -ge "4" ] && [ $KERN_MIN -ge "11" ]; then 4 | LAZY_EXCLUDE="-x cmdlinenv00 -x maps007" 5 | else 6 | LAZY_EXCLUDE="-x maps007 -x fork -x fork2 -x uffd-events -x cgroupns 7 | -x socket_listen -x socket_listen6 -x cmdlinenv00 8 | -x socket_close_data01 -x file_read" 9 | fi 10 | 11 | LAZY_EXCLUDE="$LAZY_EXCLUDE -x maps04" 12 | -------------------------------------------------------------------------------- /test/jenkins/criu-lazy-pages.sh: -------------------------------------------------------------------------------- 1 | # Check lazy-pages 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | 6 | source `dirname $0`/criu-lazy-common.sh 7 | 8 | # lazy restore from images 9 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 \ 10 | --lazy-pages $LAZY_EXCLUDE || fail 11 | 12 | # During pre-dump + lazy-pages we leave VM_NOHUGEPAGE set 13 | LAZY_EXCLUDE="$LAZY_EXCLUDE -x maps02" 14 | 15 | # lazy restore from images with pre-dumps 16 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 \ 17 | --lazy-pages --pre 2 $LAZY_EXCLUDE || fail 18 | -------------------------------------------------------------------------------- /test/jenkins/criu-other.sh: -------------------------------------------------------------------------------- 1 | source `dirname $0`/criu-lib.sh && 2 | prep && 3 | make -C test other && 4 | true || fail 5 | -------------------------------------------------------------------------------- /test/jenkins/criu-overlay.sh: -------------------------------------------------------------------------------- 1 | # Make one regular C/R cycle 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mkdir -p test.up test.work 6 | mount -t overlay overlay -olowerdir=test,upperdir=test.up,workdir=test.work test 7 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 -x inotify -x mntns_open -x socket -x sk-unix -x unlink -x fsnotify -x fanotify -x ghost || fail 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-pre-dump.sh: -------------------------------------------------------------------------------- 1 | # Check 3 pre-dump-s before dump (with and w/o page server) 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --pre 3 -x 'maps04' || fail 7 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --pre 3 --page-server -x 'maps04' || fail 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-sibling.sh: -------------------------------------------------------------------------------- 1 | # Make 3 iteration of dump/restore for each test 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --sibling --parallel 4 -x 'maps04' || fail 7 | -------------------------------------------------------------------------------- /test/jenkins/criu-snap.sh: -------------------------------------------------------------------------------- 1 | # Check snapshots 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --pre 3 --snaps -x 'maps04' || fail 7 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --pre 3 --snaps --page-server -x 'maps04' || fail 8 | -------------------------------------------------------------------------------- /test/jenkins/criu-stop.sh: -------------------------------------------------------------------------------- 1 | # Check --leave-stopped option 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | ./test/zdtm.py run -t zdtm/transition/fork --stop --iter 3 || fail 6 | -------------------------------------------------------------------------------- /test/jenkins/criu-user.sh: -------------------------------------------------------------------------------- 1 | # Make 3 iteration of dump/restore for each test 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | mount_tmpfs_to_dump 6 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 --user -x 'maps04' || fail 7 | -------------------------------------------------------------------------------- /test/jenkins/criu.sh: -------------------------------------------------------------------------------- 1 | # Make one regular C/R cycle 2 | set -e 3 | source `dirname $0`/criu-lib.sh 4 | prep 5 | ./test/zdtm.py run --all --keep-going --report report --parallel 4 || fail 6 | -------------------------------------------------------------------------------- /test/jenkins/run_ct: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | unshare --mount --pid --fork -- $(readlink -f `dirname $0`/_run_ct) "$@" 4 | -------------------------------------------------------------------------------- /test/others/app-emu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_LIST=" 4 | vnc 5 | java/HelloWorld 6 | screen 7 | tarbz 8 | make 9 | " 10 | 11 | [ -n "$1" ] && TEST_LIST="$1" 12 | 13 | BASE_DIR=`pwd`/`dirname $0` 14 | 15 | for t in $TEST_LIST; do 16 | dir=$BASE_DIR/app-emu/$t 17 | log=$dir/run.log 18 | ( 19 | cd $dir 20 | bash ./run.sh 21 | ) 2>&1 | tee $log 22 | grep PASS $log || { 23 | echo "Test: $t" 24 | echo "====================== ERROR ======================" 25 | echo "Run log : $log" 26 | echo "$t " 27 | exit 1 28 | } 29 | done 30 | -------------------------------------------------------------------------------- /test/others/app-emu/java/HelloWorld/HelloWorld.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Trivial program which requires no 3 | * additional imports 4 | */ 5 | public class HelloWorld { 6 | public static void main(String[] args) { 7 | int nr_sleeps = 5; 8 | for (;;) { 9 | System.out.println("Hello World"); 10 | if (nr_sleeps == 0) 11 | System.exit(0); 12 | try { 13 | Thread.sleep(1000); 14 | nr_sleeps--; 15 | } catch(InterruptedException ex) { 16 | Thread.currentThread().interrupt(); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/others/app-emu/job/Makefile: -------------------------------------------------------------------------------- 1 | all: job 2 | .PHONY: all 3 | 4 | %.o: %.c 5 | gcc -c $< -o $@ 6 | 7 | job: job.o 8 | gcc -o $@ job.o 9 | 10 | clean: 11 | rm -f *.o job 12 | .PHONY: clean 13 | -------------------------------------------------------------------------------- /test/others/app-emu/job/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec expect ./job.exp 4 | -------------------------------------------------------------------------------- /test/others/app-emu/make/Makefile: -------------------------------------------------------------------------------- 1 | all: foo1.o foo2.o foo3.o foo4.o 2 | echo "Done" 3 | .PHONY: all 4 | 5 | %.o: %.c 6 | gcc -c $< -o $@ 7 | 8 | foo%.c: tmpl.c 9 | cp $< $@ 10 | 11 | clean: 12 | rm -f *.o 13 | .PHONY: clean 14 | -------------------------------------------------------------------------------- /test/others/app-emu/vnc/vnc-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | set -m 4 | Xvnc :25 -v -geometry 500x500 -i 0.0.0.0 -SecurityTypes none & 5 | pid=$! 6 | trap "kill $pid; wait" EXIT 7 | for i in `seq 10`; do 8 | nc -w 1 localhost 5925 | grep -am 1 RFB && break || echo Waiting 9 | kill -0 $pid || exit 1 10 | sleep 1 11 | done 12 | kill -STOP $$ 13 | DISPLAY=:25 glxgears 14 | -------------------------------------------------------------------------------- /test/others/crit/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.log 3 | *.txt 4 | stats-* 5 | *.json 6 | -------------------------------------------------------------------------------- /test/others/crit/Makefile: -------------------------------------------------------------------------------- 1 | run: clean 2 | ./test.sh 3 | 4 | clean: 5 | rm -f *.img *.log *.txt stats-* *.json 6 | -------------------------------------------------------------------------------- /test/others/crit/loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while :; do 3 | sleep 1 4 | done 5 | -------------------------------------------------------------------------------- /test/others/criu-coredump/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.log 3 | *.txt 4 | stats-* 5 | *.json 6 | core.* 7 | -------------------------------------------------------------------------------- /test/others/criu-coredump/Makefile: -------------------------------------------------------------------------------- 1 | run: clean 2 | ./test.sh 3 | 4 | clean: 5 | rm -f *.img stats-* core.* 6 | -------------------------------------------------------------------------------- /test/others/criu-coredump/loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while :; do 3 | sleep 1 4 | done 5 | -------------------------------------------------------------------------------- /test/others/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu/criu) 4 | criu=$CRIU 5 | CRIT=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../crit/crit) 6 | crit=$CRIT 7 | CRIU_COREDUMP=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../../criu-coredump/criu-coredump) 8 | criu_coredump=$CRIU_COREDUMP 9 | -------------------------------------------------------------------------------- /test/others/exec/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ./run.sh 3 | -------------------------------------------------------------------------------- /test/others/exec/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CRIU=../../../criu/criu 4 | 5 | set -e -m -x 6 | 7 | cat < /dev/zero > /dev/null & 8 | pid=$! 9 | sleep 1 10 | lsof -p $pid 11 | 12 | $CRIU exec -t $pid fake_syscall && exit 1 || true 13 | fd=`$CRIU exec -t $pid open '&/dev/null' 0 | sed 's/.*(\(.*\))/\1/'` 14 | $CRIU exec -t $pid dup2 $fd 0 15 | wait $pid 16 | echo PASS 17 | -------------------------------------------------------------------------------- /test/others/ext-links/Makefile: -------------------------------------------------------------------------------- 1 | all: mvlink.so 2 | 3 | mvlink.so: mvlink.c 4 | gcc -g -Werror -Wall -shared -nostartfiles mvlink.c -o mvlink.so -iquote ../../../criu/include -fPIC 5 | -------------------------------------------------------------------------------- /test/others/ext-links/addmv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $1 -- link name 3 | # $2 -- file with namespace pid 4 | if [ "$CRTOOLS_SCRIPT_ACTION" == "setup-namespaces" ]; then 5 | $(dirname $0)/addmv_raw.sh $1 $(cat $2) 6 | else 7 | exit 0 8 | fi 9 | -------------------------------------------------------------------------------- /test/others/ext-links/addmv_raw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $1 -- link name 3 | # $2 -- pid of task in namespace 4 | set -x 5 | $ip link add link eth0 name $1 type macvlan || exit 1 6 | $ip link set $1 netns $2 7 | -------------------------------------------------------------------------------- /test/others/ext-links/run_ns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | echo "NS: $$" >> $outf 4 | echo "Links before:" >> $outf 5 | $ip link list >> $outf 2>&1 6 | # Detach from session, terminal and parent 7 | setsid ./run_wait.sh < /dev/null >> $outf 2>&1 & 8 | # Keep pid for future reference :) 9 | echo "$!" > $pidf 10 | exit 0 11 | -------------------------------------------------------------------------------- /test/others/ext-links/run_wait.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Wait: $$" 4 | while [ ! -e "$finf" ]; do 5 | echo "WAIT ($$)" 6 | sleep 1; 7 | done 8 | 9 | echo "Links after:" 10 | $ip link list 11 | 12 | # The mvln device (exported from run.sh) should exits in 13 | # namespace after we get restored 14 | echo "Check for $mvln:" 15 | $ip link list $mvln && echo "PASS" || echo "FAIL" 16 | -------------------------------------------------------------------------------- /test/others/functions.sh: -------------------------------------------------------------------------------- 1 | # Wait while tasks are dying, otherwise PIDs would be busy. 2 | 3 | function wait_tasks() 4 | { 5 | local dump=$1 6 | local pid 7 | 8 | for i in $dump/core-*.img; do 9 | pid=`expr "$i" : '.*/core-\([0-9]*\).img'` 10 | while :; do 11 | kill -0 $pid > /dev/null 2>&1 || break; 12 | echo Waiting the process $pid 13 | sleep 0.1 14 | done 15 | done 16 | } 17 | -------------------------------------------------------------------------------- /test/others/libcriu/.gitignore: -------------------------------------------------------------------------------- 1 | test_errno 2 | test_iters 3 | test_notify 4 | test_self 5 | test_sub 6 | wdir 7 | -------------------------------------------------------------------------------- /test/others/libcriu/Makefile: -------------------------------------------------------------------------------- 1 | TESTS += test_sub 2 | TESTS += test_self 3 | TESTS += test_notify 4 | TESTS += test_iters 5 | TESTS += test_errno 6 | 7 | all: $(TESTS) 8 | 9 | run: all 10 | ./run.sh 11 | 12 | define genb 13 | $(1): $(1).o lib.o 14 | gcc $$^ -L ../../../../criu/lib/c/ -L ../../../../criu/images/ -lcriu -o $$@ 15 | endef 16 | 17 | $(foreach t, $(TESTS), $(eval $(call genb, $(t)))) 18 | 19 | %.o: %.c 20 | gcc -c $^ -I../../../../criu/lib/c/ -I../../../../criu/images/ -o $@ -Werror 21 | 22 | clean: 23 | rm -rf $(TESTS) $(TESTS:%=%.o) lib.o 24 | 25 | .PHONY: clean 26 | .PHONY: all 27 | -------------------------------------------------------------------------------- /test/others/libcriu/lib.h: -------------------------------------------------------------------------------- 1 | void what_err_ret_mean(int ret); 2 | int chk_exit(int status, int want); 3 | -------------------------------------------------------------------------------- /test/others/make/Makefile: -------------------------------------------------------------------------------- 1 | # Tests for the build system 2 | 3 | run: 4 | ./uninstall.sh 5 | .PHONY: run 6 | -------------------------------------------------------------------------------- /test/others/make/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # A test to make sure "make uninstall" works as intended. 3 | 4 | set -e 5 | SELFDIR=$(dirname $(readlink -f $0)) 6 | DESTDIR=$SELFDIR/test.install-$$ 7 | cd $SELFDIR/../../.. 8 | 9 | set -x 10 | make install DESTDIR=$DESTDIR 11 | make uninstall DESTDIR=$DESTDIR 12 | set +x 13 | 14 | # There should be no files left (directories are OK for now) 15 | if [ $(find $DESTDIR -type f | wc -l) -gt 0 ]; then 16 | echo "Files left after uninstall:" 17 | find $DESTDIR -type f 18 | echo "FAIL" 19 | exit 1 20 | fi 21 | 22 | echo PASS 23 | -------------------------------------------------------------------------------- /test/others/mem-snap/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ./run.sh 3 | -------------------------------------------------------------------------------- /test/others/mem-snap/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Don't execute tests, which use maps04, they are executed by zdtm 4 | 5 | set -e 6 | 7 | #./run-predump-2.sh 8 | ./run-predump.sh 9 | ./run-snap-auto-dedup.sh 10 | ./run-snap-dedup-on-restore.sh 11 | ./run-snap-dedup.sh 12 | #./run-snap-maps04.sh 13 | ./run-snap.sh 14 | -------------------------------------------------------------------------------- /test/others/mnt-ext-dev/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ./run.sh 3 | -------------------------------------------------------------------------------- /test/others/mnt-ext-dev/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e -x 3 | 4 | # construct root 5 | python ../../zdtm.py run -t zdtm/static/env00 --iter 0 -f ns 6 | 7 | truncate -s 0 zdtm.loop 8 | truncate -s 50M zdtm.loop 9 | mkfs.ext4 -F zdtm.loop 10 | dev=`losetup --find --show zdtm.loop` 11 | mkdir -p ../../dev 12 | cp -ap $dev ../../dev 13 | export ZDTM_MNT_EXT_DEV=$dev 14 | python ../../zdtm.py run -t zdtm/static/mnt_ext_dev || ret=$? 15 | losetup -d $dev 16 | unlink zdtm.loop 17 | exit $ret 18 | -------------------------------------------------------------------------------- /test/others/mounts/ext/Makefile: -------------------------------------------------------------------------------- 1 | all: ext-mount.so ns_init 2 | 3 | ext-mount.so: ext-mount.c 4 | gcc -g -Werror -Wall -shared -nostartfiles ext-mount.c -o ext-mount.so -iquote ../../../include -fPIC 5 | 6 | ns_init: ns_init.o 7 | gcc -static $< -o $@ 8 | 9 | ns_init.o: ns_init.c 10 | gcc -c $< -o $@ 11 | 12 | run: all 13 | ./run.sh 14 | -------------------------------------------------------------------------------- /test/others/mounts/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CRIU=../../../criu/criu 4 | set -x 5 | 6 | mkdir -p dump 7 | 8 | ./mounts.sh 9 | pid=`cat mounts.pid` 10 | kill -0 $pid || exit 11 | 12 | cat /proc/$pid/mountinfo | sort -k 4 13 | echo "Suspend server" 14 | ${CRIU} dump -D dump -o dump.log -t $pid -v4 || { 15 | cat dump/dump.log | grep Error 16 | exit 1 17 | } 18 | echo "Resume server" 19 | ${CRIU} restore -d -D dump -o restore.log -v4 || { 20 | cat dump/dump.log | grep Error 21 | exit 1 22 | } 23 | cat /proc/$pid/mountinfo | sort -k 4 24 | kill $pid 25 | -------------------------------------------------------------------------------- /test/others/netns_ext/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ./run.sh 3 | -------------------------------------------------------------------------------- /test/others/netns_ext/_run.sh: -------------------------------------------------------------------------------- 1 | echo $$ > $1 2 | while :; do 3 | sleep 1 4 | done 5 | -------------------------------------------------------------------------------- /test/others/overlayfs/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ./run.sh 3 | 4 | clean: 5 | umount -f overlay_test/z 6 | rm -rf overlay_test output checkpoint 7 | -------------------------------------------------------------------------------- /test/others/pipes/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -Wall 2 | pipe: pipe.c 3 | clean: 4 | rm -f pipe 5 | run: pipe 6 | ./pipe - && \ 7 | ./pipe -c && \ 8 | ./pipe -cl && \ 9 | ./pipe -d && \ 10 | ./pipe -o && \ 11 | ./pipe -r && \ 12 | ./pipe -dc && \ 13 | ./pipe -dcl && \ 14 | true 15 | -------------------------------------------------------------------------------- /test/others/rpc/.gitignore: -------------------------------------------------------------------------------- 1 | rpc.pb-c.* 2 | *_pb2.py 3 | test-c 4 | -------------------------------------------------------------------------------- /test/others/rpc/loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while :; do 3 | sleep 1 4 | done 5 | -------------------------------------------------------------------------------- /test/others/rpc/read.py: -------------------------------------------------------------------------------- 1 | # This script is used to read a single character from CRIU's status FD. 2 | # That way we know when the CRIU service is ready. CRIU writes a \0 to 3 | # the status FD. 4 | # In theory this could be easily done using 'read -n 1' from bash, but 5 | # but the bash version on Ubuntu has probably the following bug: 6 | # https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html 7 | 8 | import sys 9 | 10 | f = open(sys.argv[1]) 11 | r = f.read(1) 12 | f.close() 13 | 14 | if r == '\0': 15 | sys.exit(0) 16 | 17 | sys.exit(-1) 18 | -------------------------------------------------------------------------------- /test/others/rpc/rpc.proto: -------------------------------------------------------------------------------- 1 | ../../../images/rpc.proto -------------------------------------------------------------------------------- /test/others/security/loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $$ > $1.int 4 | mv $1.int $1 5 | 6 | if [ "$2" == "--chgrp" ]; then 7 | grps=( $(groups) ) 8 | newgrp ${grps[2]} 9 | fi 10 | 11 | while :; do 12 | sleep 1 13 | done 14 | -------------------------------------------------------------------------------- /test/others/shell-job/Makefile: -------------------------------------------------------------------------------- 1 | run: 2 | ../../zdtm_ct run.py 3 | -------------------------------------------------------------------------------- /test/others/socketpairs/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS += -Wall 2 | socketpair: socketpair.c 3 | clean: 4 | rm -f socketpair 5 | run: socketpair 6 | ./socketpair && \ 7 | ./socketpair -v && \ 8 | ./socketpair -m4 && \ 9 | true 10 | -------------------------------------------------------------------------------- /test/others/tcp/Makefile: -------------------------------------------------------------------------------- 1 | OBJS=cln srv 2 | 3 | all: $(OBJS) 4 | .PHONY: all 5 | 6 | run: all 7 | ./run.sh 8 | 9 | clean: 10 | rm -f $(OBJS) 11 | .PHONY: clean 12 | -------------------------------------------------------------------------------- /test/others/unix-callback/lib/syslog-lib.so: -------------------------------------------------------------------------------- 1 | ../syslog-lib.so -------------------------------------------------------------------------------- /test/others/unix-callback/lib/unix-lib.so: -------------------------------------------------------------------------------- 1 | ../unix-lib.so -------------------------------------------------------------------------------- /test/others/unix-callback/unix.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message unix_test { 4 | required uint32 val = 1; 5 | required bytes name = 2; 6 | } 7 | -------------------------------------------------------------------------------- /test/pycriu: -------------------------------------------------------------------------------- 1 | ../lib/py/ -------------------------------------------------------------------------------- /test/show_action.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "${CRTOOLS_SCRIPT_ACTION} ${CRTOOLS_IMAGE_DIR} ${CRTOOLS_INIT_PID}" \ 3 | >> "$(dirname $0)/actions_called.txt" 4 | -------------------------------------------------------------------------------- /test/umount2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | if (argc < 2) { 7 | fprintf(stderr, "umount PATH\n"); 8 | return 1; 9 | } 10 | if (umount2(argv[1], MNT_DETACH)) { 11 | fprintf(stderr, "umount %s: %m\n", argv[1]); 12 | return 1; 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /test/zdtm.desc: -------------------------------------------------------------------------------- 1 | { 'dir': 'zdtm/', 'exclude': [ 'static/route_rules', 'static/criu-rtc.so', 'lib/parseargs.sh', 'lib/stop_and_chk.sh' ] } 2 | -------------------------------------------------------------------------------- /test/zdtm/.gitignore: -------------------------------------------------------------------------------- 1 | /lib/libzdtmtst.a 2 | /lib/.gitignore 3 | /static/.gitignore 4 | /transition/.gitignore 5 | 6 | *.pid 7 | *.pidns 8 | *.out 9 | *.outns 10 | *.out.external 11 | *.inprogress 12 | *.test 13 | *.test.* 14 | *.state 15 | -------------------------------------------------------------------------------- /test/zdtm/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS := lib static transition 2 | 3 | all: $(SUBDIRS) 4 | .PHONY: all $(SUBDIRS) 5 | 6 | $(SUBDIRS): 7 | $(MAKE) -C $@ all 8 | 9 | static: lib 10 | transition: lib 11 | 12 | %: 13 | set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done 14 | -------------------------------------------------------------------------------- /test/zdtm/lib/groups.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto', 'deps': [ '/bin/sh', '/bin/kill', '/bin/cat' ]} 2 | -------------------------------------------------------------------------------- /test/zdtm/lib/ns.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZDTM_NS__ 2 | #define __ZDTM_NS__ 3 | 4 | #include "lock.h" 5 | 6 | extern futex_t sig_received; 7 | extern char *pidfile; 8 | 9 | extern void ns_create(int argc, char **argv); 10 | extern int ns_init(int argc, char **argv); 11 | 12 | extern void test_waitsig(void); 13 | extern void parseargs(int, char **); 14 | 15 | extern int init_notify(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /test/zdtm/static/aio00.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'aio_remap', 'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/aio01.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'aio_remap', 'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/apparmor.checkskip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | test -d /sys/kernel/security/apparmor || exit 1 4 | apparmor_parser -r `dirname $0`/apparmor.profile 5 | -------------------------------------------------------------------------------- /test/zdtm/static/apparmor.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/apparmor.profile: -------------------------------------------------------------------------------- 1 | # vim:syntax=apparmor 2 | 3 | profile criu_test { 4 | /** rwmlkix, 5 | capability, 6 | unix, 7 | signal, 8 | } 9 | -------------------------------------------------------------------------------- /test/zdtm/static/arm-neon00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/autofs.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'autofs', 'flavor': 'ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/bind-mount.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/binfmt_misc.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags': 'excl suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/binfmt_misc.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" ] || exit 0 4 | 5 | name=$(basename -s .hook $0).test 6 | 7 | tname=$(mktemp -d binfmt_misc.XXXXXX) 8 | mount -t binfmt_misc none $tname 9 | 10 | echo "Cleaning $name: $@" 11 | set +e 12 | if [ -e $tname/${name}_magic ]; then 13 | echo -1 > $tname/${name}_magic 14 | fi 15 | 16 | if [ -e $tname/${name}_extension ]; then 17 | echo -1 > $tname/${name}_extension 18 | fi 19 | set -e 20 | 21 | umount "$tname" 22 | rmdir "$tname" 23 | -------------------------------------------------------------------------------- /test/zdtm/static/bridge.desc: -------------------------------------------------------------------------------- 1 | { 'deps': [ '/bin/sh', 2 | '/usr/bin/sort', 3 | '/bin/grep', 4 | '/sbin/ip|/bin/ip', 5 | '/usr/bin/diff'], 6 | 'flags': 'suid', 7 | 'flavor': 'ns uns'} 8 | -------------------------------------------------------------------------------- /test/zdtm/static/busyloop00.c: -------------------------------------------------------------------------------- 1 | #include "zdtmtst.h" 2 | 3 | const char *test_doc = "Run busy loop while migrating"; 4 | const char *test_author = "Roman Kagan "; 5 | 6 | int main(int argc, char ** argv) 7 | { 8 | test_init(argc, argv); 9 | 10 | test_daemon(); 11 | 12 | while (test_go()) 13 | ; 14 | 15 | pass(); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/zdtm/static/caps00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid', 'opts': '--manage-cgroups'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup00.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0 4 | 5 | set -e 6 | 7 | tname=$(mktemp -d cgclean.XXXXXX) 8 | mount -t cgroup none $tname -o "none,name=zdtmtst" 9 | 10 | echo "Cleaning $tname" 11 | 12 | set +e 13 | rmdir "$tname/subcg00/subsubcg/" 14 | rmdir "$tname/subcg00/" 15 | set -e 16 | 17 | echo "Left there is:" 18 | ls "$tname" 19 | umount "$tname" 20 | rmdir "$tname" 21 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid', 'opts': '--manage-cgroups'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup01.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0 4 | 5 | set -e 6 | 7 | tname=$(mktemp -d cgclean.XXXXXX) 8 | mount -t cgroup none $tname -o "none,name=zdtmtst" 9 | 10 | echo "Cleaning $tname" 11 | 12 | set +e 13 | rmdir "$tname/subcg01/empty.0/" 14 | rmdir "$tname/subcg01/empty.1/" 15 | rmdir "$tname/subcg01/" 16 | set -e 17 | 18 | echo "Left there is:" 19 | ls "$tname" 20 | umount "$tname" 21 | rmdir "$tname" 22 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup02.desc: -------------------------------------------------------------------------------- 1 | { 'dopts': '--manage-cgroups --cgroup-root name=zdtmtst:/prefix', 2 | 'flags': 'suid', 3 | 'flavor': 'h', 4 | 'ropts': '--manage-cgroups --cgroup-root /newroot --cgroup-root name=zdtmtst:/prefix'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup03.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid excl', 'opts': '--manage-cgroups'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup03.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0 4 | 5 | tname=$(mktemp -d cgclean.XXXXXX) 6 | mount -t cgroup none $tname -o "none,name=zdtmtst" 7 | 8 | echo "Cleaning $tname" 9 | set +e 10 | rmdir "$tname/test" 11 | set -e 12 | 13 | umount "$tname" 14 | rmdir "$tname" 15 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup04.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid excl', 'opts': '--manage-cgroups=full'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup04.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0 4 | 5 | tname=$(mktemp -d cgclean.XXXXXX) 6 | mount -t cgroup none $tname -o "devices" 7 | 8 | echo "Cleaning $tname" 9 | set +e 10 | rmdir "$tname/zdtmtst/special_prop_check" 11 | rmdir "$tname/zdtmtst" 12 | set -e 13 | 14 | umount "$tname" 15 | rmdir "$tname" 16 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup_ifpriomap.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid excl', 'opts': '--manage-cgroups=full'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroup_stray.desc: -------------------------------------------------------------------------------- 1 | { 'feature': 'cgroupns', 2 | 'flags': 'suid', 3 | 'flavor': 'h ns', 4 | 'opts': '--manage-cgroups'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/cgroupns.desc: -------------------------------------------------------------------------------- 1 | { 'feature': 'cgroupns', 2 | 'flags': 'suid', 3 | 'flavor': 'h', 4 | 'opts': '--manage-cgroups'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/chroot-file.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/chroot.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/clean_mntns.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "zdtmtst.h" 6 | 7 | const char *test_doc = "Check that clean mntns works"; 8 | const char *test_author = "Pavel Emelianov "; 9 | 10 | int main(int argc, char **argv) 11 | { 12 | test_init(argc, argv); 13 | 14 | if (umount("/proc") < 0) 15 | pr_perror("Can't umount proc"); 16 | 17 | if (umount("/dev/pts") < 0) 18 | pr_perror("Can't umount devpts"); 19 | 20 | test_daemon(); 21 | test_waitsig(); 22 | 23 | pass(); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /test/zdtm/static/clean_mntns.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cmdlinenv00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/config_inotify_irmap.desc: -------------------------------------------------------------------------------- 1 | (lambda confpath: 2 | {'flags': 'suid', 'opts': '--config %s' % (confpath) 3 | }) (os.path.abspath('./zdtm_test_config.conf')) 4 | -------------------------------------------------------------------------------- /test/zdtm/static/conntracks.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/console.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cow00.desc: -------------------------------------------------------------------------------- 1 | # /proc/pid/pagemap doesn't show phys addr for unprivileged users 2 | {'flavor': 'ns h', 'flags': 'suid nolazy'} 3 | -------------------------------------------------------------------------------- /test/zdtm/static/cow01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid nolazy'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/cr_veth.checkskip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | unshare --net ip link add type veth 3 | -------------------------------------------------------------------------------- /test/zdtm/static/cr_veth.desc: -------------------------------------------------------------------------------- 1 | { 'deps': ['/bin/sh', '/bin/sed', '/bin/grep', '/sbin/ip|/bin/ip', '/usr/bin/diff'], 2 | 'flags': 'suid', 3 | 'flavor': 'ns uns', 4 | 'ropts': '--external veth[zdtmvthc0]:zdtmvthh0@zdtmbr0'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/criu-rtc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | message criu_rtc { 4 | required uint64 IRQP = 1; 5 | } 6 | -------------------------------------------------------------------------------- /test/zdtm/static/del_standalone_un.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/deleted_dev.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/different_creds.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/dumpable02.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/epoll.desc: -------------------------------------------------------------------------------- 1 | { 'feature' : 'kcmp_epoll' } 2 | -------------------------------------------------------------------------------- /test/zdtm/static/fanotify00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/fd01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_fown.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_lease00.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'fdinfo_lock', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_lease01.desc: -------------------------------------------------------------------------------- 1 | file_lease00.desc -------------------------------------------------------------------------------- /test/zdtm/static/file_lease02.desc: -------------------------------------------------------------------------------- 1 | file_lease00.desc -------------------------------------------------------------------------------- /test/zdtm/static/file_lease03.desc: -------------------------------------------------------------------------------- 1 | file_lease00.desc -------------------------------------------------------------------------------- /test/zdtm/static/file_lease04.desc: -------------------------------------------------------------------------------- 1 | file_lease00.desc -------------------------------------------------------------------------------- /test/zdtm/static/file_locks00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks03.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks04.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks', 'feature': 'fdinfo_lock'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks05.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks06.checkskip: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import fcntl 3 | import tempfile 4 | import struct 5 | import errno 6 | 7 | F_OFD_SETLK = 37 8 | 9 | try: 10 | with tempfile.TemporaryFile() as fd: 11 | flock = struct.pack('hhllhh', fcntl.F_RDLCK, 0, 0, 0, 0, 0) 12 | fcntl.fcntl(fd.fileno(), F_OFD_SETLK, flock) 13 | except IOError as e: 14 | if e.errno == errno.EINVAL: 15 | print("I/O error({0}): {1}".format(e.errno, e.strerror)) 16 | print("OFD locks are not supported.") 17 | exit(1) 18 | 19 | exit(0) 20 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks06.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks07.checkskip: -------------------------------------------------------------------------------- 1 | file_locks06.checkskip -------------------------------------------------------------------------------- /test/zdtm/static/file_locks07.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/file_locks08.checkskip: -------------------------------------------------------------------------------- 1 | file_locks06.checkskip -------------------------------------------------------------------------------- /test/zdtm/static/file_locks08.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'excl', 'opts': '--file-locks'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/fpu00.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/fpu01.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/fpu02.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/get_smaps_bits.h: -------------------------------------------------------------------------------- 1 | #ifndef ZDTM_GET_SMAPS_BITS_H_ 2 | #define ZDTM_GET_SMAPS_BITS_H_ 3 | 4 | extern int get_smaps_bits(unsigned long where, unsigned long *flags, unsigned long *madv); 5 | 6 | #endif /* ZDTM_GET_SMAPS_BITS_H_ */ 7 | -------------------------------------------------------------------------------- /test/zdtm/static/ghost_holes01.c: -------------------------------------------------------------------------------- 1 | ghost_holes00.c -------------------------------------------------------------------------------- /test/zdtm/static/ghost_holes02.c: -------------------------------------------------------------------------------- 1 | ghost_holes00.c -------------------------------------------------------------------------------- /test/zdtm/static/groups.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/grow_map.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/grow_map02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/grow_map03.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/helper_zombie_child.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify00.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--link-remap', 'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify01.c: -------------------------------------------------------------------------------- 1 | inotify00.c -------------------------------------------------------------------------------- /test/zdtm/static/inotify01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify_irmap.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'opts' : '--force-irmap --irmap-scan-path /zdtm/static'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify_irmap.hook: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | umask 0000 4 | 5 | [ "$1" = "--pre-restore" ] && { 6 | exit 7 | # emulate rsync 8 | rm -rf etc/zdtm-test 9 | touch etc/zdtm-test 10 | } 11 | 12 | [ "$1" = "--post-pre-dump" ] && { 13 | echo 'invalidate the irmap cache' 14 | mv etc/zdtm-test etc/zdtm-test2 15 | mv etc/zdtm-test1 etc/zdtm-test 16 | mv etc/zdtm-test2 etc/zdtm-test1 17 | } 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify_system.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/inotify_system_nodel.c: -------------------------------------------------------------------------------- 1 | inotify_system.c -------------------------------------------------------------------------------- /test/zdtm/static/inotify_system_nodel.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/ipc_namespace.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags' : 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/lib/criu-rtc.so: -------------------------------------------------------------------------------- 1 | ../criu-rtc.so -------------------------------------------------------------------------------- /test/zdtm/static/loginuid.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'loginuid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/macvlan.desc: -------------------------------------------------------------------------------- 1 | { 'deps': [ '/bin/sh', 2 | '/usr/bin/sort', 3 | '/bin/grep', 4 | '/sbin/ip|/bin/ip', 5 | '/usr/bin/diff'], 6 | 'flags': 'suid', 7 | 'flavor': 'ns uns', 8 | 'ropts': '--external macvlan[zdtmmvlan0]:zdtmbr0'} 9 | -------------------------------------------------------------------------------- /test/zdtm/static/maps01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/maps03.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/maps04.desc: -------------------------------------------------------------------------------- 1 | {'timeout': '60'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mem-touch.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mlock_setuid.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mmx00.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_enablefs.checkskip: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | unshare -m --propagation private mount -t nfsd nfsd /mnt 4 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_enablefs.desc: -------------------------------------------------------------------------------- 1 | { 'feature': 'mnt_id', 2 | 'flags': 'suid', 3 | 'flavor': 'ns', 4 | 'opts': '--enable-fs nfsd'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ext_auto.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'feature': 'mnt_id', 'opts': '--external mnt[]:s'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ext_dev.desc: -------------------------------------------------------------------------------- 1 | os.getenv("ZDTM_MNT_EXT_DEV") and \ 2 | ( lambda dev, rdev: 3 | {'flavor': 'ns', 'feature': 'mnt_id', "flags": "suid", 4 | "dopts": "--external dev[%d/%d]:loop" % (os.major(rdev), os.minor(rdev)), 5 | "ropts": "--external dev[loop]:%s" % dev, 6 | } ) (os.getenv("ZDTM_MNT_EXT_DEV"), os.stat(os.getenv("ZDTM_MNT_EXT_DEV")).st_rdev) or {'flags': 'noauto'} 7 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ext_manual.c: -------------------------------------------------------------------------------- 1 | mnt_ext_auto.c -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ext_manual.desc: -------------------------------------------------------------------------------- 1 | { 'dopts': '--external mnt[/zdtm/static/mnt_ext_manual.test]:ZDTM', 2 | 'feature': 'mnt_id', 3 | 'flavor': 'ns uns', 4 | 'ropts': '--external mnt[ZDTM]:/tmp/zdtm_ext_auto.XXXXXX/mtest'} 5 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ext_master.desc: -------------------------------------------------------------------------------- 1 | { 'feature': 'mnt_id', 2 | 'flavor': 'ns uns', 3 | 'opts': '--ext-mount-map auto --enable-external-masters'} 4 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_ro_bind.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_tracefs.checkskip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # tracefs is automatically mounted under debugfs if the kernel has it, so we 4 | # just need to check for a file in the tracing directory. 5 | test -f /sys/kernel/debug/tracing/README || exit 1 6 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_tracefs.desc: -------------------------------------------------------------------------------- 1 | { 'feature': 'mnt_id', 2 | 'flavor': 'uns', 3 | 'opts': '--ext-mount-map auto --enable-external-masters'} 4 | -------------------------------------------------------------------------------- /test/zdtm/static/mnt_tracefs.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--clean" ] || exit 0 4 | 5 | rmdir zdtm/static/mnt_tracefs.test 6 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns-deleted-dst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillos/criu/c74b83cd49c00589c0c0468ba5fe685b67fdbd0a/test/zdtm/static/mntns-deleted-dst -------------------------------------------------------------------------------- /test/zdtm/static/mntns_deleted.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_ghost.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id', 'opts': '--link-remap'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_ghost01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id', 'opts': '--link-remap'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_link_ghost.c: -------------------------------------------------------------------------------- 1 | mntns_link_remap.c -------------------------------------------------------------------------------- /test/zdtm/static/mntns_link_ghost.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_link_remap.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'uns ns', 'flags': 'suid', 'feature': 'mnt_id', 'opts': '--link-remap'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_open.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_overmount.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_remap.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_ro_root.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_root_bind.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_root_bind02.c: -------------------------------------------------------------------------------- 1 | mntns_root_bind.c -------------------------------------------------------------------------------- /test/zdtm/static/mntns_root_bind02.desc: -------------------------------------------------------------------------------- 1 | mntns_root_bind.desc -------------------------------------------------------------------------------- /test/zdtm/static/mntns_rw_ro_rw.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_shared_bind.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_shared_bind02.c: -------------------------------------------------------------------------------- 1 | mntns_shared_bind.c -------------------------------------------------------------------------------- /test/zdtm/static/mntns_shared_bind02.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_shared_bind03.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mntns_shared_vs_private.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mount_paths.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/mountpoints.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags': 'suid excl', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/msgque.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/netns-dev.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/netns-nf.desc: -------------------------------------------------------------------------------- 1 | { 'deps': [ '/bin/sh', 2 | '/sbin/iptables', 3 | '/usr/lib64/xtables/libxt_standard.so|/usr/lib/iptables/libxt_standard.so|/lib/xtables/libxt_standard.so|/usr/lib/powerpc64le-linux-gnu/xtables/libxt_standard.so|/usr/lib/x86_64-linux-gnu/xtables/libxt_standard.so|/usr/lib/s390x-linux-gnu/xtables/libxt_standard.so|/usr/lib/xtables/libxt_standard.so', 4 | '/usr/bin/diff'], 5 | 'flags': 'suid', 6 | 'flavor': 'ns uns'} 7 | -------------------------------------------------------------------------------- /test/zdtm/static/netns.desc: -------------------------------------------------------------------------------- 1 | { 'deps': ['/bin/sh', '/sbin/ip|/bin/ip', '/usr/bin/diff'], 2 | 'flags': 'suid', 3 | 'flavor': 'ns uns'} 4 | -------------------------------------------------------------------------------- /test/zdtm/static/netns_sub.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/netns_sub_veth.desc: -------------------------------------------------------------------------------- 1 | { 2 | 'deps': ['/sbin/ip', '/bin/sh'], 3 | 'flags': 'suid', 4 | 'flavor': 'ns uns', 5 | 'feature': 'link_nsid', 6 | } 7 | -------------------------------------------------------------------------------- /test/zdtm/static/non_uniform_share_propagation.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/ofd_file_locks.h: -------------------------------------------------------------------------------- 1 | #ifndef ZDTM_OFD_FILE_LOCKS_H_ 2 | #define ZDTM_OFD_FILE_LOCKS_H_ 3 | 4 | #include 5 | 6 | #ifndef F_OFD_GETLK 7 | #define F_OFD_GETLK 36 8 | #define F_OFD_SETLK 37 9 | #define F_OFD_SETLKW 38 10 | #endif 11 | 12 | /* 13 | * Functions for parsing of OFD locks 14 | * from procfs and checking them after restoring. 15 | */ 16 | 17 | extern int check_lock_exists(const char *filename, struct flock *lck); 18 | extern int check_file_lock_restored(int pid, int fd, struct flock *lck); 19 | 20 | #endif /* ZDTM_OFD_FILE_LOCKS_H_ */ 21 | -------------------------------------------------------------------------------- /test/zdtm/static/overmount_dev.desc: -------------------------------------------------------------------------------- 1 | {'flavor' : "ns", 'flags': 'suid crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/overmount_fifo.desc: -------------------------------------------------------------------------------- 1 | {'flavor' : 'ns uns', 'flags': 'suid crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/overmount_file.desc: -------------------------------------------------------------------------------- 1 | {'flavor' : 'ns uns', 'flags': 'suid crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/overmount_sock.desc: -------------------------------------------------------------------------------- 1 | {'flavor' : 'ns uns', 'flags': 'suid crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/overmount_with_shared_parent.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/packet_sock.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/packet_sock_mmap.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/packet_sock_spkt.desc: -------------------------------------------------------------------------------- 1 | {'flavor':'h uns ns', 'flags' : 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/pid00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/poll.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/private_bind_propagation.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/pthread02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/ptrace_sig.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/pty-console.c: -------------------------------------------------------------------------------- 1 | pty01.c -------------------------------------------------------------------------------- /test/zdtm/static/pty-console.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'flavor' : 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/pty01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/pty03.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/remap_dead_pid.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/remap_dead_pid_root.c: -------------------------------------------------------------------------------- 1 | remap_dead_pid.c -------------------------------------------------------------------------------- /test/zdtm/static/remap_dead_pid_root.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/rtc.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid crlib','arch': 'x86_64 aarch64 arm ppc64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/s390x_mmap_high.desc: -------------------------------------------------------------------------------- 1 | {'arch': 's390x'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/s390x_regs_check.desc: -------------------------------------------------------------------------------- 1 | {'arch': 's390x'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sched_policy00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sched_prio00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/scm01.c: -------------------------------------------------------------------------------- 1 | scm00.c -------------------------------------------------------------------------------- /test/zdtm/static/scm02.c: -------------------------------------------------------------------------------- 1 | scm00.c -------------------------------------------------------------------------------- /test/zdtm/static/scm04.c: -------------------------------------------------------------------------------- 1 | scm03.c -------------------------------------------------------------------------------- /test/zdtm/static/scm06.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/seccomp_filter.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'feature': 'seccomp_filters'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/seccomp_filter_inheritance.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'feature': 'seccomp_filters'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/seccomp_filter_threads.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'feature': 'seccomp_filters'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/seccomp_filter_tsync.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'feature': 'seccomp_filters'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/seccomp_strict.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid', 'feature': 'seccomp_suspend'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sem.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/session00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/session01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/session02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/session03.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/shared_mount_propagation.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/shared_slave_mount_children.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/shm-mp.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/shm-unaligned.c: -------------------------------------------------------------------------------- 1 | shm.c -------------------------------------------------------------------------------- /test/zdtm/static/shm-unaligned.desc: -------------------------------------------------------------------------------- 1 | shm.desc -------------------------------------------------------------------------------- /test/zdtm/static/shm.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sit.desc: -------------------------------------------------------------------------------- 1 | { 'deps': [ '/bin/sh', '/sbin/ip|/bin/ip', '/usr/bin/diff' ], 2 | 'flags': 'suid', 3 | 'flavor': 'ns uns' } 4 | -------------------------------------------------------------------------------- /test/zdtm/static/sk-freebind-false.c: -------------------------------------------------------------------------------- 1 | sk-freebind.c -------------------------------------------------------------------------------- /test/zdtm/static/sk-netlink.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sk-unix-mntns.desc: -------------------------------------------------------------------------------- 1 | { 2 | 'feature': 'mnt_id sk_unix_file', 3 | 'flags': 'suid', 4 | 'flavor': 'ns uns', 5 | } 6 | -------------------------------------------------------------------------------- /test/zdtm/static/sk-unix01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/skip-me.c: -------------------------------------------------------------------------------- 1 | int main(int argc, char ** argv) 2 | { 3 | test_init(argc, argv); 4 | 5 | test_msg("Skipping test:" TEST_SKIP_REASON); 6 | 7 | test_daemon(); 8 | test_waitsig(); 9 | 10 | pass(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /test/zdtm/static/sleeping00.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "zdtmtst.h" 4 | 5 | const char *test_doc = "Suspend while migrating"; 6 | const char *test_author = "Roman Kagan "; 7 | 8 | int main(int argc, char ** argv) 9 | { 10 | test_init(argc, argv); 11 | 12 | test_daemon(); 13 | test_waitsig(); 14 | 15 | pass(); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /test/zdtm/static/sock_opts00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sock_opts01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sock_peercred.desc: -------------------------------------------------------------------------------- 1 | { 'flags': 'suid noauto' } 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-ext.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--ext-unix-sk'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-close-wait.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-close-wait.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-close0.desc: -------------------------------------------------------------------------------- 1 | {'dopts': '--tcp-established', 'ropts': '--tcp-close', 'flags': 'reqrst '} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-close1.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-close0.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closed-last-ack.c: -------------------------------------------------------------------------------- 1 | socket-tcp-closed.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closed-last-ack.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closed.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed', 'flavor' : 'ns uns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closed.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closing.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-closing.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-fin-wait1.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-fin-wait2.c: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-fin-wait2.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-fin-wait2.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-last-ack.c: -------------------------------------------------------------------------------- 1 | socket-tcp-close-wait.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-last-ack.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-last-ack.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-local.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-local.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-local.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait2.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-nfconntrack.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-nfconntrack.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-reseted.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-reuseport.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-syn-sent.desc: -------------------------------------------------------------------------------- 1 | { 'deps': [ '/bin/sh', 2 | '/sbin/iptables', 3 | '/usr/lib64/xtables/libxt_tcp.so|/lib/xtables/libxt_tcp.so|/usr/lib/powerpc64le-linux-gnu/xtables/libxt_tcp.so|/usr/lib/x86_64-linux-gnu/xtables/libxt_tcp.so', 4 | '/usr/lib64/xtables/libxt_standard.so|/lib/xtables/libxt_standard.so|/usr/lib/powerpc64le-linux-gnu/xtables/libxt_standard.so|/usr/lib/x86_64-linux-gnu/xtables/libxt_standard.so', 5 | ], 6 | 'opts': '--tcp-established', 7 | 'flags': 'suid nouser samens', 8 | 'feature' : 'tcp_half_closed' 9 | } 10 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-syn-sent.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp-unconn.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-close-wait.c: -------------------------------------------------------------------------------- 1 | socket-tcp-close-wait.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-close-wait.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-close-wait.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-closed.c: -------------------------------------------------------------------------------- 1 | socket-tcp-closed.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-closed.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-closed.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-closing.c: -------------------------------------------------------------------------------- 1 | socket-tcp-closing.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-closing.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-closing.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-fin-wait1.c: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-fin-wait1.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-fin-wait1.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-fin-wait2.c: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait2.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-fin-wait2.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-fin-wait2.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-last-ack.c: -------------------------------------------------------------------------------- 1 | socket-tcp-last-ack.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-last-ack.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-last-ack.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-local.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6-local.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6-local.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp4v6.desc: -------------------------------------------------------------------------------- 1 | socket-tcp6.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-close-wait.c: -------------------------------------------------------------------------------- 1 | socket-tcp-close-wait.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-close-wait.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-close-wait.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-closed.c: -------------------------------------------------------------------------------- 1 | socket-tcp-closed.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-closed.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-closed.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-closing.c: -------------------------------------------------------------------------------- 1 | socket-tcp-closing.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-closing.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-closing.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-closing.hook: -------------------------------------------------------------------------------- 1 | socket-tcp-closing.hook -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-fin-wait1.c: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-fin-wait1.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-fin-wait2.c: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait2.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-fin-wait2.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-fin-wait1.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-last-ack.c: -------------------------------------------------------------------------------- 1 | socket-tcp-last-ack.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-last-ack.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-last-ack.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-local.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-local.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-local.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-unconn.c: -------------------------------------------------------------------------------- 1 | socket-tcp-unconn.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6-unconn.desc: -------------------------------------------------------------------------------- 1 | socket-tcp-unconn.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6.c: -------------------------------------------------------------------------------- 1 | socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcp6.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf-local.c: -------------------------------------------------------------------------------- 1 | socket-tcpbuf.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf-local.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf6-local.c: -------------------------------------------------------------------------------- 1 | socket-tcpbuf.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf6-local.desc: -------------------------------------------------------------------------------- 1 | socket-tcpbuf-local.desc -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf6.c: -------------------------------------------------------------------------------- 1 | socket-tcpbuf.c -------------------------------------------------------------------------------- /test/zdtm/static/socket-tcpbuf6.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket_aio.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--tcp-established', 'flags' : 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket_listen4v6.c: -------------------------------------------------------------------------------- 1 | socket_listen.c -------------------------------------------------------------------------------- /test/zdtm/static/socket_listen6.c: -------------------------------------------------------------------------------- 1 | socket_listen.c -------------------------------------------------------------------------------- /test/zdtm/static/socket_snd_addr.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/socket_udp-corked.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sockets00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sockets03.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sse00.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/sse20.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/stopped01.c: -------------------------------------------------------------------------------- 1 | stopped.c -------------------------------------------------------------------------------- /test/zdtm/static/stopped02.c: -------------------------------------------------------------------------------- 1 | stopped.c -------------------------------------------------------------------------------- /test/zdtm/static/stopped12.c: -------------------------------------------------------------------------------- 1 | stopped.c -------------------------------------------------------------------------------- /test/zdtm/static/tempfs.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tempfs_overmounted.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tempfs_overmounted01.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tempfs_ro.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tempfs_ro02.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tempfs_subns.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'mnt_id'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/thread_different_uid_gid.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/timerfd.desc: -------------------------------------------------------------------------------- 1 | {'feature': 'timerfd'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tun.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid noauto', 'feature': 'tun'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/tun_ns.c: -------------------------------------------------------------------------------- 1 | tun.c -------------------------------------------------------------------------------- /test/zdtm/static/tun_ns.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'feature': 'tun tun_ns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unhashed_proc.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'crfail', 'opts' : '--link-remap'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat00.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$1" == "--fault" -a "$2" == "restore" ] || exit 0 4 | 5 | if [ $(find -name 'unlink_fstat00*ghost' | wc -l ) -ne 0 ]; then 6 | echo "Dangling ghost file" 7 | exit 1 8 | fi 9 | 10 | echo "Restore fault handled" 11 | exit 0 12 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat01+.c: -------------------------------------------------------------------------------- 1 | unlink_fstat01.c -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat03.desc: -------------------------------------------------------------------------------- 1 | {'opts': '--link-remap', 'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat04.c: -------------------------------------------------------------------------------- 1 | unlink_fstat00.c -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat04.desc: -------------------------------------------------------------------------------- 1 | { "flags" : "suid" } 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_fstat041.c: -------------------------------------------------------------------------------- 1 | unlink_fstat00.c -------------------------------------------------------------------------------- /test/zdtm/static/unlink_largefile.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_mmap00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_mmap01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_mmap02.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'nouser'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_multiple_largefiles.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'opts': '--ghost-limit 1G'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unlink_regular00.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid', 'opts': '--link-remap'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/unsupported_children_collision.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid noauto crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/uptime_grow.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/utsname.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns uns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/vdso01.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'x86_64'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/vfork00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto crfail'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/vsx.desc: -------------------------------------------------------------------------------- 1 | {'arch': 'ppc64le'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/vt.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h ns', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/static/zombie01.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/fifo_dyn.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/fork2.c: -------------------------------------------------------------------------------- 1 | fork.c -------------------------------------------------------------------------------- /test/zdtm/transition/ipc.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'ns'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/maps007.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/maps008.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'flags': 'suid'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/netlink00.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/pid_reuse.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'suid pre-dump-notify'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/ptrace.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/socket-tcp.c: -------------------------------------------------------------------------------- 1 | ../static/socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/transition/socket-tcp.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/socket-tcp6.c: -------------------------------------------------------------------------------- 1 | ../static/socket-tcp.c -------------------------------------------------------------------------------- /test/zdtm/transition/socket-tcp6.desc: -------------------------------------------------------------------------------- 1 | {'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens'} 2 | -------------------------------------------------------------------------------- /test/zdtm/transition/thread-bomb.desc: -------------------------------------------------------------------------------- 1 | {'flags': 'noauto'} 2 | -------------------------------------------------------------------------------- /test/zdtm_mount_cgroups: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # If a controller is created during dumping processes, criu may fail with error: 4 | # Error (cgroup.c:768): cg: Set 3 is not subset of 2 5 | # so lets create all test controllers before executing tests. 6 | 7 | cat /proc/self/cgroup | grep -q zdtmtst.defaultroot && exit 8 | 9 | tdir=`mktemp -d zdtm.XXXXXX` 10 | for i in "zdtmtst" "zdtmtst.defaultroot"; do 11 | mount -t cgroup -o none,name=$i zdtm $tdir && 12 | # a fake group prevents destroying of a controller 13 | mkdir -p $tdir/holder && 14 | umount -l $tdir || exit 1 15 | done 16 | rmdir $tdir 17 | -------------------------------------------------------------------------------- /test/zdtm_umount_cgroups: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Lets delete all test controllers after executing tests. 4 | 5 | cat /proc/self/cgroup | grep -q zdtmtst.defaultroot || exit 0 6 | 7 | tdir=`mktemp -d zdtm.XXXXXX` 8 | for i in "zdtmtst" "zdtmtst.defaultroot"; do 9 | mount -t cgroup -o none,name=$i zdtm $tdir || { rmdir $tdir; exit 1; } 10 | # remove a fake group if exists 11 | if [ -d "$tdir/holder" ]; then 12 | rmdir $tdir/holder || { umount -l $tdir && rmdir $tdir; exit 1; } 13 | fi 14 | umount -l $tdir || exit 1; 15 | done 16 | rmdir $tdir 17 | --------------------------------------------------------------------------------