<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/tty/pty.c, branch v3.16.46</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.46</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.46'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-02-25T10:34:48Z</updated>
<entry>
<title>pty: make sure super_block is still valid in final /dev/tty close</title>
<updated>2016-02-25T10:34:48Z</updated>
<author>
<name>Herton R. Krzesinski</name>
<email>herton@redhat.com</email>
</author>
<published>2016-01-14T19:56:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a40b6fea8775560cc06327b6e673ad5ce27e1599'/>
<id>urn:sha1:a40b6fea8775560cc06327b6e673ad5ce27e1599</id>
<content type='text'>
commit 1f55c718c290616889c04946864a13ef30f64929 upstream.

Considering current pty code and multiple devpts instances, it's possible
to umount a devpts file system while a program still has /dev/tty opened
pointing to a previosuly closed pty pair in that instance. In the case all
ptmx and pts/N files are closed, umount can be done. If the program closes
/dev/tty after umount is done, devpts_kill_index will use now an invalid
super_block, which was already destroyed in the umount operation after
running -&gt;kill_sb. This is another "use after free" type of issue, but now
related to the allocated super_block instance.

To avoid the problem (warning at ida_remove and potential crashes) for
this specific case, I added two functions in devpts which grabs additional
references to the super_block, which pty code now uses so it makes sure
the super block structure is still valid until pty shutdown is done.
I also moved the additional inode references to the same functions, which
also covered similar case with inode being freed before /dev/tty final
close/shutdown.

Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>pty: fix possible use after free of tty-&gt;driver_data</title>
<updated>2016-02-25T10:34:47Z</updated>
<author>
<name>Herton R. Krzesinski</name>
<email>herton@redhat.com</email>
</author>
<published>2016-01-11T14:07:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0efc1c2d06dab4cbd787af2ab32582e7e6d65ea4'/>
<id>urn:sha1:0efc1c2d06dab4cbd787af2ab32582e7e6d65ea4</id>
<content type='text'>
commit 2831c89f42dcde440cfdccb9fee9f42d54bbc1ef upstream.

This change fixes a bug for a corner case where we have the the last
release from a pty master/slave coming from a previously opened /dev/tty
file. When this happens, the tty-&gt;driver_data can be stale, due to all
ptmx or pts/N files having already been closed before (and thus the inode
related to these files, which tty-&gt;driver_data points to, being already
freed/destroyed).

The fix here is to keep a reference on the opened master ptmx inode.
We maintain the inode referenced until the final pty_unix98_shutdown,
and only pass this inode to devpts_kill_index.

Signed-off-by: Herton R. Krzesinski &lt;herton@redhat.com&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>tty: Prevent untrappable signals from malicious program</title>
<updated>2015-03-02T13:17:02Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2015-01-19T18:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0d8aa1862e1a818c09555d8a2f65453e75adf389'/>
<id>urn:sha1:0d8aa1862e1a818c09555d8a2f65453e75adf389</id>
<content type='text'>
commit 37480a05685ed5b8e1b9bf5e5c53b5810258b149 upstream.

Commit 26df6d13406d1a5 ("tty: Add EXTPROC support for LINEMODE")
allows a process which has opened a pty master to send _any_ signal
to the process group of the pty slave. Although potentially
exploitable by a malicious program running a setuid program on
a pty slave, it's unknown if this exploit currently exists.

Limit to signals actually used.

Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: Howard Chu &lt;hyc@symas.com&gt;
Cc: One Thousand Gnomes &lt;gnomes@lxorguk.ukuu.org.uk&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>tty: Fix lock order in tty_do_resize()</title>
<updated>2013-07-24T22:12:53Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-07-24T20:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dee4a0be69c0e2996188e0c46478eadc280a8954'/>
<id>urn:sha1:dee4a0be69c0e2996188e0c46478eadc280a8954</id>
<content type='text'>
Commits 6a1c0680cf3ba94356ecd58833e1540c93472a57 and
9356b535fcb71db494fc434acceb79f56d15bda2, respectively
  'tty: Convert termios_mutex to termios_rwsem' and
  'n_tty: Access termios values safely'
