1. 27 Nov, 2014 1 commit
    • Christian Riesch's avatar
      n_tty: Fix read_buf race condition, increment read_head after pushing data · 8bfbe2de
      Christian Riesch authored
      Commit 19e2ad6a ("n_tty: Remove overflow
      tests from receive_buf() path") moved the increment of read_head into
      the arguments list of read_buf_addr(). Function calls represent a
      sequence point in C. Therefore read_head is incremented before the
      character c is placed in the buffer. Since the circular read buffer is
      a lock-less design since commit 6d76bd26
      ("n_tty: Make N_TTY ldisc receive path lockless"), this creates a race
      condition that leads to communication errors.
      
      This patch modifies the code to increment read_head _after_ the data
      is placed in the buffer and thus fixes the race for non-SMP machines.
      To fix the problem for SMP machines, memory barriers must be added in
      a separate patch.
      Signed-off-by: default avatarChristian Riesch <christian.riesch@omicron.at>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8bfbe2de
  2. 26 Nov, 2014 31 commits
  3. 24 Nov, 2014 2 commits
  4. 22 Nov, 2014 1 commit
  5. 11 Nov, 2014 1 commit
  6. 10 Nov, 2014 1 commit
  7. 09 Nov, 2014 3 commits