Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
a1f2c46
crns.py: New attempt to have --unshare option
xemul Aug 3, 2016
3315681
util: Copy file w/o sendfile
Feb 11, 2017
0c01d20
Process Migration using Sockets (p1)
Feb 11, 2017
bc22231
Process Migration using Sockets (p2)
Feb 11, 2017
c62b422
zdtm: Add support for image-proxy/image-cache
Feb 11, 2017
cf9572f
images: add proto2 syntax specification to remote-image.proto
0x7f454c46 Mar 7, 2017
520afd7
Fixed BUFFER_SIZE_WARNING issues introduced by remote images code.
Mar 10, 2017
6a647c3
Fixed RESOURCE_LEAK issues introduced by remote images code.
Mar 19, 2017
a07bce5
Fixed NULL_RETURNS issues introduced by remote images code.
Mar 18, 2017
0d5711c
criu/img-remote-proto.c: use static mutex init
kolyshkin Mar 23, 2017
28ae24d
criu/img-remote-proto.c: error printing fixes
kolyshkin Mar 23, 2017
1d52044
criu/img-remote.c: use xmalloc
kolyshkin Mar 23, 2017
1c68f0a
criu/img-remote.c: use pr_err not pr_perror
kolyshkin Mar 23, 2017
dc236fd
pagemap: fix reading pages from socket for --remote case
rppt Apr 25, 2017
dae52f3
Merge img-remote and img-remote-proto
omriKramer Jul 1, 2017
c4e1672
page-read: Don't try to dedup from img cache/proxy
xemul Jul 6, 2017
0a1d8f0
page-read: Don't check for cache/proxy in local case
xemul Jul 6, 2017
6d30ccd
page-read: Warn about async read w/o completion cb
xemul Jul 6, 2017
164ad4a
page-xfer: Normalize remote/local parent xfer checks
xemul Jul 6, 2017
e57e295
files,remote: Support chunked ghost files
xemul Aug 15, 2017
7b3c887
img-remote: Fix typo in comment
rst0git Jan 20, 2018
52ac13e
remote: Preparing image receive and send for asynchronous sockets.
May 14, 2018
f373153
remote: Unix socket for local connections is async.
May 14, 2018
df0b0fb
remote: Unblocking implementation of img cache and proxy seems to be …
May 14, 2018
fa3113c
remote: Minor improvements on img-remote.c
May 14, 2018
74d6fc0
remote: Fixing identation.
May 14, 2018
ec2123d
remote: a few minor fixes to make travis happy
avagin May 15, 2018
751aa22
remote: Remove unused constants
rst0git Jun 14, 2018
8864b63
crtools: Fix typo
rst0git Jan 20, 2018
4d1dd2e
criu: fix leaks detected by coverity scan
Snorch Feb 1, 2018
c24e8bb
test: make zdtm.py python2/python3 compatible
avagin Jun 1, 2018
08d476e
crtools: image-{cache, proxy} requires address/port
rst0git Feb 16, 2018
8ec0373
criu: fix gcc-8 warnings
avagin Feb 4, 2018
b605eb0
remote: don't read from pointer after free
avagin Jul 12, 2018
9a699e3
Revert "test: check criu restore with --auto-dedup"
avagin Jul 27, 2018
154eb1b
img-proxy: Remove duplicated include
rst0git Aug 22, 2018
342188b
remote: Merge check_pending_{reads,forwards}
rst0git Aug 22, 2018
d09ace5
remote: Replace PATHLEN with PATH_MAX
rst0git Aug 30, 2018
24314fd
remote: Refactor TCP server setup
rst0git Sep 13, 2018
35b2a3d
remote: Refactor TCP client setup
rst0git Sep 13, 2018
cffe6e3
remote: pull_snapshot_ids: Simplify if condition
rst0git Sep 13, 2018
967a6ab
remote: Use tmp file buffer when restore ip dump
rst0git Sep 13, 2018
291bb97
python: Replace xrange with range
rst0git Sep 23, 2018
f8945ba
image: fix typo in debug message
Snorch Sep 28, 2018
12b2e1b
zdtm: check criu restore with --auto-dedup
Snorch Sep 28, 2018
a2fcf4c
Fix typos
rst0git Aug 22, 2018
98b44fb
remote: Fix code indentation
rst0git Jan 29, 2019
b1522cd
img-cache: Drop unnecessary accept_proxy_to_cache
rst0git Jan 29, 2019
181687a
img-cache/proxy: Close sockets on failure
rst0git Jan 29, 2019
0bcca9a
remote: Drop unused PB_LOCAL_IMAGE_SIZE
rst0git Jan 30, 2019
69b5abd
remote: Introduce strflags() macro
rst0git Feb 8, 2019
197f5bc
remote: Fix stringop-truncation warning
rst0git Feb 8, 2019
dfbfa4f
remote: Fix 'flags' maybe uninitialized warning
rst0git Feb 8, 2019
fb1c845
remote: Make private functions static
rst0git Feb 8, 2019
a899158
remote: Use xmalloc/xzalloc/xfree
rst0git Feb 9, 2019
aa16271
remote: Ignore interupt signals
rst0git Feb 11, 2019
7187c12
util: Don't pass address/port as arguments
rst0git Feb 13, 2019
909b924
remote: Rename 'proxy_to_cache_fd' to 'remote_sk'
rst0git Feb 24, 2019
0738800
remote: Rename 'local_req_fd' to 'local_sk'
rst0git Feb 24, 2019
8f2752f
util: Fix addr casting for IPv4/IPv6 in autobind
rst0git Feb 22, 2019
79a4c67
util: Introduce fd_set_nonblocking()
rst0git Feb 24, 2019
142c043
remote: Use \0 as indicator for a "finish" msg
rst0git Feb 27, 2019
b9103c8
Sort includes in criu/img-*.c
rst0git Feb 13, 2019
b605afd
util: Remove deprecated print_data() routine
rst0git Mar 24, 2019
b7e589e
criu-ns: Convert to python3 style print() syntax
rst0git Apr 7, 2019
fea0482
criu-ns: Print usage info when no args provided
rst0git Apr 7, 2019
351fbe1
criu-ns: Convert c_char_p strings to bytes object
rst0git Apr 7, 2019
6d18c86
Convert spaces to tabs
rst0git Apr 12, 2019
d50048a
add Hygon CPU Vendor ID("HygonGenuine") checking in compel_cpuid()
hygonsoc Apr 14, 2019
692b854
sk-inet: udp -- Don't fail on calling shutdown on disconnected socket
cyrillos Apr 18, 2019
131c557
test: socket_udplite -- Test shudowned sockets
cyrillos Apr 18, 2019
bcdd276
criu/clone: stack size is too small for Android
zhangn1985 Apr 18, 2019
c8a597b
compel/s390: Fix memset sizeof
rikardfalkeborn Apr 28, 2019
725bd70
compel/s390: Fix return value in error path
rikardfalkeborn Apr 28, 2019
07e7c53
test/zdtm: Move assignment after return value check
rikardfalkeborn Apr 28, 2019
59e1f16
test: remove unused variables
rikardfalkeborn Apr 28, 2019
4a4d3f7
files-reg: Remove redundant inner if
rikardfalkeborn Apr 28, 2019
b90c46f
test: add missing va_end
rikardfalkeborn Apr 28, 2019
ec8e824
test/bers: Fix sizeof to memset
rikardfalkeborn Apr 28, 2019
10e8726
lsm: also dump and restore sockcreate
adrianreber May 2, 2019
c421f74
test: Verify that sockcreate does not change during restore
adrianreber May 2, 2019
b58160e
sockets: dump and restore xattr security labels
adrianreber Apr 29, 2019
28723e4
selinux: add socket label test
adrianreber Apr 30, 2019
26d2123
zdtm/ia32: fcntl() wrapper for old glibc(s)
0x7f454c46 May 2, 2019
b45f621
zdtm/vdso/ia32: Use uint64_t for /proc/self/maps
0x7f454c46 May 2, 2019
59c8575
zdtm/vdso/ia32: Ignore vsyscall page appear
0x7f454c46 May 2, 2019
4aa9521
x86/compel/infect: Be verbose on remote mmap failure
0x7f454c46 May 2, 2019
e847a52
zdtm/thread-bomb: Limit stack size in thread-bomb
0x7f454c46 May 2, 2019
42e5c04
cgroup: Add "ignore" mode for --manage-cgroups
0x7f454c46 May 1, 2019
c5a2eed
test/exhaustive: Replace map by list comprehension
Apr 7, 2019
a82fec8
[coredump]: correct the parsing of reg_files from files.img
dubukuangye Apr 22, 2019
6c695d0
lsm: fix compiler error 'unused-result'
adrianreber May 3, 2019
bb6ce09
lsm: don't reset socket contex if SELinux is disabled
avagin May 5, 2019
cc8ee9d
lsm: fix compiler error on Fedora 30
adrianreber May 4, 2019
70d2ab3
zdtm: Simplify string to boolean conversion
rst0git May 4, 2019
929a183
sk-inet: restore SO_BROADCAST option
rst0git Apr 16, 2019
93d57da
zdtm: Add UDP broadcast test
rst0git Apr 25, 2019
518b04f
util: cr_daemon: Drop keep_fd argument
rst0git Apr 21, 2019
92ad980
config: Exit with error if ps-socket is std fd
rst0git May 1, 2019
970198a
crtools: Print err messages from check_options()
rst0git Apr 5, 2019
4699aa1
lazy-pages: fix stack detection
rppt May 14, 2019
2e7c033
build/pie: Add comments to build files
0x7f454c46 May 17, 2019
0961bc4
arm/build: Move -marm cflag to CFLAGS_PIE
0x7f454c46 May 17, 2019
7acce8c
build: Move __ASSEMBLY__ define to the top Makefile
0x7f454c46 May 17, 2019
3485e37
make: Don't export ccflags-y
0x7f454c46 May 17, 2019
5d3b42f
Makefile.crtools: Remove bogus ccflags-y
0x7f454c46 May 17, 2019
df0548c
build: Use cflags from compel for pie.lib.a
0x7f454c46 May 17, 2019
24e90c8
compel: Don't use CFLAGS_PIE for libcompel.so
0x7f454c46 May 17, 2019
bd808f5
make: Move CR_NOGLIBC into CFLAGS_PIE
0x7f454c46 May 17, 2019
48880e3
criu/ia32: Consolidate compat vdso and move to arch/x86
0x7f454c46 May 17, 2019
beeda67
build/criu/pie: Move trampolines to restorer-obj-y
0x7f454c46 May 17, 2019
5a52e34
x86/crtools: do not error when YMM is missing
zhangn1985 Apr 16, 2019
b5d29bb
autofs: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
7c86982
cgroup: fix clang 'free released memory'
adrianreber May 15, 2019
8c4dbb3
compel: fix clang 'value stored is never read'
adrianreber May 15, 2019
703a4ac
cr-service: fix coverity STRING_OVERFLOW
adrianreber May 14, 2019
f0523a3
cr-service: fix clang 'dereference of a null pointer'
adrianreber May 15, 2019
d32dfc2
files: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
8f3b86a
files-reg: fix coverity NULL_RETURNS
adrianreber May 14, 2019
2eb6716
image: fix clang 'dereference of a null pointer'
adrianreber May 15, 2019
3b7fa18
log: fix coverity OVERRUN
adrianreber May 14, 2019
d3f2fb9
libcriu: fix coverity RESOURCE_LEAK
adrianreber May 14, 2019
1dc8502
lib/c: fix coverity DEADCODE
adrianreber May 15, 2019
5f78a1a
lsm: fix clang 'Use of memory after it is freed'
adrianreber May 15, 2019
d95c04d
mem: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
38487fa
net: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
2cabbab
pagemap: fix clang 'free released memory'
adrianreber May 15, 2019
57f66e8
pagemap: fix coverity FORWARD_NULL
adrianreber May 15, 2019
ae7bd08
page-xfer: fix clang 'value is never read'
adrianreber May 15, 2019
b83c049
pie/restorer: fix clang 'value is never read'
adrianreber May 15, 2019
7d5154b
proc_parse: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
a9b3185
sk-inet: fix coverity RESOURCE_LEAK
adrianreber May 14, 2019
ab23469
sk-inet: fix clang 'potential memory leak'
adrianreber May 15, 2019
ef4840a
sk-queue: fix clang 'potential memory leak'
adrianreber May 15, 2019
399a241
sk-unix: fix clang 'value is never read'
adrianreber May 15, 2019
9aecd27
sk-unix: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
ee40a11
util: fix coverity FORWARD_NULL
adrianreber May 14, 2019
7205506
image: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
c49bd0d
sk-unix: fix coverity NULL_RETURNS
adrianreber May 15, 2019
22c23bb
python: Drop six dependency
rst0git May 18, 2019
c06b495
make: Use asciidoctor by default
rst0git May 22, 2019
d171092
mem: Update stats for overflow page pipes
xemul May 23, 2019
0e7f01b
shmem: Save pages stats too
xemul May 23, 2019
81607db
zdtm: Check pages stats after dump
xemul May 23, 2019
05d28c4
stats: Make dstats shmem
xemul May 23, 2019
aad606a
util: use F_DUPFD when we don't want to overwrite an existing descriptor
avagin May 21, 2019
5be8ab0
test/s390: add a new patch to xtables libraries
avagin May 27, 2019
ef4f031
aarch64: Remove stack pointer from clobber list
rst0git May 26, 2019
08bdda7
zdtm: Check stats file presence before reading
xemul May 28, 2019
a835a42
pb2dict: Fix is_string() check for Python 2
rst0git May 28, 2019
c7a4992
pb2dict: Resolve Python 2/3 compatibility issues
rst0git May 29, 2019
7627c14
cr-check: Add check for mremap() of special mappings
0x7f454c46 May 29, 2019
debd230
vdso/arm: Add vdso symbols from kernel
0x7f454c46 May 29, 2019
60298f8
parasite-vdso: Add ugly casts for arm32
0x7f454c46 May 29, 2019
77e54cc
vdso/arm32: Add vdso trampoline support
0x7f454c46 May 29, 2019
ff9dd16
arm: Build {pie-, }util-vdso with CONFIG_VDSO_32
0x7f454c46 May 29, 2019
7d90ec2
arm: Provide aeabi helpers in ARM format
0x7f454c46 May 29, 2019
7e4055e
arm/pie: Provide __clear_cache()
0x7f454c46 May 29, 2019
009f154
rt-vdso: Be verbose if !blobs_matches()
0x7f454c46 May 29, 2019
c02c907
x86/vdso: Don't insert trampolines in vsyscall
0x7f454c46 May 29, 2019
9d8a63e
util-vdso: Check chain for STN_UNDEF
0x7f454c46 May 29, 2019
916ac8e
pie/build: Add CFLAGS_PIE to CFLAGS
0x7f454c46 May 29, 2019
f237bc5
criu/vdso: Purge CONFIG_VDSO
0x7f454c46 May 29, 2019
187096e
zdtm: Fix memory and resource leaks
rst0git May 18, 2019
d5065a5
c-lib: Support to build a static archive
udzura Mar 1, 2019
fc3f90c
c-lib: Add lib-a into all-y targets
udzura Mar 8, 2019
cd8ba0d
Add CRIU_A to cleanup target
udzura May 29, 2019
d6ae83a
c-lib: Install and uninstall libcriu.a
udzura Jun 7, 2019
0f89561
fsnotify: More precious error handling
cyrillos Jun 4, 2019
9e1922e
make: config -- Link with GnuTLS
rst0git Mar 31, 2019
14673b2
page-xfer: Add TLS support with X509 certificates
rst0git Mar 31, 2019
ff2cdf8
tls: Add --tls-no-cn-verify option
rst0git May 6, 2019
ca34cb1
rpc: Add support for TLS options
rst0git Apr 3, 2019
028666d
zdtm: Add --tls option
rst0git May 8, 2019
3953b33
travis: Enable TLS testing
rst0git May 8, 2019
316193d
zdtm: Refactor seccomp_filter_{threads,tsync}
rst0git Jun 27, 2019
d3c5f8c
py: Reformat everything into pep8 style
xemul Jun 27, 2019
4797cfb
lint: Print flake8 version before checking
xemul Jun 27, 2019
8117692
zdtm: Two fixes to yapf bombing
xemul Jun 27, 2019
a7f5370
zdtm: Fix muliline assignment
xemul Jun 28, 2019
31b3ba1
flake.cfg: Update to yapf formatting
xemul Jun 28, 2019
348b1f6
py: Fix tabs in code comments
rst0git Jun 28, 2019
258bf94
py: Manual fixlets of code formatting
rst0git Jul 1, 2019
08abfee
pyimages: Add pb2dict.py to checked and fix warnings/errors
xemul Jul 1, 2019
8ff73c8
Documentation: Create man page for libcompel
Mar 8, 2019
c57cc7e
fix segmentation fault caused by uninitialized mutex
Jun 19, 2019
32c730f
tty: Move tty layer shared init into tty_init_restore
cyrillos Jun 25, 2019
ad4e398
sk-inet: fix coverity IDENTICAL_BRANCHES
adrianreber May 14, 2019
0e1362c
seize: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
ecda8c0
util: fix clang 'null pointer passed'
adrianreber May 15, 2019
bfdd3db
files-reg: fix coverity RESOURCE_LEAK
adrianreber May 15, 2019
0318abc
dedup: convert noisy warning to debug and improve messages
Snorch Jul 2, 2019
63cc957
inventory: skip warning in case of no parent directory
Snorch Jul 2, 2019
74731d9
zdtm: make grep_errors also grep warnings
Snorch Jul 1, 2019
a53cef2
test/packet_sock_mmap: parse inode as unsigned long long
avagin Jul 15, 2019
d364f6c
zdtm: use a proper page size for the host
avagin Jul 17, 2019
01b2ec7
Replace libprotobuf-c0-dev with libprotobuf-c-dev
thaJeztah Jul 17, 2019
5cbd131
Add support for migrating CHILD_SUBREAPER prctl
mclapinski Jul 12, 2019
0740d18
Add ZDTM tests for child subreaper property
mclapinski Jul 12, 2019
6eaf08e
mem/page-pipe: Eliminate redundant pipe_off setup
cyrillos Jul 5, 2019
23e095e
mem/page-pipe: create_page_pipe -- Drop redundant zero assignment
cyrillos Jul 5, 2019
2510112
mem/page-pipe: Align members for readability sake
cyrillos Jul 5, 2019
c595710
mem/page-pipe: Use ssize_t for splice/tee results
cyrillos Jul 5, 2019
4d1edc4
mem/vma: Use memset for vm_area_list_init
cyrillos Jul 5, 2019
a289959
mem/vma: Use vm_area_list_init where appropriate
cyrillos Jul 5, 2019
b6ffd68
mem/vma: Drop never used VM_AREA_LIST macro
cyrillos Jul 5, 2019
f159351
mem/vma: Sanitize struct vm_area_list
cyrillos Jul 5, 2019
5af347e
mem/page-xfer: Add log prefix
cyrillos Jul 5, 2019
9723c18
mem/pmc: Use pr_warn_once if cache is disabled
cyrillos Jul 5, 2019
c93090c
mem/pmc: Print pid for debug sake
cyrillos Jul 5, 2019
2fd40e0
mem/page-pipe: Use xrealloc_safe in page_pipe_add_hole
cyrillos Jul 5, 2019
82b8b89
mem/shmem: Use xrealloc_safe in expand_shmem
cyrillos Jul 5, 2019
9d3eb6c
mem/shmem: More elegant entries declaration
cyrillos Jul 5, 2019
5526261
mem/shmem: Use xmalloc in collect_sysv_shmem
cyrillos Jul 5, 2019
728c9af
mem/shmem: Fix typos for_each_shmem macro
cyrillos Jul 5, 2019
8748fcf
make: Insert version macros in criu.h
rst0git Jul 10, 2019
b6ed8da
restorer: print errors if prctl syscalls failed
avagin Jul 17, 2019
fa76ec4
images: convert type of child_subreaper from int32 to bool
avagin Jul 17, 2019
e94e596
scripts: add possibility to override docker with podman
adrianreber Jul 29, 2019
6f1ee00
scripts: remove python2 from Fedora Dockerfiles
adrianreber Jul 29, 2019
2076b7f
mount: fix inconsistent return and goto err alternation
Snorch Jul 29, 2019
f7d9a08
scripts: Remove yaml/ipaddress Py2 fedora modules
rst0git Jul 29, 2019
b5cdf11
scripts: Set PYTHON=python3 in Fedora Dockerfiles
rst0git Jul 29, 2019
ced1df5
scripts: Install flake8 with dnf in Fedora
rst0git Jul 31, 2019
990a798
pb2dict: Disable undefined name 'basestring'
rst0git Jul 31, 2019
2617193
test/other: Resolve Py3 compatibility issues
rst0git Jul 29, 2019
b65d9a4
test/others: Reuse setup_swrk()
rst0git Jul 31, 2019
6d85856
compel/log: Use enum as parameter for std_log_set_loglevel()
0x7f454c46 Jul 25, 2019
20da17d
compel/std/uapi: Provide setter for gettimeofday()
0x7f454c46 Jul 25, 2019
f451fa9
vdso/restorer: Try best to preserve vdso during restore
0x7f454c46 Jul 25, 2019
0918c76
vdso/restorer: Always track vdso/vvar positions in vdso_maps_rt
0x7f454c46 Jul 25, 2019
946699d
restorer/parasite-vdso: Don't move vvar if failed to move vdso
0x7f454c46 Jul 25, 2019
d38e93f
seccomp/restorer: Disable gtod from vdso in strict mode
0x7f454c46 Jul 25, 2019
c16258a
vdso: Add compatible property to vdso_maps
0x7f454c46 Jul 25, 2019
f12a0f0
restorer: Use gettimeofday() from rt-vdso for log timings
0x7f454c46 Jul 25, 2019
a3cdf94
inotify: cleanup auxiliary events from queue
Snorch Jun 26, 2019
3dbd894
zdtm/inotify: add a test that no unexpected events appear after c/r
Snorch Jun 26, 2019
664d680
flog: Initial merge
cyrillos Jul 25, 2019
72034d4
flog: Export paths to use inside criu
cyrillos Jul 25, 2019
0566209
flog: Keep flog params in flog_ctx_t structure
cyrillos Aug 9, 2019
2f19417
flog: Initialize context on criu start
cyrillos Aug 9, 2019
0615f38
flog: Inject macro calls into pr_x helpers
cyrillos Aug 9, 2019
3828463
flog: Example of decoding all messages to with criu check
cyrillos Aug 9, 2019
5b0f911
1st working version with binlog
anastasiamarkina Aug 18, 2019
d00e646
print-log option to print binary log and exit
anastasiamarkina Aug 20, 2019
220455f
added documentation about binlog
anastasiamarkina Aug 26, 2019
2391ba9
code clean-up
anastasiamarkina Aug 26, 2019
1355ac1
Fix crash when no log file name was specified in commandline
anastasiamarkina Aug 30, 2019
e38eedd
fix crash when null argument is passed for the %s in format string
anastasiamarkina Sep 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endif

