lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Jan 2015 15:05:33 -0500
From:	Peter Hurley <peter@...leysoftware.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Jiri Slaby <jslaby@...e.cz>,
	Christian Riesch <christian.riesch@...cron.at>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	Denis Du <dudenis2000@...oo.ca>,
	Måns Rullgård <mans@...sr.com>,
	Peter Hurley <peter@...leysoftware.com>
Subject: [PATCH v3 0/6] N_TTY input path fixes

Greg,

Here's the unordered access fix blown up to a series :(

The first patch removes receive_room() from the non-producer code
paths; this avoids the complication of read_head access from the
consumer-side. Exclusive-use paths (where the termios_rwsem is write-locked,
such as n_tty_set_termios(), n_tty_ioctl() and n_tty_flush_buffer()) can
access any of the buffer indexes without racing, since both the input
worker and reader are excluded by the write lock.

The second patch fixes a failure to make forward progress if an
unterminated line longer than 3967 chars is received in canonical mode; the
tty will mistakenly be throttled and thus potentially never receive the
line termination.

The third patch simplifies the throttle threshold calculation, _and_
removes the last-but-one receive_room() call site.

The fourth patch fixes the unordered read buffer accesses with weakly-
ordered arches.

The fifth patch fixes the space calculation issue noted by Christian;
while this is low priority, the subsequent patch requires it.

The sixth patch fixes input handling when a line termination has
not been received and the read buffer is full.

I'll send a separate email for which stables these can be directly applied;
then I'll get to work on backporting these fixes to the other longterm
stable trees.

Regards,

Peter Hurley (6):
  n_tty: Eliminate receive_room() from consumer/exclusive paths
  n_tty: Fix throttle for canon lines > 3967 chars
  n_tty: Simplify throttle threshold calculation
  n_tty: Fix unordered accesses to lockless read buffer
  n_tty: Fix PARMRK over-throttling
  n_tty: Fix read buffer overwrite when no newline

 drivers/tty/n_tty.c | 209 ++++++++++++++++++++++++++++++----------------------
 1 file changed, 119 insertions(+), 90 deletions(-)

-- 
2.2.2

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