[CRIU] Restore fails for test/rpc/test-c

Pavel Emelyanov xemul at parallels.com
Fri Nov 13 04:42:42 PST 2015


On 11/13/2015 08:58 AM, Gabriel Southern wrote:
> I'm interested in using criu for creating/restoring checkpoints from within an 
> application that would be run as a regular user (not root).

:)

> I've been looking at the code in test/rpc/test-c.c to see an example of how this
> could work.  

There's a long story behind this. In the early stages we suggested using criu
service started from root and an application willing to C/R talking to it via a
unix socket. http://criu.org/RPC

Later on, the service was recognized as a security hole and we no longer recommend
people to make it publicly available when launched from root user. Instead, we
started working on the user-mode dump and restore. The latest patches are [1] but
it's still not 100% complete. In particular, the error you mention below is still
not fixed.

[1] https://lists.openvz.org/pipermail/criu/2015-October/022455.html


We planned to have this set finished and merged by 1.8, but we're short of resources,
so patches are now scheduled for 1.9.

> But when I run this test using the run.sh script I'm getting an error
> during the restore step.  Looking at the restore-c.log file the error that I see is:
> 
> pie: Error (pie/restorer.c:1085): prctl failed @1085 with -22

Yup, this is due to kernel restrictions on restoring the exe link. Right now
there's nothing that can be done about it, but not to restore one. Tasks will
continue running, but in /proc/pid/exe you would see criu, not the original
binary.

In the long term someone should start talking to the kernel people about 
relaxing those checks.

> (full output available here: https://gist.github.com/southerngs/238a6f14ab61296587cc)
> 
> If I could get the criu tests to pass I'd be able to use the libcriu C api for what I
> need.  But I'm not sure what I need to do to get these tests to pass.  Any suggestions
> are appreciated.
> 
> Also in case it matters I'm running Arch Linux.  My kernel is 4.2.5-1 and compiled
> with the Arch Linux defaults and with the options listed on the wiki page
> (https://criu.org/Installation#Configuring_the_kernel).

-- Pavel



More information about the CRIU mailing list