[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52AFA7CF.3050800@hurleysoftware.com>
Date: Mon, 16 Dec 2013 20:24:31 -0500
From: Peter Hurley <peter@...leysoftware.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Stas Sergeev <stsp@...t.ru>,
Margarita Manterola <margamanterola@...il.com>,
linux-kernel@...r.kernel.org,
One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
Caylan Van Larson <i@...lan.net>,
Maximiliano Curia <maxy@...servers.com.ar>,
Pavel Machek <pavel@....cz>,
Arkadiusz Miskiewicz <a.miskiewicz@...il.com>
Subject: Re: [PATCH v4] n_tty: Fix buffer overruns with larger-than-4k pastes
On 12/16/2013 07:57 PM, Greg Kroah-Hartman wrote:
> On Tue, Dec 10, 2013 at 05:12:02PM -0500, Peter Hurley wrote:
>> readline() inadvertently triggers an error recovery path when
>> pastes larger than 4k overrun the line discipline buffer. The
>> error recovery path discards input when the line discipline buffer
>> is full and operating in canonical mode and no newline has been
>> received. Because readline() changes the termios to non-canonical
>> mode to read the line char-by-char, the line discipline buffer
>> can become full, and then when readline() restores termios back
>> to canonical mode for the caller, the now-full line discipline
>> buffer triggers the error recovery.
>>
>> When changing termios from non-canon to canon mode and the read
>> buffer contains data, simulate an EOF push _without_ the
>> DISABLED_CHAR in the read buffer.
>>
>> Importantly for the readline() problem, the termios can be
>> changed back to non-canonical mode without changes to the read
>> buffer occurring; ie., as if the previous termios change had not
>> happened (as long as no intervening read took place).
>>
>> Preserve existing userspace behavior which allows '\0's already
>> received in non-canon mode to be read as '\0's in canon mode
>> (rather than trigger add'l EOF pushes or an actual EOF).
>>
>> Patch based on original proposal and discussion here
>> https://bugzilla.kernel.org/show_bug.cgi?id=55991
>> by Stas Sergeev <stsp@...rs.sourceforge.net>
>>
>> Reported-by: Margarita Manterola <margamanterola@...il.com>
>> Cc: Maximiliano Curia <maxy@...servers.com.ar>
>> Cc: Pavel Machek <pavel@....cz>
>> Cc: Arkadiusz Miskiewicz <a.miskiewicz@...il.com>
>> Acked-by: Stas Sergeev <stsp@...rs.sourceforge.net>
>> Signed-off-by: Peter Hurley <peter@...leysoftware.com>
>> ---
>
> Is this a 3.13-final thing, or can it wait for 3.14-rc1?
Definitely not 3.13 at this point -- it should go to -next.
Regards,
Peter Hurley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists