• Peter Hurley's avatar
    pty: Fix buffer flush deadlock · 1d1d14da
    Peter Hurley authored
    The pty driver does not clear its write buffer when commanded.
    This is to avoid an apparent deadlock between parallel flushes from
    both pty ends; specifically when handling either BRK or INTR input.
    However, parallel flushes from this source is not possible since
    the pty master can never be set to BRKINT or ISIG. Parallel flushes
    from other sources are possible but these do not threaten deadlocks.
    
    Annotate the tty buffer mutex for lockdep to represent the nested
    tty_buffer locking which occurs when the pty slave is processing input
    (its buffer mutex held) and receives INTR or BRK and acquires the
    linked tty buffer mutex via tty_buffer_flush().
    Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    1d1d14da
tty_buffer.c 14.3 KB