FOOTER := footer.txt
SRC1 += crit.txt
SRC1 += compel.txt
SRC8 += criu.txt
SRC := $(SRC1) $(SRC8)
XMLS := $(patsubst %.txt,%.xml,$(SRC))
Expand Down
52 changes: 52 additions & 0 deletions Documentation/binlog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
CRIU binary logging
===================

Usage: turning on binary logging
--------------------------------

Classical text logging is done by default.
Binary logging is turned on by the `--binlog` command line parameter.
It should be combined with `--log-file filename` parameter to specify
the log file name (this second parameter is used with both text and binary logging).

The example:

`criu --log-file /tmp/sdf.bin --binlog check`

Usage: reading binary log file
------------------------------

There is a `--print-log` parameter which turnes criy into a log reader.
It should be combined with `--log-file filename` parameter, which specifies
the log file name. When these parameters are used, CRIU prints all messages
from the binary log file on the screen and exits. This looks as follows:

`criu --log-file /tmp/sdf.bin --binlog --print-log`

Binary log file format
----------------------

Text logging in CRIU is based on the printf functions family, with format string
followed by arguments. To make logging in binary form faster, CRIU just stores
format string and arguments in binary log without parsing. When binary log file
is read with `--print-log` parameter, these data are taken from the binary log
records and passed to a printf function.

