<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/tty/tty_io.c, branch dev-4.3</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.3</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.3'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2016-02-19T22:28:34+00:00</updated>
<entry>
<title>tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)</title>
<updated>2016-02-19T22:28:34+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-11T06:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=459cd75bada64e377cdeb92f1f76f8c474e73e46'/>
<id>urn:sha1:459cd75bada64e377cdeb92f1f76f8c474e73e46</id>
<content type='text'>
commit 5c17c861a357e9458001f021a7afa7aab9937439 upstream.

ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).

However, directly accessing the current ldisc via tty-&gt;ldisc is
unsafe; the ldisc ptr dereferenced may be stale if the line discipline
is changing via ioctl(TIOCSETD) or hangup.

Wait for the line discipline reference (just like read() or write())
to retrieve the "current" line discipline id.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty: Retry failed reopen if tty teardown in-progress</title>
<updated>2016-02-19T22:28:34+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T05:13:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=be883527a34effc3c7d2d851593a587956d0a6d1'/>
<id>urn:sha1:be883527a34effc3c7d2d851593a587956d0a6d1</id>
<content type='text'>
commit 7f22f6c935cda600660e623a411fe380015d28d9 upstream.

A small window exists where a tty reopen will observe the tty
just prior to imminent teardown (tty-&gt;count == 0); in this case, open()
returns EIO to userspace.

Instead, retry the open after checking for signals and yielding;
this interruptible retry loop allows teardown to commence and initialize
a new tty on retry. Never retry the BSD master pty reopen; there is no
guarantee the pty pair teardown is imminent since the slave file
descriptors may remain open indefinitely.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tty: Fix tty_send_xchar() lock order inversion</title>
<updated>2015-12-09T19:34:42+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-11-11T13:03:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=2be56f43e40a65249132d153b14b8c33cb635d4d'/>
<id>urn:sha1:2be56f43e40a65249132d153b14b8c33cb635d4d</id>
<content type='text'>
commit ee0c1a65cf95230d5eb3d9de94fd2ead9a428c67 upstream.

The correct lock order is atomic_write_lock =&gt; termios_rwsem, as
established by tty_write() =&gt; n_tty_write().

Fixes: c274f6ef1c666 ("tty: Hold termios_rwsem for tcflow(TCIxxx)")
Reported-and-Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/tty: require read access for controlling terminal</title>
<updated>2015-10-04T18:20:30+00:00</updated>
<author>
<name>Jann Horn</name>
<email>jann@thejh.net</email>
</author>
<published>2015-10-04T17:29:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=0c55627167870255158db1cde0d28366f91c8872'/>
<id>urn:sha1:0c55627167870255158db1cde0d28366f91c8872</id>
<content type='text'>
This is mostly a hardening fix, given that write-only access to other
users' ttys is usually only given through setgid tty executables.

Signed-off-by: Jann Horn &lt;jann@thejh.net&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: don't leak cdev in tty_cdev_add()</title>
<updated>2015-10-04T17:51:42+00:00</updated>
<author>
<name>Leon Yu</name>
<email>chianglungyu@gmail.com</email>
</author>
<published>2015-09-07T13:08:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c1a752ba2d6b8a52879c7ab637cff38359ea9827'/>
<id>urn:sha1:c1a752ba2d6b8a52879c7ab637cff38359ea9827</id>
<content type='text'>
Commit a3a10ce3429e ("Avoid usb reset crashes by making tty_io cdevs truly
dynamic") which mixes using cdev_alloc() and cdev_init() is problematic.
Subsequent call to cdev_init() after cdev_alloc() sets kobj release method
from cdev_dynamic_release() to cdev_default_release() and thus makes it
impossible to free allocated cdev.

This patch also consolidates error path of cdev_add() as cdev can also leak
here if things went wrong.

Signed-off-by: Leon Yu &lt;chianglungyu@gmail.com&gt;
Fixes: a3a10ce3429e ("Avoid usb reset crashes by making tty_io cdevs truly dynamic")
Acked-by: Richard Watts &lt;rrw@kynesim.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Avoid usb reset crashes by making tty_io cdevs truly dynamic</title>
<updated>2015-08-03T22:24:43+00:00</updated>
<author>
<name>Richard Watts</name>
<email>rrw@kynesim.co.uk</email>
</author>
<published>2015-05-19T15:06:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a3a10ce3429e5dee623ad5c8407ea58e204fcb0a'/>
<id>urn:sha1:a3a10ce3429e5dee623ad5c8407ea58e204fcb0a</id>
<content type='text'>
Avoid usb reset crashes by making tty_io cdevs truly dynamic

Signed-off-by: Richard Watts &lt;rrw@kynesim.co.uk&gt;
Reported-by: Duncan Mackintosh &lt;DMackintosh@cbnl.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: Replace #ifdef TTY_DEBUG_HANGUP with tty_debug_hangup()</title>
<updated>2015-07-24T01:37:31+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-07-13T02:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=accff793af81bc64e1b37398ef6bb1f0b06491de'/>
<id>urn:sha1:accff793af81bc64e1b37398ef6bb1f0b06491de</id>
<content type='text'>
Add tty_debug_hangup() macro which uses tty_debug to print the
debug message; remove inlined #ifdefs.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: core: Add tty_debug() for printk(KERN_DEBUG) messages</title>
<updated>2015-07-24T01:37:31+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-07-13T02:49:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e2dfa3d38797058fa03478b08bab3d3c4b081615'/>
<id>urn:sha1:e2dfa3d38797058fa03478b08bab3d3c4b081615</id>
<content type='text'>
Introduce tty_debug() macro to output uniform debug information for
tty core debug messages (function name and tty name).

Note: printk(KERN_DEBUG) is retained here over pr_debug() since
messages can be enabled in non-DEBUG builds.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: core: Improve debug message content</title>
<updated>2015-07-24T01:31:29+00:00</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-07-13T02:49:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=3a6b02dc1f1b37fe2e9c86c00edf07c04bed9fab'/>
<id>urn:sha1:3a6b02dc1f1b37fe2e9c86c00edf07c04bed9fab</id>
<content type='text'>
Output the function name, tty name, and invariant failure (if applicable).
Add the tty count to the tty_open() message. Fix the disassociate_ctty()
message, which printed the NULL pointer and the wrong message.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: add missing rcu_read_lock for task_pgrp</title>
<updated>2015-07-24T00:56:38+00:00</updated>
<author>
<name>Patrick Donnelly</name>
<email>batrick@batbytes.com</email>
</author>
<published>2015-07-12T22:51:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=6719693ca2efb0f04654d05768ee299e87e1694b'/>
<id>urn:sha1:6719693ca2efb0f04654d05768ee299e87e1694b</id>
<content type='text'>
task_pgrp requires an rcu or tasklist lock to be obtained if the returned pid
is to be dereferenced, which kill_pgrp does. Obtain an RCU lock for the
duration of use.

Signed-off-by: Patrick Donnelly &lt;batrick@batbytes.com&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
