BUG in tty_open when using containers and ptrace

Grzegorz Nosek root at localdomain.pl
Tue Jul 7 00:34:53 PDT 2009


On pon, lip 06, 2009 at 08:31:35 -0700, Sukadev Bhattiprolu wrote:
> | To my untrained eye it looks like the cmpl corresponds to:
> | 
> | 1841        if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
> | 1842            tty->driver->subtype == PTY_TYPE_MASTER)
> | 
> | in drivers/char/tty_io.c
> 
> I don't yet have the exact version of tty_io.c so the line numbers don't
> match, but even so isn't the above 'cmpl' comparing a constant 0x10004
> with the %rdx+0x9c address ? If so, I am not sure how it matches up to
> either TTY_DRIVER_TYPE_PTY (0x0004) or PTY_TYPE_MASTER (0x0001).
> 
> Wouldn't the above 'if' require two separate compare instructions ?

They're two 16-bit words occupying the same 32-bit word, so presumably
gcc optimised it into a single memory access.

> Is it possibly related to this bug where they talk of some sort of
> corruption going on with tty data structures (kernel versions appear
> to be close, but need to double check).
> 
> 	http://lkml.org/lkml/2009/6/16/131

2.6.30 has no tty_ldisc_hangup (the function being touched) at all. I
guess it was added while restructuring the tty layer. I'll have a look
at it though, thanks for the link.

Best regards,
 Grzegorz Nosek


More information about the Containers mailing list