No description
Find a file
Kirill Tkhai b20780d6a0 files: Fix test and set endianess problem
Andrew Vagin reported the problem found by a checker:

    CID 174702 (#1 of 1): Out-of-bounds access (INCOMPATIBLE_CAST)
    incompatible_cast: Pointer &f->raw.counter points to an object whose
    effective type is int (32 bits, signed) but is dereferenced as a wider
    unsigned long (64 bits, unsigned). This may lead to memory corruption.

It looks like, this points to real problem, which may happen on big-endian
platforms. In the code I relay on the fact, that FDS_EVENT_BIT has a small
number and the value, it determines, fits into int type without problems.
But it's correct only for little-endian.

In case of big-endian, if the word size is 8 bytes, then FDS_EVENT value
is in the last bytes, so there is an access to wrong memory.

To fix the problem, I suggest to use little-endian byte order to work
with task_st futex. Then, the bits from 0 to 31 will be in the low adresses,
i.e. in task_st futex. There is new primitives test_and_set_bit_le() and
set_bit_le() borrowed from the linux kernel for that.

This fixes the problem, but I suppose, the checker does not see the problem
so deep, and just compares the types size, so it will fail again.
So, let's enlarge the bit field size to silence it.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-06 14:09:15 +03:00
contrib scripts/install-debian-packages: add libnet-dev 2017-01-16 11:04:49 +03:00
coredump coredump: Rename dir to coredump 2016-06-28 13:04:58 +03:00
crit crit/decode: set default opts['nopl'] to False 2016-05-30 13:47:54 +03:00
criu files: Fix test and set endianess problem 2017-02-06 14:09:15 +03:00
Documentation crtools: close a signal descriptor after passing a preparation stage 2017-02-03 16:55:07 +03:00
images protobuf: regenerate images on Makefile changes 2017-02-03 18:04:23 +03:00
include/common files: Fix test and set endianess problem 2017-02-06 14:09:15 +03:00
lib py: Fix resp.errno access 2016-12-21 11:23:02 +03:00
scripts Drop prefix from own memcpy/memset/memcmp 2017-02-06 13:29:54 +03:00
soccr soccr: add one more test to check libsoccr_save/libsoccr_restore 2017-02-01 18:41:29 +03:00
test test: check exit codes for criu page-server 2017-02-03 18:04:17 +03:00
.gitignore soccr: Generate config.h dynamically 2017-01-16 11:03:42 +03:00
.mailmap repo: Add mailmap file 2012-03-25 23:31:20 +04:00
.travis.yml travis: enable arm/arm64/ppc builds with clang 2016-12-05 11:49:19 +03:00
COPYING COPYING: fix a typo in a preamble 2016-08-11 16:18:43 +03:00
CREDITS Add the CREDITS file 2012-07-30 13:52:37 +04:00
INSTALL.md Makefile.install: rm unused vars/target 2017-02-06 13:48:49 +03:00
Makefile build: only generate soccr config.h if necessary 2017-01-16 11:03:42 +03:00
Makefile.config make: Add .config file processing (v3) 2016-11-03 20:49:13 +03:00
Makefile.install Makefile.install: rm unused vars/target 2017-02-06 13:48:49 +03:00
Makefile.versions criu: Version 2.10 2017-01-16 12:06:01 +03:00
README.md Add ascciinema tour on basic criu features. 2016-06-16 16:37:06 +03:00

CRIU (Checkpoint and Restore in Userspace)

An utility to checkpoint/restore tasks. Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files. You can then use the files to restore and run the application from the point it was frozen at. The distinctive feature of the CRIU project is that it is mainly implemented in user space.

The project home is at http://criu.org.

Pages worth starting with are:

A video tour on basic CRIU features

CRIU introduction

How to contribute