[CRIU] Re: [PATCH 14/16] parasite: To execute parasite blob we need prepare regs

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 14 05:51:31 EST 2012


On Tue, Feb 14, 2012 at 02:49:44PM +0400, Cyrill Gorcunov wrote:
> On Tue, Feb 14, 2012 at 02:47:05PM +0400, Pavel Emelyanov wrote:
> > > +static void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs)
> > > +{
> > > +	regs->ip = new_ip;
> > > +
> > > +	/* Avoid end of syscall processing */
> > > +	regs->orig_ax = -1;
> > > +
> > > +	/* Make sure flags are in known state */
> > > +	regs->flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_DF | X86_EFLAGS_IF);
> > 
> > Why these flags?
> > 
> 
> The most important one is X86_EFLAGS_DF, we never knew what exatly the
> program we're injecting to is doing with it, thus it's possible DF
> will be cleaned and all ours "stos" instructions might be completely

Will be set rather (sorry). When this flag is set the "stos" and friends
decrement counters on string operations (which gcc frequently emit
to zeroify structures and such).

	Cyrill


More information about the CRIU mailing list