15 Feb, 2016

1 commit


07 Feb, 2016

1 commit

  • When the tty lock is interrupted on attempted re-open, 2 tty krefs
    are still held. Drop extra kref before returning failure from
    tty_lock_interruptible(), and drop lookup kref before returning
    failure from tty_open().

    Fixes: 0bfd464d3fdd ("tty: Wait interruptibly for tty lock on reopen")
    Reported-by: Dmitry Vyukov
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

28 Jan, 2016

1 commit


27 Jan, 2016

1 commit


14 Dec, 2015

1 commit


03 Feb, 2015

1 commit


10 Jan, 2015

1 commit

  • Commit 2aff5e2bc62db43e05c814461a08aff0fc2b7fe5 ('tty: Change
    tty lock order to master->slave') added a warning which is broken
    and unnecessary now that the tty lock has fixed lock subclasses,
    added in commit 2febdb632bb96235b94b8fccaf882a78f8f4b2bb
    ('tty: Preset lock subclass for nested tty locks').

    Reported-by: Dan Carpenter
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

06 Nov, 2014

2 commits

  • Eliminate the requirement of specifying the tty lock nesting at
    lock time; instead, set the lock subclass for slave ptys at pty
    install (normal ttys and master ptys use subclass 0).

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     
  • When releasing the master pty, the slave pty also needs to be locked
    to prevent concurrent tty count changes for the slave pty and to
    ensure that only one parallel master and slave release observe the
    final close, and proceed to destruct the pty pair. Conversely, when
    releasing the slave pty, locking the master pty is not necessary
    (since the master's state can be inferred by the slave tty count).

    Introduce tty_lock_slave()/tty_unlock_slave() which acquires/releases
    the tty lock of the slave pty. Remove tty_lock_pair()/tty_unlock_pair().

    Dropping the tty_lock is no longer required to re-establish a stable
    lock order.

    Reviewed-by: Alan Cox
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

25 Oct, 2012

1 commit


11 Aug, 2012

1 commit

  • The termios and other changes mean the other protections needed on the driver
    tty arrays should be adequate. Turn it all back on.

    This contains pieces folded in from the fixes made to the original patches

    | From: Geert Uytterhoeven (fix m68k)
    | From: Paul Gortmaker (fix cris)
    | From: Jiri Kosina (lockdep)
    | From: Eric Dumazet (lockdep)

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

17 Jul, 2012

1 commit

  • I sent GregKH this after the pre-requisites. He dropped the pre-requesites
    for good reason and unfortunately then applied this patch. Without this
    reverted you get random kernel memory corruption which will make bisecting
    anything between it and the properly applied patches a complete sod.

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

07 Jul, 2012

1 commit

  • The termios and other changes mean the other protections needed on the driver
    tty arrays should be adequate. Turn it all back on.

    This contains pieces folded in from the fixes made to the original patches

    | From: Geert Uytterhoeven (fix m68k)
    | From: Paul Gortmaker (fix cris)
    | From: Jiri Kosina (lockdep)
    | From: Eric Dumazet (lockdep)

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

03 Jun, 2012

1 commit

  • This reverts the tty layer change to use per-tty locking, because it's
    not correct yet, and fixing it will require some more deep surgery.

    The main revert is d29f3ef39be4 ("tty_lock: Localise the lock"), but
    there are several smaller commits that built upon it, they also get
    reverted here. The list of reverted commits is:

    fde86d310886 - tty: add lockdep annotations
    8f6576ad476b - tty: fix ldisc lock inversion trace
    d3ca8b64b97e - pty: Fix lock inversion
    b1d679afd766 - tty: drop the pty lock during hangup
    abcefe5fc357 - tty/amiserial: Add missing argument for tty_unlock()
    fd11b42e3598 - cris: fix missing tty arg in wait_event_interruptible_tty call
    d29f3ef39be4 - tty_lock: Localise the lock

    The revert had a trivial conflict in the 68360serial.c staging driver
    that got removed in the meantime.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

01 Jun, 2012

1 commit


05 May, 2012

1 commit

  • In each remaining case the tty_lock is associated with a specific tty. This
    means we can now lock on a per tty basis. We do need tty_lock_pair() for
    the pty case. Uglier but still a step in the right direction.

    [fixed up calls in 3 missing drivers - gregkh]

    Signed-off-by: Alan Cox
    Acked-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

24 Aug, 2011

1 commit

  • We used it really only serial and ami_serial. The rest of the
    callsites were BUG/WARN_ONs to check if BTM is held. Now that we
    pruned tty_locked from both of the real users, we can get rid of
    tty_lock along with __big_tty_mutex_owner.

    Signed-off-by: Jiri Slaby
    Acked-by: Arnd Bergmann
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

20 Apr, 2011

1 commit


05 Nov, 2010

1 commit