[CRIU] [PATCH] criu: tty -- Restore tty params synchronously

Cyrill Gorcunov gorcunov at gmail.com
Thu Apr 21 07:32:02 PDT 2016


On Thu, Apr 21, 2016 at 05:22:21PM +0300, Pavel Emelyanov wrote:
> On 04/21/2016 05:10 PM, Cyrill Gorcunov wrote:
> > Async call to do_restore_tty_parms may have a side effect -- the caller
> > doesn't wait for its completion and continue processing tty associated
> > with the fd. userns_call carries own copy of file descriptor and if
> > main code in tty fails then both slave and master may be closed
> > and only one file descriptor remains: the one which userns carries,
> > but the terminal already dead, so when we call do_restore_tty_parms
> > on it we get -EIO.
> 
> But the restore fails anyway, so we do we care?

Yes we care. The restoration of params must be done on alive terminals.
Both peers must be alive when we do such action. The idea behind of
restoring terminal params relies on this fact. Such races really
hard to catch :/


More information about the CRIU mailing list