Binary log file format is highly inspired by the [flog experimental project](https://github.com/cyrillos/flog).
Each log message is stored as a format string aned a variable number of
arguments. The variable size record has following structure:


| field | datatype | explanation |
|---------|--------------|---------------------------------|
| magic | unsigned int | magic code, equal to `0x676f6c66` |
| version | unsigned int | binlog file version, equal to `1` |
| size | unsigned int | actual size of the record (is needed because of variable arguments|
| nargs | unsigned int | number of arguments |
| mask | unsigned int | mask, which encodes the argument type, e.g. long integer or string|
| fmt | long | offset to the format string, starting from the beginning of the record|
| args[0] | long | 1st argument: the value, if it is a number, or the offset to the string, starting from the beginning of the record |
| ..... | | |
| args[nargs-1] | long | last argument: the value, if it is a number, or the offset to the string, starting from the beginning of the record |
| ..... | | format string and all other strings passed as arguments, if any |

119 changes: 119 additions & 0 deletions Documentation/compel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
COMPEL(1)
==========
include::footer.txt[]

NAME
----
compel - Execute parasitic code within another process.

SYNOPSIS
--------
*compel* 'hgen' ['option' ...]

*compel* 'plugins' ['PLUGIN_NAME' ...]

*compel* ['--compat'] 'includes' | 'cflags' | 'ldflags'

*compel* ['--compat'] ['--static'] 'libs'

DESCRIPTION
------------
*compel* is a utility to execute arbitrary code, also called parasite code,
in the context of a foreign process. The parasitic code, once compiled with
compel flags and packed, can be executed in the context of other tasks. Currently
there is only one way to load the parasitic blob into victim task using libcompel.a,
called c-header.

ARGUMENTS
----------

Positional Arguments
~~~~~~~~~~~~~~~~~~~~

*hgen*::
create a header from the .po file, which is the parasite binary.

*plugins*::
prints the plugins available.

*ldflags*::
prints the ldflags available to compel during linking of parasite code.

*cflags*::
prints the compel cflags to be used during compilation of parasitic code.

*includes*::
prints list of standard include directories.

*libs*::
prints list of static or dynamic libraries that compel can link with.

OPTIONS
--------
*-f*, *--file* 'FILE'::
Path to the binary file, 'FILE', which *compel* must turn into a header

*-o*, *--output* 'FILE'::
Path to the header file, 'FILE', where compel must write the resulting header.

*-p*, *--prefix* 'NAME'::
Specify prefix for var names

*-l*, *--log-level* 'NUM'::
Default log level of compel.

*-h*, *--help*::
Prints usage and exits.

*-V*, *--version*::
Prints version number of compel.

SOURCE EXAMPLES
----------------

Parasitic Code
~~~~~~~~~~~~~~

*#include <compel/plugins/std.h>*

*int parasite_trap_cmd(int cmd, void *args);* //gets called by compel_run_in_thread()

*int parasite_daemon_cmd(int cmd, void *arg);* // gets called by compel_rpc_call() and compel_rpc_call_sync()

*void parasite_cleanup(void);* //gets called on parasite unload by compel_cure()

Infecting code
~~~~~~~~~~~~~~
The parasitic code is compiled and converted to a header using *compel*, and included here.

*#include <compel/compel.h>*

*#include "parasite.h"*

Following steps are perfomed to infect the victim process:

- stop the task: *int compel_stop_task(int pid);*
- prepare infection handler: *struct parasite_ctl *compel_prepare(int pid);*
- execute system call: *int compel_syscall(ctl, int syscall_nr, long *ret, int arg ...);*
- infect victim: *int compel_infect(ctl, nr_thread, size_of_args_area);*
- cure the victim: *int compel_cure(ctl);* //ctl pointer is freed by this call
- Resume victim: *int compel_resume_task(pid, orig_state, state);*

*ctl* must be configured with blob information by calling *PREFIX_setup_c_header()*, with ctl as its argument.
*PREFIX* is the argument given to *-p* when calling hgen, else it is deduced from file name.


EXAMPLES
---------
To generate a header file(.h) from a parasite binary file(.po) use:

----------
compel hgen -f parasite.po -o parasite.h
----------

'parasite.po' file is obtained by compiling the parasite source with compel flags and
linking it with the compel plugins.

AUTHOR
------
The CRIU team.
29 changes: 29 additions & 0 deletions Documentation/criu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ The 'mode' may be one of the following:
*strict*::: Restore all cgroups and their properties from the scratch,
requiring them to not present in the system.

*ignore*::: Don't deal with cgroups and pretend that they don't exist.

*--cgroup-root* ['controller'*:*]/'newroot'::
Change the root cgroup the controller will be installed into. No controller
means that root is the default for all controllers not specified.
Expand Down Expand Up @@ -592,6 +594,33 @@ Launches *criu* in page server mode.
remote *lazy-pages* daemon to request memory pages in random
order.

*--tls-cacert* 'file'::
Specifies the path to a trusted Certificate Authority (CA) certificate
file to be used for verification of a client or server certificate.
The 'file' must be in PEM format. When this option is used only the
specified CA is used for verification. Otherwise, the system's trusted CAs
and, if present, '/etc/pki/CA/cacert.pem' will be used.

*--tls-cacrl* 'file'::
Specifies a path to a Certificate Revocation List (CRL) 'file' which
contains a list of revoked certificates that should no longer be trusted.
The 'file' must be in PEM format. When this option is not specified, the
file, if present, '/etc/pki/CA/cacrl.pem' will be used.

*--tls-cert* 'file'::
Specifies a path to a file that contains a X.509 certificate to present
to the remote entity. The 'file' must be in PEM format. When this option
is not specified, the default location ('/etc/pki/criu/cert.pem') will be
used.

*--tls-key* 'file'::
Specifies a path to a file that contains TLS private key. The 'file' must
be in PEM format. When this option is not the default location
('/etc/pki/criu/private/key.pem') will be used.

*--tls*::
Use TLS to secure remote connections.

*lazy-pages*
~~~~~~~~~~~~
Launches *criu* in lazy-pages daemon mode.
Expand Down
36 changes: 29 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ endif
# Architecture specific options.
ifeq ($(ARCH),arm)
ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
DEFINES := -DCONFIG_ARMV$(ARMV)
DEFINES := -DCONFIG_ARMV$(ARMV) -DCONFIG_VDSO_32

ifeq ($(ARMV),6)
USERCFLAGS += -march=armv6
Expand All @@ -46,22 +46,26 @@ ifeq ($(ARCH),arm)
endif

PROTOUFIX := y
# For simplicity - compile code in Arm mode without interwork.
# We could choose Thumb mode as default instead - but a dirty
# experiment shows that with 90Kb PIEs Thumb code doesn't save
# even one page. So, let's stick so far to Arm mode as it's more
# universal around all different Arm variations, until someone
# will find any use for Thumb mode. -dima
CFLAGS_PIE := -marm
endif

ifeq ($(ARCH),aarch64)
VDSO := y
DEFINES := -DCONFIG_AARCH64
endif

ifeq ($(ARCH),ppc64)
LDARCH := powerpc:common64
VDSO := y
DEFINES := -DCONFIG_PPC64 -D__SANE_USERSPACE_TYPES__
endif

ifeq ($(ARCH),x86)
LDARCH := i386:x86-64
VDSO := y
DEFINES := -DCONFIG_X86_64
endif

Expand All @@ -74,14 +78,15 @@ endif
ifeq ($(ARCH),s390)
ARCH := s390
SRCARCH := s390
VDSO := y
DEFINES := -DCONFIG_S390
CFLAGS_PIE := -fno-optimize-sibling-calls
endif

CFLAGS_PIE += -DCR_NOGLIBC
export CFLAGS_PIE

LDARCH ?= $(SRCARCH)
export LDARCH VDSO
export LDARCH
export PROTOUFIX DEFINES

#
Expand Down Expand Up @@ -122,9 +127,12 @@ ifeq ($(GMON),1)
export GMON GMONLDOPT
endif

CFLAGS += -iquote flog/include/ -iquote flog/include/uapi

AFLAGS += -D__ASSEMBLY__
CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
export CFLAGS USERCLFAGS HOSTCFLAGS
export AFLAGS CFLAGS USERCLFAGS HOSTCFLAGS

# Default target
all: criu lib crit
Expand Down Expand Up @@ -187,6 +195,7 @@ include Makefile.config
else
# To clean all files, enable make/build options here
export CONFIG_COMPAT := y
export CONFIG_GNUTLS := y
endif

#
Expand All @@ -211,6 +220,17 @@ soccr/built-in.o: $(CONFIG_HEADER) .FORCE
$(SOCCR_A): |soccr/built-in.o
criu-deps += $(SOCCR_A)

#
# Fast logging library
FLOG_A := flog/libflog.a
flog/Makefile: ;
flog/%: $(CONFIG_HEADER) .FORCE
$(Q) $(MAKE) $(build)=flog $@
flog/built-in.o: $(CONFIG_HEADER) .FORCE
$(Q) $(MAKE) $(build)=flog all
$(FLOG_A): | flog/built-in.o
criu-deps += $(FLOG_A)

#
# CRIU building done in own directory
# with slightly different rules so we
Expand Down Expand Up @@ -373,9 +393,11 @@ help:
.PHONY: help

lint:
flake8 --version
flake8 --config=scripts/flake8.cfg test/zdtm.py
flake8 --config=scripts/flake8.cfg test/inhfd/*.py
flake8 --config=scripts/flake8.cfg test/others/rpc/config_file.py
flake8 --config=scripts/flake8.cfg lib/py/images/pb2dict.py

include Makefile.install

Expand Down
12 changes: 8 additions & 4 deletions Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ ifeq ($(call pkg-config-check,libselinux),y)
FEATURE_DEFINES += -DCONFIG_HAS_SELINUX
endif

ifeq ($(NO_GNUTLS)x$(call pkg-config-check,gnutls),xy)
LIBS_FEATURES += -lgnutls
export CONFIG_GNUTLS := y
FEATURE_DEFINES += -DCONFIG_GNUTLS
else
$(info Note: Building without GnuTLS support)
endif

export LIBS += $(LIBS_FEATURES)

CONFIG_FILE = .config
Expand Down Expand Up @@ -57,10 +65,6 @@ $(CONFIG_HEADER): scripts/feature-tests.mak $(CONFIG_FILE)
$(Q) echo '' >> $$@
$(call map,gen-feature-test,$(FEATURES_LIST))
$(Q) cat $(CONFIG_FILE) | sed -n -e '/^[^#]/s/^/#define CONFIG_/p' >> $$@
ifeq ($$(VDSO),y)
$(Q) echo '#define CONFIG_VDSO' >> $$@
$(Q) echo '' >> $$@
endif
$(Q) echo '#endif /* __CR_CONFIG_H__ */' >> $$@
endef

Expand Down
1 change: 0 additions & 1 deletion compel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ccflags-y += -iquote compel/arch/$(ARCH)/src/lib/include
ccflags-y += -iquote compel/include
ccflags-y += -fno-strict-aliasing
ccflags-y += -fPIC
ccflags-y += $(CFLAGS_PIE)
ldflags-y += -r

#
Expand Down
12 changes: 6 additions & 6 deletions compel/arch/arm/plugins/std/syscalls/syscall-aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
#endif

#ifndef __ARM_NR_BASE
# define __ARM_NR_BASE 0x0f0000
# define __ARM_NR_BASE 0x0f0000
#endif

#ifndef __ARM_NR_breakpoint
# define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
# define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
#endif

#ifndef __ARM_NR_cacheflush
# define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
# define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
#endif

#ifndef __ARM_NR_usr26
# define __ARM_NR_usr26 (__ARM_NR_BASE+3)
# define __ARM_NR_usr26 (__ARM_NR_BASE+3)
#endif

#ifndef __ARM_NR_usr32
# define __ARM_NR_usr32 (__ARM_NR_BASE+4)
# define __ARM_NR_usr32 (__ARM_NR_BASE+4)
#endif

#ifndef __ARM_NR_set_tls
# define __ARM_NR_set_tls (__ARM_NR_BASE+5)
# define __ARM_NR_set_tls (__ARM_NR_BASE+5)
#endif
Loading