[CRIU] Bad commit

Cyrill Gorcunov gorcunov at gmail.com
Thu Aug 14 06:35:08 PDT 2014


On Thu, Aug 14, 2014 at 05:01:08PM +0400, Pavel Emelyanov wrote:
> On 08/14/2014 04:49 PM, Cyrill Gorcunov wrote:
> > On Thu, Aug 14, 2014 at 04:32:46PM +0400, Pavel Emelyanov wrote:
> >>> 	if ((clone_flags & CLONE_PARENT) &&
> >>> 				current->signal->flags & SIGNAL_UNKILLABLE)
> >>
> >> UNKILLABLE??? The caller of criu is unkillable?! Why?
> > 
> > So, I'm restoring container with --restore-detached, where first process
> > is init with PID = 1, the kerne sets SIGNAL_UNKILLABLE to it, then new
> > fork continue using CLONE_PARENT and we exit out with error.
> 
> That's the problem -- CLONE_PARENT is (should be) only set on criu -> init fork().

Guys, I found the problem. Here is the kernel's code

long do_fork(unsigned long clone_flags,
	      unsigned long stack_start,
	      unsigned long stack_size,
	      int __user *parent_tidptr,
	      int __user *child_tidptr)
{
	struct task_struct *p;
	int trace = 0;
	long nr;

	/*
	 * Do some preliminary argument and permissions checking before we
	 * actually start allocating stuff
	 */
	if (clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) {
		if (clone_flags & (CLONE_THREAD|CLONE_PARENT))
			return -EINVAL;
	}

because we're restoring container in own pid namespace passing clone-parent
triggers this condition and we're hitting einval. Ideas?


More information about the CRIU mailing list