introduced a circular lock dependency with console_lock and
termios_rwsem.

The lockdep report [1] shows that n_tty_write() will attempt
to claim console_lock while holding the termios_rwsem, whereas
tty_do_resize() may already hold the console_lock while
claiming the termios_rwsem.

Since n_tty_write() and tty_do_resize() do not contend
over the same data -- the tty-&gt;winsize structure -- correct
the lock dependency by introducing a new lock which
specifically serializes access to tty-&gt;winsize only.

[1] Lockdep report

======================================================
[ INFO: possible circular locking dependency detected ]
3.10.0-0+tip-xeon+lockdep #0+tip Not tainted
-------------------------------------------------------
modprobe/277 is trying to acquire lock:
 (&amp;tty-&gt;termios_rwsem){++++..}, at: [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0

but task is already holding lock:
 ((fb_notifier_list).rwsem){.+.+.+}, at: [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((fb_notifier_list).rwsem){.+.+.+}:
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff8175b797&gt;] down_read+0x47/0x5c
       [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0
       [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
       [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
       [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
       [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
       [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
       [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
       [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
       [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
       [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
       [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
       [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
       [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
       [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
       [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
       [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
       [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
       [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
       [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
       [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
       [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
       [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

-&gt; #1 (console_lock){+.+.+.}:
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff810430a7&gt;] console_lock+0x77/0x80
       [&lt;ffffffff8146b2a1&gt;] con_flush_chars+0x31/0x50
       [&lt;ffffffff8145780c&gt;] n_tty_write+0x1ec/0x4d0
       [&lt;ffffffff814541b9&gt;] tty_write+0x159/0x2e0
       [&lt;ffffffff814543f5&gt;] redirected_tty_write+0xb5/0xc0
       [&lt;ffffffff811ab9d5&gt;] vfs_write+0xc5/0x1f0
       [&lt;ffffffff811abec5&gt;] SyS_write+0x55/0xa0
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (&amp;tty-&gt;termios_rwsem){++++..}:
       [&lt;ffffffff810b65c3&gt;] __lock_acquire+0x1c43/0x1d30
       [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
       [&lt;ffffffff8175b724&gt;] down_write+0x44/0x70
       [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0
       [&lt;ffffffff8146c841&gt;] vc_do_resize+0x3e1/0x4c0
       [&lt;ffffffff8146c99f&gt;] vc_resize+0x1f/0x30
       [&lt;ffffffff813e4535&gt;] fbcon_init+0x385/0x5a0
       [&lt;ffffffff8146a4bc&gt;] visual_init+0xbc/0x120
       [&lt;ffffffff8146cd13&gt;] do_bind_con_driver+0x163/0x320
       [&lt;ffffffff8146cfa1&gt;] do_take_over_console+0x61/0x70
       [&lt;ffffffff813e2b93&gt;] do_fbcon_takeover+0x63/0xc0
       [&lt;ffffffff813e67a5&gt;] fbcon_event_notify+0x715/0x820
       [&lt;ffffffff81762f9d&gt;] notifier_call_chain+0x5d/0x110
       [&lt;ffffffff8107aadc&gt;] __blocking_notifier_call_chain+0x6c/0xc0
       [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
       [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
       [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
       [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
       [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
       [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
       [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
       [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
       [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
       [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
       [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
       [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
       [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
       [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
       [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
       [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
       [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
       [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
       [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
       [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
       [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
       [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
       [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

other info that might help us debug this:

Chain exists of:
  &amp;tty-&gt;termios_rwsem --&gt; console_lock --&gt; (fb_notifier_list).rwsem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((fb_notifier_list).rwsem);
                               lock(console_lock);
                               lock((fb_notifier_list).rwsem);
  lock(&amp;tty-&gt;termios_rwsem);

 *** DEADLOCK ***

7 locks held by modprobe/277:
 #0:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff81497b5b&gt;] __driver_attach+0x5b/0xb0
 #1:  (&amp;__lockdep_no_validate__){......}, at: [&lt;ffffffff81497b69&gt;] __driver_attach+0x69/0xb0
 #2:  (drm_global_mutex){+.+.+.}, at: [&lt;ffffffffa008a6dd&gt;] drm_get_pci_dev+0xbd/0x2a0 [drm]
 #3:  (registration_lock){+.+.+.}, at: [&lt;ffffffff813d93f5&gt;] register_framebuffer+0x25/0x320
 #4:  (&amp;fb_info-&gt;lock){+.+.+.}, at: [&lt;ffffffff813d8116&gt;] lock_fb_info+0x26/0x60
 #5:  (console_lock){+.+.+.}, at: [&lt;ffffffff813d95a4&gt;] register_framebuffer+0x1d4/0x320
 #6:  ((fb_notifier_list).rwsem){.+.+.+}, at: [&lt;ffffffff8107aac6&gt;] __blocking_notifier_call_chain+0x56/0xc0

stack backtrace:
CPU: 0 PID: 277 Comm: modprobe Not tainted 3.10.0-0+tip-xeon+lockdep #0+tip
Hardware name: Dell Inc. Precision WorkStation T5400  /0RW203, BIOS A11 04/30/2012
 ffffffff8213e5e0 ffff8802aa2fb298 ffffffff81755f19 ffff8802aa2fb2e8
 ffffffff8174f506 ffff8802aa2fa000 ffff8802aa2fb378 ffff8802aa2ea8e8
 ffff8802aa2ea910 ffff8802aa2ea8e8 0000000000000006 0000000000000007
Call Trace:
 [&lt;ffffffff81755f19&gt;] dump_stack+0x19/0x1b
 [&lt;ffffffff8174f506&gt;] print_circular_bug+0x1fb/0x20c
 [&lt;ffffffff810b65c3&gt;] __lock_acquire+0x1c43/0x1d30
 [&lt;ffffffff810b775e&gt;] ? mark_held_locks+0xae/0x120
 [&lt;ffffffff810b78d5&gt;] ? trace_hardirqs_on_caller+0x105/0x1d0
 [&lt;ffffffff810b6d62&gt;] lock_acquire+0x92/0x1f0
 [&lt;ffffffff81452656&gt;] ? tty_do_resize+0x36/0xe0
 [&lt;ffffffff8175b724&gt;] down_write+0x44/0x70
 [&lt;ffffffff81452656&gt;] ? tty_do_resize+0x36/0xe0
 [&lt;ffffffff81452656&gt;] tty_do_resize+0x36/0xe0
 [&lt;ffffffff8146c841&gt;] vc_do_resize+0x3e1/0x4c0
 [&lt;ffffffff8146c99f&gt;] vc_resize+0x1f/0x30
 [&lt;ffffffff813e4535&gt;] fbcon_init+0x385/0x5a0
 [&lt;ffffffff8146a4bc&gt;] visual_init+0xbc/0x120
 [&lt;ffffffff8146cd13&gt;] do_bind_con_driver+0x163/0x320
 [&lt;ffffffff8146cfa1&gt;] do_take_over_console+0x61/0x70
 [&lt;ffffffff813e2b93&gt;] do_fbcon_takeover+0x63/0xc0
 [&lt;ffffffff813e67a5&gt;] fbcon_event_notify+0x715/0x820
 [&lt;ffffffff81762f9d&gt;] notifier_call_chain+0x5d/0x110
 [&lt;ffffffff8107aadc&gt;] __blocking_notifier_call_chain+0x6c/0xc0
 [&lt;ffffffff8107ab46&gt;] blocking_notifier_call_chain+0x16/0x20
 [&lt;ffffffff813d7c0b&gt;] fb_notifier_call_chain+0x1b/0x20
 [&lt;ffffffff813d95b2&gt;] register_framebuffer+0x1e2/0x320
 [&lt;ffffffffa01043e1&gt;] drm_fb_helper_initial_config+0x371/0x540 [drm_kms_helper]
 [&lt;ffffffff8173cbcb&gt;] ? kmemleak_alloc+0x5b/0xc0
 [&lt;ffffffff81198874&gt;] ? kmem_cache_alloc_trace+0x104/0x290
 [&lt;ffffffffa01035e1&gt;] ? drm_fb_helper_single_add_all_connectors+0x81/0xf0 [drm_kms_helper]
 [&lt;ffffffffa01bcb05&gt;] nouveau_fbcon_init+0x105/0x140 [nouveau]
 [&lt;ffffffffa01ad0af&gt;] nouveau_drm_load+0x43f/0x610 [nouveau]
 [&lt;ffffffffa008a79e&gt;] drm_get_pci_dev+0x17e/0x2a0 [drm]
 [&lt;ffffffffa01ad4da&gt;] nouveau_drm_probe+0x25a/0x2a0 [nouveau]
 [&lt;ffffffff8175f162&gt;] ? _raw_spin_unlock_irqrestore+0x42/0x80
 [&lt;ffffffff813b13db&gt;] local_pci_probe+0x4b/0x80
 [&lt;ffffffff813b1701&gt;] pci_device_probe+0x111/0x120
 [&lt;ffffffff814977eb&gt;] driver_probe_device+0x8b/0x3a0
 [&lt;ffffffff81497bab&gt;] __driver_attach+0xab/0xb0
 [&lt;ffffffff81497b00&gt;] ? driver_probe_device+0x3a0/0x3a0
 [&lt;ffffffff814956ad&gt;] bus_for_each_dev+0x5d/0xa0
 [&lt;ffffffff814971fe&gt;] driver_attach+0x1e/0x20
 [&lt;ffffffff81496cc1&gt;] bus_add_driver+0x111/0x290
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffff814982b7&gt;] driver_register+0x77/0x170
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffff813b0454&gt;] __pci_register_driver+0x64/0x70
 [&lt;ffffffffa008a9da&gt;] drm_pci_init+0x11a/0x130 [drm]
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffffa022a000&gt;] ? 0xffffffffa0229fff
 [&lt;ffffffffa022a04d&gt;] nouveau_drm_init+0x4d/0x1000 [nouveau]
 [&lt;ffffffff810002ea&gt;] do_one_initcall+0xea/0x1a0
 [&lt;ffffffff810c54cb&gt;] load_module+0x123b/0x1bf0
 [&lt;ffffffff81399a50&gt;] ? ddebug_proc_open+0xb0/0xb0
 [&lt;ffffffff813855ae&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [&lt;ffffffff810c5f57&gt;] SyS_init_module+0xd7/0x120
 [&lt;ffffffff817677c2&gt;] system_call_fastpath+0x16/0x1b

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: Remove extra wakeup from pty write() path</title>
<updated>2013-07-24T16:29:56Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-07-24T12:29:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ede52538ee2b2202d9dff5b06c33bfde421e6e4'/>
<id>urn:sha1:5ede52538ee2b2202d9dff5b06c33bfde421e6e4</id>
<content type='text'>
Acquiring the write_wait queue spin lock now accounts for the largest
slice of cpu time on the tty write path. Two factors contribute to
this situation; a overly-pessimistic line discipline write loop which
_always_ sets up a wait loop even if i/o will immediately succeed, and
on ptys, a wakeup storm from reads and writes.

Writer wakeup does not need to be performed by the pty driver.
Firstly, since the actual i/o is performed within the write, the
line discipline write loop will continue while space remains in
the flip buffers. Secondly, when space becomes avail in the
line discipline receive buffer (and thus also in the flip buffers),
the pty unthrottle re-wakes the writer (non-flow-controlled line
disciplines unconditionally unthrottle the driver when data is
received). Thus, existing in-kernel i/o is guaranteed to advance.
Finally, writer wakeup occurs at the conclusion of the line discipline
write (in tty_write_unlock()). This guarantees that any user-space write
waiters are woken to continue additional i/o.

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: Track flip buffer memory limit atomically</title>
<updated>2013-07-23T23:47:08Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7bfe0b7116be207cf2204ae06335cc89d8f8ee02'/>
<id>urn:sha1:7bfe0b7116be207cf2204ae06335cc89d8f8ee02</id>
<content type='text'>
Lockless flip buffers require atomically updating the bytes-in-use
watermark.

The pty driver also peeks at the watermark value to limit
memory consumption to a much lower value than the default; query
the watermark with new fn, tty_buffer_space_avail().

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: Convert termios_mutex to termios_rwsem</title>
<updated>2013-07-23T23:43:01Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-15T13:14:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6a1c0680cf3ba94356ecd58833e1540c93472a57'/>
<id>urn:sha1:6a1c0680cf3ba94356ecd58833e1540c93472a57</id>
<content type='text'>
termios is commonly accessed unsafely (especially by N_TTY)
because the existing mutex forces exclusive access.
Convert existing usage.

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 transient pty write() EIO</title>
<updated>2013-06-17T19:37:29Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2013-06-13T19:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7c61c3d8f44d5d822f758754287af644307b4af9'/>
<id>urn:sha1:7c61c3d8f44d5d822f758754287af644307b4af9</id>
<content type='text'>
Commit 699390354da6c258b65bf8fa79cfd5feaede50b6
('pty: Ignore slave pty close() if never successfully opened')
introduced a bug with ptys whereby a write() in parallel with an
open() on an existing pty could mistakenly indicate an I/O error.

Only indicate an I/O error if the condition on open() actually exists.

Reported-by: Markus Trippelsdorf &lt;markus@trippelsdorf.de&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-by: Mikael Pettersson &lt;mikpe@it.uu.se&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.9
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: fix up atime/mtime mess, take three</title>
<updated>2013-05-01T14:32:21Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-05-01T14:32:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0b885657b6c8ef63a46bc9299b2a7715d19acde'/>
<id>urn:sha1:b0b885657b6c8ef63a46bc9299b2a7715d19acde</id>
<content type='text'>
We first tried to avoid updating atime/mtime entirely (commit
b0de59b5733d: "TTY: do not update atime/mtime on read/write"), and then
limited it to only update it occasionally (commit 37b7f3c76595: "TTY:
fix atime/mtime regression"), but it turns out that this was both
insufficient and overkill.

It was insufficient because we let people attach to the shared ptmx node
to see activity without even reading atime/mtime, and it was overkill
because the "only once a minute" means that you can't really tell an
idle person from an active one with 'w'.

So this tries to fix the problem properly.  It marks the shared ptmx
node as un-notifiable, and it lowers the "only once a minute" to a few
seconds instead - still long enough that you can't time individual
keystrokes, but short enough that you can tell whether somebody is
active or not.

Reported-by: Simon Kirby &lt;sim@hostway.ca&gt;
Acked-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>TTY: pty, fix compilation warning</title>
<updated>2013-04-15T18:02:54Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2013-04-15T05:52:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f4b208eb91776b0522b41c78fac6cf08134db78f'/>
<id>urn:sha1:f4b208eb91776b0522b41c78fac6cf08134db78f</id>
<content type='text'>
When CONFIG_UNIX98_PTYS is unset, we see this warning in pty:
  drivers/tty/pty.c:409:13: warning: ‘pty_unix98_shutdown’ defined but not used

Fix that by moving the function to a section which depends on that
config.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: Toralf Foerster &lt;toralf.foerster@gmx.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
