<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/tty/tty_io.c, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-09-15T08:00:56Z</updated>
<entry>
<title>tty: Fix data race between tiocsti() and flush_to_ldisc()</title>
<updated>2021-09-15T08:00:56Z</updated>
<author>
<name>Nguyen Dinh Phi</name>
</author>
<published>2021-08-23T00:06:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=495bb7e896c6a2a36f55a6a9e04889a7837bc9c8'/>
<id>urn:sha1:495bb7e896c6a2a36f55a6a9e04889a7837bc9c8</id>
<content type='text'>
commit bb2853a6a421a052268eee00fd5d3f6b3504b2b1 upstream.

The ops-&gt;receive_buf() may be accessed concurrently from these two
functions.  If the driver flushes data to the line discipline
receive_buf() method while tiocsti() is waiting for the
ops-&gt;receive_buf() to finish its work, the data race will happen.

For example:
tty_ioctl			|tty_ldisc_receive_buf
 -&gt;tioctsi			| -&gt;tty_port_default_receive_buf
				|  -&gt;tty_ldisc_receive_buf
   -&gt;hci_uart_tty_receive	|   -&gt;hci_uart_tty_receive
    -&gt;h4_recv                   |    -&gt;h4_recv

In this case, the h4 receive buffer will be overwritten by the
latecomer, and we will lost the data.

Hence, change tioctsi() function to use the exclusive lock interface
from tty_buffer to avoid the data race.

Reported-by: syzbot+97388eb9d31b997fe1d0@syzkaller.appspotmail.com
Reviewed-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Signed-off-by: Nguyen Dinh Phi &lt;phind.uet@gmail.com&gt;
Link: https://lore.kernel.org/r/20210823000641.2082292-1-phind.uet@gmail.com
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: make tty_release_redirect() static</title>
<updated>2021-04-15T08:28:30Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2021-04-08T12:51:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd9f611442578ca8392e90adbca5815d79946b5e'/>
<id>urn:sha1:dd9f611442578ca8392e90adbca5815d79946b5e</id>
<content type='text'>
No one calls this outside of the tty_io.c file, so mark this static and
do not export the symbol anymore.

Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20210408125134.3016837-11-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: create internal tty.h file</title>
<updated>2021-04-15T08:22:17Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2021-04-08T12:51:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98602c010ceba82f2c2384122dbd07bc965fd367'/>
<id>urn:sha1:98602c010ceba82f2c2384122dbd07bc965fd367</id>
<content type='text'>
There are a number of functions and #defines in include/linux/tty.h that
do not belong there as they are private to the tty core code.

Create an initial drivers/tty/tty.h file and copy the odd "tty logging"
macros into it to seed the file with some initial things that we know
nothing outside of the tty core should be calling.

Cc: Tetsuo Handa &lt;penguin-kernel@i-love.sakura.ne.jp&gt;
Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20210408125134.3016837-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: refactor TIOCSSERIAL handling</title>
<updated>2021-04-10T08:36:34Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2021-04-07T09:52:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=885c77d528e14df86c1e146541c57f1c0ce0708e'/>
<id>urn:sha1:885c77d528e14df86c1e146541c57f1c0ce0708e</id>
<content type='text'>
Factor out the deprecated serial flags handling and tty-operation check
shared with the compat TIOCSSERIAL handler.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20210407095208.31838-6-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: use pr_warn_ratelimited() for deprecated serial flags</title>
<updated>2021-04-10T08:36:34Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2021-04-07T09:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b7bc6b10a7eab0f5f9d7d8ee5a4b230a9dcb487'/>
<id>urn:sha1:1b7bc6b10a7eab0f5f9d7d8ee5a4b230a9dcb487</id>
<content type='text'>
Use pr_warn_ratelimited() when warning about deprecated serial flags
instead of open coding.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20210407095208.31838-5-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: fix return value for unsupported ioctls</title>
<updated>2021-04-10T08:36:34Z</updated>
<author>
<name>Johan Hovold</name>
</author>
<published>2021-04-07T09:52:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b8b20868a6d64cfe8174a21b25b74367bdf0560'/>
<id>urn:sha1:1b8b20868a6d64cfe8174a21b25b74367bdf0560</id>
<content type='text'>
Drivers should return -ENOTTY ("Inappropriate I/O control operation")
when an ioctl isn't supported, while -EINVAL is used for invalid
arguments.

