Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH -next 0/2] tty: Correct tty buffer flush.
@ 2012-12-05  8:47 Ilya Zykov
  0 siblings, 0 replies; only message in thread
From: Ilya Zykov @ 2012-12-05  8:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, Jiri Slaby, linux-kernel, linux-serial

  The root of problem is carelessly zeroing pointer(in function __tty_buffer_flush()),
when another thread can use it. It can be cause of "NULL pointer dereference".
  Main idea of the patch, this is never free last (struct tty_buffer) in the active buffer.
Only flush the data for ldisc(tty->buf.head->read = tty->buf.head->commit).
At that moment driver can collect(write) data in buffer without conflict.
It is repeat behavior of flush_to_ldisc(), only without feeding data to ldisc.

Also revert:
  commit c56a00a165712fd73081f40044b1e64407bb1875
  tty: hold lock across tty buffer finding and buffer filling
In order to delete the unneeded locks any more.

Signed-off-by: Ilya Zykov <ilya@ilyx.ru>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-05  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05  8:47 [PATCH -next 0/2] tty: Correct tty buffer flush Ilya Zykov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox