[lkml]   [2008]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: + n_tty-loss-of-sync-following-a-buffer-overflow.patch added to -mm tree
Paul Fulghum wrote:
> What I suggest is the following patch for processing NL
> in canonical mode.


I tested my patch by provoking the bug with
a contrived pair of programs. Everything works
as expected. Partially receive lines during buffer
overflow are truncated. Subsequent lines after the
ldisc buffer clears are intact, canon_data stays
consistent with read_flags.

*But* to force the bug I had to disable the
check in flush_to_ldisc() that monitors the
amount of receive room in the ldisc buffer
before pushing data to the ldisc. This check
was introduced in the flip buffer rewrite in 2.6

So the bug is real, the fix works, but in 2.6.24
this can never occur as the flip buffer holds data
until N_TTY is ready to process it.

Rupesh is working with 2.4.x which shares the
same canonical NL processing but has the old
flip buffer code that shoves data at N_TTY without
regard for the receive room in N_TTY.

I leave it to others to decide if applying the
patch to 2.6 makes sense.

Paul Fulghum
Microgate Systems, Ltd.

 \ /
  Last update: 2008-03-12 21:05    [W:0.024 / U:3.376 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site