Fix up the TIOCMGET, TIOCMSET and TIOCGICOUNT helpers which returned
-EINVAL when a tty driver did not implement the corresponding
operations.

Note that the TIOCMGET and TIOCMSET helpers predate git and do not get a
corresponding Fixes tag below.

Fixes: d281da7ff6f7 ("tty: Make tiocgicount a handler")
Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Link: https://lore.kernel.org/r/20210407095208.31838-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.12-rc3 into tty-next</title>
<updated>2021-03-15T07:43:49Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2021-03-15T07:43:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=280def1e1c17d35b21206881937d4498bcc1f503'/>
<id>urn:sha1:280def1e1c17d35b21206881937d4498bcc1f503</id>
<content type='text'>
Resolves a merge issue with:
	drivers/tty/hvc/hvcs.c
and we want the tty/serial fixes from 5.12-rc3 in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: localise ptychar and make it const</title>
<updated>2021-03-10T08:34:09Z</updated>
<author>
<name>Jiri Slaby</name>
</author>
<published>2021-03-02T06:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a846dcf9d7295dd45493002fdde081f1667a85d3'/>
<id>urn:sha1:a846dcf9d7295dd45493002fdde081f1667a85d3</id>
<content type='text'>
ptychar was not const, so mark it as such. And move this variable to the
only place where it's used.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20210302062214.29627-36-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: let tty_unregister_driver return void</title>
<updated>2021-03-10T08:34:09Z</updated>
<author>
<name>Jiri Slaby</name>
</author>
<published>2021-03-02T06:22:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a872ab4d6d191cca1ce84b945e394bd6a8d84dd9'/>
<id>urn:sha1:a872ab4d6d191cca1ce84b945e394bd6a8d84dd9</id>
<content type='text'>
Now that noone checks the return value, switch the return type of
tty_unregister_driver to void. We can do that as we always return zero.

Generally, drivers are not allowed to call tty_unregister_driver while
there are open devices.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20210302062214.29627-35-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "drivers:tty:pty: Fix a race causing data loss on close"</title>
<updated>2021-03-10T08:27:56Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2021-03-04T16:18:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c776b77a279c327fe9e7710e71a3400766554255'/>
<id>urn:sha1:c776b77a279c327fe9e7710e71a3400766554255</id>
<content type='text'>
This reverts commit 33d4ae98859873ddd49e22e4ca724387548b3d89.

Pierre-Louis writes:

	Our SOF/audio CI shows an across-the-board regression when we try v5.12-rc1,
	specifically on pause/resume tests with an interactive terminal running 'aplay
	-i' commands managed by expect to simulate the user pressing the space bar to
	pause/unpause. It turns out the processes are not longer killed and the audio
	devices remain busy (see publicly available test results listed below).

	git bisect points to commit 33d4ae9885987 ("drivers:tty:pty: Fix a race
	causing data loss on close"). Reverting the patch fixes the issue on all test
	devices.

	Further analysis with Corey Minyard points to a problem where a slave tty will
	not get a SIGHUP when the master is closed.

So revert this for now:

Reported-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Link: https://lore.kernel.org/r/00154592-c5ee-aaba-956e-b265473b53bc@linux.intel.com
Cc: Corey Minyard &lt;cminyard@mvista.com&gt;
Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;,
Fixes: 33d4ae988598 ("drivers:tty:pty: Fix a race causing data loss on close")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
