BUG in tty_open when using containers and ptrace

Grzegorz Nosek root at localdomain.pl
Fri Jul 31 14:58:42 PDT 2009


Dnia 2009-07-30, czw o godzinie 11:06 -0700, Sukadev Bhattiprolu pisze:
> Well, I made some progress on this. In an earlier mail you mentioned
> that your test case "survives" in kernels without the bad commit.
> With the following patch the kernel seems to _survive_ but not sure if
> "surviving" meets your real needs (i.e does the pty continue to function
> as the console for the container) ? 

Both my patch and yours make the console open fail and I'm not sure we
can do much better. I don't think this matters (too much) either as the
supervisor (libvirt_lxc) exits only on container shutdown, so there's
nothing much we can do to the container anyway.

During normal operation the console works just like before. However,
(but this is not related to the patch at all) I can't get it to work
predictably, let alone usefully (mounting the console from the libvirtd
config file silently fails, leaving the console at major:minor 5:1 and
messing with the host's console; mounting it from inside the container
apparently races with something and sometimes fails with /dev/pts/0
missing and anyway exposes the host's console to init). Will see

> The way I understand, the child process does not get an open-file reference
> to the pty. So when the parent closes the pty, devpts_pty_kill() unhashes
> the dentry (although the bind mount() in the child has a reference count
> on dentry).

Sounds plausible and your patch communicates the idea quite clearly.

Best regards,
 Grzegorz Nosek

More information about the Containers mailing list