1. 16 8月, 2008 1 次提交
  2. 23 7月, 2008 1 次提交
  3. 21 7月, 2008 4 次提交
  4. 07 6月, 2008 1 次提交
  5. 30 4月, 2008 5 次提交
  6. 28 4月, 2008 2 次提交
  7. 08 2月, 2008 1 次提交
  8. 07 2月, 2008 1 次提交
  9. 29 1月, 2008 1 次提交
  10. 09 1月, 2008 1 次提交
  11. 07 11月, 2007 1 次提交
    • A
      [TTY]: Fix network driver interactions with TCGET/SET calls. · 0fc00e24
      Alan Cox 提交于
      Dave Miller noted various cases where line disciplines for things like
      ppp go poking around in termios themselves in ways that broke with the
      new termios code. Rather than have them all learning about termios
      internals provide proper methods for this
      
      - tty_mode_ioctl()
      
      	This handles all the terminal mode handling for speed/carrier
      etc and none of the methods are ldisc dependant so they can be called
      by any user
      
      - tty_perform_flush()
      
      	This extracts the flush functionality and enables pppd the ppp
      layer to share it cleanly.
      
      The existing n_tty_ioctl code is refactored in this patch to provide
      the new functions and to call them itself appropriately. This patch
      has no (intended) behaviour changes and simply prepares for the other
      fixes.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fc00e24
  12. 17 10月, 2007 2 次提交
    • A
      tty: expose new methods needed for drivers to get termios right · 5f519d72
      Alan Cox 提交于
      This adds three new functions (or in one case to be more exact makes it
      always available)
      
      tty_termios_copy_hw
      
      Copies all the hardware settings from one termios structure to the other.
      This is intended for drivers that support little or no hardware setting
      
      tty_termios_encode_baud_rate
      
      Allows you to set the input and output baud rate in a termios structure.  A
      driver is supposed to set the resulting baud rate from a request so most
      will want to use this function to set the resulting input and output rates
      to match the hardware values.  Internally it knows about keeping Bxxx
      encoding when possible to maximise compatibility.
      
      tty_encode_baud_rate
      
      As above but for the tty's own current termios structure
      
      I suspect this will initially need some tweaking as it gets enabled by
      driver patches over the next few mm cycles so consider this lot -mm only
      for the moment so it can stabilize and end up neat before it goes to base.
      
      I've tried not to break any obscure architectures - if you get a speed you
      can't represent the code will print warnings on non updated termios systems
      but not break.
      
      Once this is merged and seems sane I've got a growing pile of driver
      updates to use it - notably for USB serial drivers.
      
      [akpm@linux-foundation.org: cleanups]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f519d72
    • A
      tty.h: remove dead define · 328dfd0f
      Alan Cox 提交于
      No longer used. TTY_FLIPBUF_SIZE will also go soon but needs a couple of
      other cleanups first
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      328dfd0f
  13. 13 10月, 2007 1 次提交
  14. 12 8月, 2007 1 次提交
    • A
      fix serial buffer memory leak · 42fd552e
      Alan Cox 提交于
      Patch c5c34d48 (tty: flush flip buffer on
      ldisc input queue flush) introduces a race condition which can lead to memory
      leaks.
      
      The problem can be triggered when tcflush() is called when data are being
      pushed to the line discipline driver by flush_to_ldisc().
      
      flush_to_ldisc() releases tty->buf.lock when calling the line discipline
      receive_buf function. At that poing tty_buffer_flush() kicks in and sets both
      tty->buf.head and tty->buf.tail to NULL. When flush_to_ldisc() finishes, it
      restores tty->buf.head but doesn't touch tty->buf.tail. This corrups the
      buffer queue, and the next call to tty_buffer_request_room() will allocate a
      new buffer and overwrite tty->buf.head. The previous buffer is then lost
      forever without being released.
      
      (Thanks to Laurent for the above text, for finding, disgnosing and reporting
      the bug)
      
      - Use tty->flags bits for the flush status.
      
      - Wait for the flag to clear again before returning
      
      - Fix the doc error noted
      
      - Fix flush of empty queue leaving stale flushpending
      
      [akpm@linux-foundation.org: cleanup]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NPaul Fulghum <paulkf@microgate.com>
      Cc: Laurent Pinchart <laurentp@cse-semaphore.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42fd552e
  15. 17 7月, 2007 2 次提交
    • M
      Audit: add TTY input auditing · 522ed776
      Miloslav Trmac 提交于
      Add TTY input auditing, used to audit system administrator's actions.  This is
      required by various security standards such as DCID 6/3 and PCI to provide
      non-repudiation of administrator's actions and to allow a review of past
      actions if the administrator seems to overstep their duties or if the system
      becomes misconfigured for unknown reasons.  These requirements do not make it
      necessary to audit TTY output as well.
      
      Compared to an user-space keylogger, this approach records TTY input using the
      audit subsystem, correlated with other audit events, and it is completely
      transparent to the user-space application (e.g.  the console ioctls still
      work).
      
      TTY input auditing works on a higher level than auditing all system calls
      within the session, which would produce an overwhelming amount of mostly
      useless audit events.
      
      Add an "audit_tty" attribute, inherited across fork ().  Data read from TTYs
      by process with the attribute is sent to the audit subsystem by the kernel.
      The audit netlink interface is extended to allow modifying the audit_tty
      attribute, and to allow sending explanatory audit events from user-space (for
      example, a shell might send an event containing the final command, after the
      interactive command-line editing and history expansion is performed, which
      might be difficult to decipher from the TTY input alone).
      
      Because the "audit_tty" attribute is inherited across fork (), it would be set
      e.g.  for sshd restarted within an audited session.  To prevent this, the
      audit_tty attribute is cleared when a process with no open TTY file
      descriptors (e.g.  after daemon startup) opens a TTY.
      
      See https://www.redhat.com/archives/linux-audit/2007-June/msg00000.html for a
      more detailed rationale document for an older version of this patch.
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NMiloslav Trmac <mitr@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Cc: Steve Grubb <sgrubb@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      522ed776
    • A
      Prevent an O_NDELAY writer from blocking when a tty write is blocked by the tty atomic writer mutex · 9c1729db
      Alan Cox 提交于
      Without this a tty write could block if a previous blocking tty write was
      in progress on the same tty and blocked by a line discipline or hardware
      event.  Originally found and reported by Dave Johnson.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NDave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c1729db
  16. 09 5月, 2007 1 次提交
    • E
      tty: introduce no_tty and use it in selinux · 98a27ba4
      Eric W. Biederman 提交于
      While researching the tty layer pid leaks I found a weird case in selinux when
      we drop a controlling tty because of inadequate permissions we don't do the
      normal hangup processing.  Which is a problem if it happens the session leader
      has exec'd something that can no longer access the tty.
      
      We already have code in the kernel to handle this case in the form of the
      TIOCNOTTY ioctl.  So this patch factors out a helper function that is the
      essence of that ioctl and calls it from the selinux code.
      
      This removes the inconsistency in handling dropping of a controlling tty and
      who knows it might even make some part of user space happy because it received
      a SIGHUP it was expecting.
      
      In addition since this removes the last user of proc_set_tty outside of
      tty_io.c proc_set_tty is made static and removed from tty.h
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: James Morris <jmorris@namei.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      98a27ba4
  17. 13 2月, 2007 3 次提交
    • E
      [PATCH] tty: update the tty layer to work with struct pid · ab521dc0
      Eric W. Biederman 提交于
      Of kernel subsystems that work with pids the tty layer is probably the largest
      consumer.  But it has the nice virtue that the assiation with a session only
      lasts until the session leader exits.  Which means that no reference counting
      is required.  So using struct pid winds up being a simple optimization to
      avoid hash table lookups.
      
      In the long term the use of pid_nr also ensures that when we have multiple pid
      spaces mixed everything will work correctly.
      Signed-off-by: NEric W. Biederman <eric@maxwell.lnxi.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ab521dc0
    • E
      [PATCH] pid: replace is_orphaned_pgrp with is_current_pgrp_orphaned · 3e7cd6c4
      Eric W. Biederman 提交于
      Every call to is_orphaned_pgrp passed in process_group(current) which is racy
      with respect to another thread changing our process group.  It didn't bite us
      because we were dealing with integers and the worse we would get would be a
      stale answer.
      
      In switching the checks to use struct pid to be a little more efficient and
      prepare the way for pid namespaces this race became apparent.
      
      So I simplified the calls to the more specialized is_current_pgrp_orphaned so
      I didn't have to worry about making logic changes to avoid the race.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3e7cd6c4
    • E
      [PATCH] tty: make __proc_set_tty static · cdc62330
      Eric W. Biederman 提交于
      The aim of this patch set is to start wrapping up the struct pid conversions.
      As such this patchset culminates with the removal of kill_pg, kill_pg_info,
      __kill_pg_info, do_each_task_pid, and while_each_task_pid.
      
      kill_proc, daemonize, and kernel_thread are still in my sights but there is
      still work to get to them.
      
      The first three are basic cleanups around disassociate_ctty, while working on
      converting it I found several issues.  tty_old_pgrp can be a tricky concept to
      wrap your head around.
      
       1 tty: Make __proc_set_tty static.
       2 tty: Clarify disassociate_ctty
       3 tty: Fix the locking for signal->session in disassociate_ctty
      
      These just stop using the old helper functions.
      
       4 signal: Use kill_pgrp not kill_pg in the sunos compatibility code.
       5 signal: Rewrite kill_something_info so it uses newer helpers.
      
      Then the grind to convert the tty layer and all of it's helper functions to
      struct pid.
      
       6 pid: Make session_of_pgrp use struct pid instead of pid_t.
       7 pid: Use struct pid for talking about process groups in exit.c
       8 pid: Replace is_orphaned_pgrp with is_current_pgrp_orphaned
       9 tty: Update the tty layer to work with struct pid.
      
      A final helper function update.
      
      10 pid: Replace do/while_each_task_pid with do/while_each_pid_task
      
      And the removal of the functions that are now unused.
      11 pid: Remove now unused do_each_task_pid and while_each_task_pid
      12 pid: Remove the now unused kill_pg kill_pg_info and __kill_pg_info
      
      All of these should be fairly simple and to the point.
      
      This patch:
      
      Currently all users of __proc_set_tty are in tty_io.c so make the function
      static.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cdc62330
  18. 12 2月, 2007 2 次提交
    • T
      [PATCH] consolidate line discipline number definitions · 4564f9e5
      Tilman Schmidt 提交于
      The line discipline numbers N_* are currently defined for each architecture
      individually, but (except for a seeming mistake) identically, in
      asm/termios.h.  There is no obvious reason why these numbers should be
      architecture specific, nor any apparent relationship with the termios
      structure.  The total number of these, NR_LDISCS, is defined in linux/tty.h
      anyway.  So I propose the following patch which moves the definitions of
      the individual line disciplines to linux/tty.h too.
      
      Three of these numbers (N_MASC, N_PROFIBUS_FDL, and N_SMSBLOCK) are unused
      in the current kernel, but the patch still keeps the complete set in case
      there are plans to use them yet.
      Signed-off-by: NTilman Schmidt <tilman@imap.cc>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4564f9e5
    • E
      [PATCH] vt: refactor console SAK processing · 8b6312f4
      Eric W. Biederman 提交于
      This does several things.
      - It moves looking up of the current foreground console into process
        context where we can safely take the semaphore that protects this
        operation.
      - It uses the new flavor of work queue processing.
      - This generates a factor of do_SAK, __do_SAK that runs immediately.
      - This calls __do_SAK with the console semaphore held ensuring nothing
        else happens to the console while we process the SAK operation.
      - With the console SAK processing moved into process context this
        patch removes the xchg operations that I used to attempt to attomically
        update struct pid, because of the strange locking used in the SAK processing.
        With SAK using the normal console semaphore nothing special is needed.
      
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8b6312f4
  19. 09 12月, 2006 2 次提交
    • A
      [PATCH] tty: switch to ktermios and new framework · edc6afc5
      Alan Cox 提交于
      This is the core of the switch to the new framework.  I've split it from the
      driver patches which are mostly search/replace and would encourage people to
      give this one a good hard stare.
      
      The references to BOTHER and ISHIFT are the termios values that must be
      defined by a platform once it wants to turn on "new style" ioctl support.  The
      code patches here ensure that providing
      
      1. The termios overlays the ktermios in memory
      2. The only new kernel only fields are c_ispeed/c_ospeed (or none)
      
      the existing behaviour is retained.  This is true for the patches at this
      point in time.
      
      Future patches will define BOTHER, ISHIFT and enable newer termios structures
      for each architecture, and once they are all done some of the ifdefs also
      vanish.
      
      [akpm@osdl.org: warning fix]
      [akpm@osdl.org: IRDA fix]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      edc6afc5
    • P
      [PATCH] tty: ->signal->tty locking · 24ec839c
      Peter Zijlstra 提交于
      Fix the locking of signal->tty.
      
      Use ->sighand->siglock to protect ->signal->tty; this lock is already used
      by most other members of ->signal/->sighand.  And unless we are 'current'
      or the tasklist_lock is held we need ->siglock to access ->signal anyway.
      
      (NOTE: sys_unshare() is broken wrt ->sighand locking rules)
      
      Note that tty_mutex is held over tty destruction, so while holding
      tty_mutex any tty pointer remains valid.  Otherwise the lifetime of ttys
      are governed by their open file handles.  This leaves some holes for tty
      access from signal->tty (or any other non file related tty access).
      
      It solves the tty SLAB scribbles we were seeing.
      
      (NOTE: the change from group_send_sig_info to __group_send_sig_info needs to
             be examined by someone familiar with the security framework, I think
             it is safe given the SEND_SIG_PRIV from other __group_send_sig_info
             invocations)
      
      [schwidefsky@de.ibm.com: 3270 fix]
      [akpm@osdl.org: various post-viro fixes]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NAlan Cox <alan@redhat.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Chris Wright <chrisw@sous-sol.org>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jan Kara <jack@ucw.cz>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      24ec839c
  20. 02 12月, 2006 1 次提交
  21. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  22. 01 10月, 2006 1 次提交
  23. 30 9月, 2006 2 次提交
  24. 28 8月, 2006 1 次提交
  25. 11 7月, 2006 1 次提交