Peter Hurley b848305276 n_tty: Fix unsafe update of available buffer space
receive_room is used to control the amount of data the flip
buffer work can push to the read buffer. This update is unsafe:

  CPU 0                        |  CPU 1
                               |
                               | n_tty_read()
                               |   n_tty_set_room()
                               |     left = <calc of space>
n_tty_receive_buf()            |
  <push data to buffer>        |
  n_tty_set_room()             |
    left = <calc of space>     |
    tty->receive_room = left   |
                               |     tty->receive_room = left

receive_room is now updated with a stale calculation of the
available buffer space, and the subsequent work loop will likely
overwrite unread data in the input buffer.

Update receive_room atomically with the calculation of the
available buffer space.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 12:55:30 -07:00
..
2013-05-17 14:31:05 -04:00
2013-06-03 14:31:39 -07:00
2013-05-30 18:27:24 -07:00
2013-04-26 22:30:25 +02:00
2013-05-09 09:59:16 -07:00
2013-05-23 18:24:10 -07:00
2013-05-06 14:59:13 -07:00
2013-06-08 15:50:42 -07:00
2013-05-20 13:38:14 -07:00
2013-06-13 10:13:29 -07:00
2013-06-01 19:53:41 +09:00
2013-06-14 19:15:36 -10:00
2013-05-15 10:58:22 -07:00
2013-06-13 22:12:14 +01:00
2013-05-07 14:04:56 -07:00
2013-05-07 14:02:00 -07:00
2013-06-06 16:34:11 -07:00
2013-06-17 12:00:22 -07:00
2013-06-05 08:54:16 -06:00
2013-06-11 02:46:21 -07:00
2013-06-08 21:23:33 -07:00
2013-05-04 12:31:18 -07:00
2013-05-04 12:31:18 -07:00