1. 09 3月, 2012 4 次提交
  2. 25 2月, 2012 1 次提交
  3. 03 2月, 2012 2 次提交
  4. 25 1月, 2012 1 次提交
    • K
      tty: cleanup prohibition of direct opening for unix98 pty master · 593a27c4
      Konstantin Khlebnikov 提交于
      cleanup hack added in v2.6.27-3203-g15582d36
      
      comment from that patch:
      
      : pty: If the administrator creates a device for a ptmx slave we should not error
      :
      : The open path for ptmx slaves is via the ptmx device. Opening them any
      : other way is not allowed. Vegard Nossum found that previously this was not
      : the case and mknod foo c 128 42; cat foo would produce nasty diagnostics
      :
      : Signed-off-by: Alan Cox <alan@redhat.com>
      : Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
      
      devpts_get_tty() returns non-null only for inodes on devpts, but there is no
      inodes for master-devices, /dev/ptmx (/dev/pts/ptmx) is the only way to open them.
      Thus we can completely forbid lookup for master-devices and eliminate that hack in
      tty_init_dev() because tty_open() will get EIO from tty_driver_lookup_tty().
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      593a27c4
  5. 04 1月, 2012 1 次提交
  6. 16 11月, 2011 7 次提交
  7. 19 10月, 2011 5 次提交
    • G
      Revert "TTY: call tty_driver_lookup_tty unconditionally" · a0340703
      Greg Kroah-Hartman 提交于
      This reverts commit 631180ac.
      
      It caused problems when /dev/tty is a pty:
      	https://lkml.org/lkml/2011/10/12/401
      
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
      Cc: Alan Cox <alan@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a0340703
    • J
      TTY: call tty_driver_lookup_tty unconditionally · 631180ac
      Jiri Slaby 提交于
      Commit 4a2b5fdd (Move tty lookup/reopen to caller) made the call to
      tty_driver_lookup_tty conditional in tty_open. It doesn't look like it
      was an intention. Or if it was, it was not documented in the changelog
      and the code now looks weird. For example there would be no need to
      remember the tty driver and tty index. Further the condition depends
      on a tty which we drop a reference of already.
      
      If I'm looking correctly, this should not matter thanks to the locking
      currently done there. Thus, tty_driver->ttys[idx] cannot change under
      our hands. But anyway, it makes sense to change that to the old
      behaviour.
      
      Introduced-in: v2.6.28-rc2
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
      Cc: Alan Cox <alan@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      631180ac
    • J
      TTY: make tty_add_file non-failing · fa90e1c9
      Jiri Slaby 提交于
      If tty_add_file fails at the point it is now, we have to revert all
      the changes we did to the tty. It means either decrease all refcounts
      if this was a tty reopen or delete the tty if it was newly allocated.
      
      There was a try to fix this in v3.0-rc2 using tty_release in 0259894c
      (TTY: fix fail path in tty_open). But instead it introduced a NULL
      dereference. It's because tty_release dereferences
      filp->private_data, but that one is set even in our tty_add_file. And
      when tty_add_file fails, it's still NULL/garbage. Hence tty_release
      cannot be called there.
      
      To circumvent the original leak (and the current NULL deref) we split
      tty_add_file into two functions, making the latter non-failing. In
      that case we may do the former early in open, where handling failures
      is easy. The latter stays as it is now. So there is no change in
      functionality.
      
      The original bug (leak) was introduced by f573bd17 (tty: Remove
      __GFP_NOFAIL from tty_add_file()). Thanks Dan for reporting this.
      
      Later, we may split tty_release into more functions and call only some
      of them in this fail path instead. (If at all possible.)
      
      Introduced-in: v2.6.37-rc2
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable <stable@vger.kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Pekka Enberg <penberg@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fa90e1c9
    • J
      TTY: drop driver reference in tty_open fail path · c290f835
      Jiri Slaby 提交于
      When tty_driver_lookup_tty fails in tty_open, we forget to drop a
      reference to the tty driver. This was added by commit 4a2b5fdd (Move
      tty lookup/reopen to caller).
      
      Fix that by adding tty_driver_kref_put to the fail path.
      
      I will refactor the code later. This is for the ease of backporting to
      stable.
      
      Introduced-in: v2.6.28-rc2
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c290f835
    • T
      tty: Support compat_ioctl get/set termios_locked · 8193c429
      Thomas Meyer 提交于
      When running a Fedora 15 (x86) on an x86_64 kernel, in the boot process
      plymouthd complains about those two missing ioctls:
      [    2.581783] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005457){t:'T';sz:0} arg(ffb6a5d0) on /dev/tty1
      [    2.581803] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005456){t:'T';sz:0} arg(ffb6a680) on /dev/tty1
      
      both ioctl functions work on the 'struct termios' resp. 'struct termios2',
      which has the same size (36 bytes resp. 44 bytes) on x86 and x86_64,
      so it's just a matter of converting the pointer from userland.
      Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8193c429
  8. 24 8月, 2011 1 次提交
    • J
      TTY: pty, fix pty counting · 24d406a6
      Jiri Slaby 提交于
      tty_operations->remove is normally called like:
      queue_release_one_tty
       ->tty_shutdown
         ->tty_driver_remove_tty
           ->tty_operations->remove
      
      However tty_shutdown() is called from queue_release_one_tty() only if
      tty_operations->shutdown is NULL. But for pty, it is not.
      pty_unix98_shutdown() is used there as ->shutdown.
      
      So tty_operations->remove of pty (i.e. pty_unix98_remove()) is never
      called. This results in invalid pty_count. I.e. what can be seen in
      /proc/sys/kernel/pty/nr.
      
      I see this was already reported at:
        https://lkml.org/lkml/2009/11/5/370
      But it was not fixed since then.
      
      This patch is kind of a hackish way. The problem lies in ->install. We
      allocate there another tty (so-called tty->link). So ->install is
      called once, but ->remove twice, for both tty and tty->link. The fix
      here is to count both tty and tty->link and divide the count by 2 for
      user.
      
      And to have ->remove called, let's make tty_driver_remove_tty() global
      and call that from pty_unix98_shutdown() (tty_operations->shutdown).
      
      While at it, let's document that when ->shutdown is defined,
      tty_shutdown() is not called.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      24d406a6
  9. 02 7月, 2011 1 次提交
  10. 26 4月, 2011 1 次提交
  11. 20 4月, 2011 6 次提交
  12. 31 3月, 2011 1 次提交
  13. 02 3月, 2011 1 次提交
  14. 18 2月, 2011 4 次提交
  15. 26 1月, 2011 1 次提交
    • T
      console: rename acquire/release_console_sem() to console_lock/unlock() · ac751efa
      Torben Hohn 提交于
      The -rt patches change the console_semaphore to console_mutex.  As a
      result, a quite large chunk of the patches changes all
      acquire/release_console_sem() to acquire/release_console_mutex()
      
      This commit makes things use more neutral function names which dont make
      implications about the underlying lock.
      
      The only real change is the return value of console_trylock which is
      inverted from try_acquire_console_sem()
      
      This patch also paves the way to switching console_sem from a semaphore to
      a mutex.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert]
      Signed-off-by: NTorben Hohn <torbenh@gmx.de>
      Cc: Thomas Gleixner <tglx@tglx.de>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ac751efa
  16. 23 1月, 2011 1 次提交
  17. 17 12月, 2010 2 次提交